|
@@ -1,7 +1,27 @@
|
|
<template>
|
|
<template>
|
|
<uni-popup @maskClick="emits('Close')" :animation="false" mask-background-color="rgba(0,0,0,0)" ref="catalog" background-color="#fff" @change="onChange">
|
|
<uni-popup @maskClick="emits('Close')" :animation="false" mask-background-color="rgba(0,0,0,0)" ref="catalog" background-color="#fff" @change="onChange">
|
|
|
|
+ <view style="'position': fixed;display: flex;
|
|
|
|
+ 'justify-content': space-around;
|
|
|
|
+ 'align-items': center;margin-left: auto;padding-left: 10%;padding-right: 10%;margin-top: 5%;" :style="{'backgroundColor':db_color}">
|
|
|
|
+ <image :src="book_data.book_cover" style="width: 100rpx;height: 150rpx;"></image>
|
|
|
|
+ <view style="margin-left: 100rpx;">
|
|
|
|
+ <view style="font-size: 1.5ex;" :style="{'color':font_color}" >{{book_data.book_name}}</view>
|
|
|
|
+ <view style="font-size: 1.5ex; margin-top: 50rpx;" :style="{'color':font_color}" >{{book_data.author_name}}</view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view style="display: flex;
|
|
|
|
+ align-items: center;margin-top: 5%;">
|
|
|
|
+ <view :style="{'color':font_color,'fontSize':'1.5ex','paddingLeft':'10%','width':'65%'}">{{tools.book_status_title(book_data)}}</view>
|
|
|
|
+ <view @click="onClickSort" :style="{'color':font_color,'fontSize':'1.5ex'}">
|
|
|
|
+ <image src="../../static/logo.png" style="width: 25rpx;height: 25rpx;;"></image>
|
|
|
|
+ <text :style="{'color':font_color,'width':'80%'}">{{ sortName }} </text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view style="border-bottom: #eee solid 1px;display: flex;
|
|
|
|
+ align-items: center;margin-top: 5%;">
|
|
|
|
+ </view>
|
|
<view
|
|
<view
|
|
- :style="{'backgroundColor':db_color}"
|
|
|
|
|
|
+ :style="{'backgroundColor':db_color,'paddingLeft':'10%','paddingRight':'10%','marginTop':'5%'}"
|
|
@touchend.stop>
|
|
@touchend.stop>
|
|
<view>
|
|
<view>
|
|
<!-- <movable-area>
|
|
<!-- <movable-area>
|
|
@@ -33,9 +53,13 @@
|
|
transform: `translateY(${offset}px)`
|
|
transform: `translateY(${offset}px)`
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
- <view class="item-wrap" v-for="(item, index) in visibleData" :key="item.id">
|
|
|
|
|
|
+ <view v-for="(item, index) in visibleData" :key="item.id">
|
|
<!-- <slot :item="item" :active="active"></slot> -->
|
|
<!-- <slot :item="item" :active="active"></slot> -->
|
|
- <view :style="{'color':font_color}" class="directory-listItem" @click="clickChar(item)">{{ item.name }}</view>
|
|
|
|
|
|
+ <view :style="{'widows':'100%'}" class="directory-listItem" @click="clickChar(item)">
|
|
|
|
+ <text class="ellipsis" :style="{'color':font_color,'width':'80%'}">{{ item.name }} </text>
|
|
|
|
+ <image src="../../static/logo.png" style="width: 25rpx;height: 25rpx;;"></image>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
@@ -47,9 +71,11 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
- import { ref,onMounted,computed} from 'vue';
|
|
|
|
|
|
+ import { ref,onMounted,computed, nextTick} from 'vue';
|
|
import { ReadSetting } from '../../stores/readSetting';
|
|
import { ReadSetting } from '../../stores/readSetting';
|
|
import { tools } from '../../framework/tools';
|
|
import { tools } from '../../framework/tools';
|
|
|
|
+import { book_item_data } from '../../data/data';
|
|
|
|
+import { UserStatus } from '../../stores/userStatusManager';
|
|
// const {items,remain,size,active,scrollHeight} = defineProps(['items','remain','size','active','scrollHeight'])
|
|
// const {items,remain,size,active,scrollHeight} = defineProps(['items','remain','size','active','scrollHeight'])
|
|
const {items,remain,size,scrollHeight} =defineProps({
|
|
const {items,remain,size,scrollHeight} =defineProps({
|
|
items: {
|
|
items: {
|
|
@@ -84,9 +110,10 @@ import { tools } from '../../framework/tools';
|
|
let offset = ref(0)
|
|
let offset = ref(0)
|
|
let scrollTop = ref(0)
|
|
let scrollTop = ref(0)
|
|
let y = ref(0)
|
|
let y = ref(0)
|
|
-
|
|
|
|
|
|
+ let sortStatus = 1;
|
|
|
|
+ let sortName = ref('倒序')
|
|
let mode = ref(ReadSetting().getReadSetting().readMode)
|
|
let mode = ref(ReadSetting().getReadSetting().readMode)
|
|
-
|
|
|
|
|
|
+ let sortItems = ref(items)
|
|
const catalog = ref(null)
|
|
const catalog = ref(null)
|
|
onMounted(()=>{
|
|
onMounted(()=>{
|
|
const type = 'bottom'
|
|
const type = 'bottom'
|
|
@@ -99,17 +126,17 @@ import { tools } from '../../framework/tools';
|
|
})
|
|
})
|
|
|
|
|
|
let nextCount = computed(()=>{
|
|
let nextCount = computed(()=>{
|
|
- return Math.min(items.length - end.value, remain);
|
|
|
|
|
|
+ return Math.min(sortItems.value.length - end.value, remain);
|
|
})
|
|
})
|
|
|
|
|
|
let visibleData = computed(()=>{
|
|
let visibleData = computed(()=>{
|
|
const t_start = start.value - preCount.value;
|
|
const t_start = start.value - preCount.value;
|
|
const t_end = end.value + nextCount.value;
|
|
const t_end = end.value + nextCount.value;
|
|
- return items.slice(t_start, t_end);
|
|
|
|
|
|
+ return sortItems.value.slice(t_start, t_end);
|
|
})
|
|
})
|
|
|
|
|
|
let localHeight = computed(()=>{
|
|
let localHeight = computed(()=>{
|
|
- return items.length * size;
|
|
|
|
|
|
+ return sortItems.value.length * size;
|
|
})
|
|
})
|
|
|
|
|
|
function clickChar(item){
|
|
function clickChar(item){
|
|
@@ -148,6 +175,37 @@ import { tools } from '../../framework/tools';
|
|
let font_color = ref(tools.getFontColorByMode(ReadSetting().data.readMode))
|
|
let font_color = ref(tools.getFontColorByMode(ReadSetting().data.readMode))
|
|
let db_color = ref(tools.getDbColorByMode(ReadSetting().data.readMode))
|
|
let db_color = ref(tools.getDbColorByMode(ReadSetting().data.readMode))
|
|
|
|
|
|
|
|
+ let book_data:book_item_data = UserStatus().getUserSelectBook()
|
|
|
|
+
|
|
|
|
+ function onClickSort(){
|
|
|
|
+ if(sortStatus==1){
|
|
|
|
+ sortStatus = 2;
|
|
|
|
+ sortName.value = "正序"
|
|
|
|
+ }else{
|
|
|
|
+ sortStatus = 1;
|
|
|
|
+ sortName.value = "倒序"
|
|
|
|
+ }
|
|
|
|
+ sortItems.value = []
|
|
|
|
+ start.value = 0
|
|
|
|
+ end.value = 0
|
|
|
|
+ offset.value = 0
|
|
|
|
+ scrollTop.value = 0
|
|
|
|
+ y.value = 0
|
|
|
|
+ sortItems.value = items
|
|
|
|
+ nextTick(()=>{
|
|
|
|
+ if(sortStatus==1){
|
|
|
|
+ sortItems.value = sortItems.value.sort((a:any,b:any)=>{
|
|
|
|
+ return a.id - b.id
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ sortItems.value = sortItems.value.sort((a:any,b:any)=>{
|
|
|
|
+ return b.id - a.id
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -179,7 +237,7 @@ import { tools } from '../../framework/tools';
|
|
padding-left: 10px;
|
|
padding-left: 10px;
|
|
height: 40px;
|
|
height: 40px;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
- border-bottom: #eee solid 1px;
|
|
|
|
|
|
+ /* border-bottom: #eee solid 1px; */
|
|
}
|
|
}
|
|
.active {
|
|
.active {
|
|
color: red;
|
|
color: red;
|
|
@@ -200,4 +258,10 @@ import { tools } from '../../framework/tools';
|
|
.scroll-view::-webkit-scrollbar {
|
|
.scroll-view::-webkit-scrollbar {
|
|
display: none; /* 隐藏滚动条 */
|
|
display: none; /* 隐藏滚动条 */
|
|
}
|
|
}
|
|
|
|
+ .ellipsis {
|
|
|
|
+ white-space: nowrap; /* 防止文本换行 */
|
|
|
|
+ overflow: hidden; /* 隐藏超出容器的文本 */
|
|
|
|
+ text-overflow: ellipsis; /* 当文本溢出时显示省略号 */
|
|
|
|
+ width: 100%; /* 或其他你需要的宽度 */
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|