12.16提交
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
@refresherrefresh="onRefresh"
|
||||
@scrolltolower="onScrollToLower"
|
||||
:show-scrollbar="false"
|
||||
:scroll-top="scrollTop"
|
||||
>
|
||||
<!-- 指南列表 -->
|
||||
<view class="guidelines-list">
|
||||
@@ -91,10 +92,11 @@
|
||||
</view>
|
||||
|
||||
<!-- 无数据提示 -->
|
||||
<view class="no-data" v-if="guidelinesList.length === 0 && !isLoading">
|
||||
<empty v-if="guidelinesList.length === 0 && !isLoading"></empty>
|
||||
<!-- <view class="no-data" v-if="guidelinesList.length === 0 && !isLoading">
|
||||
<uni-icons type="info" size="60" color="#999"></uni-icons>
|
||||
<text>暂无数据</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 组内排序弹窗 -->
|
||||
@@ -152,6 +154,7 @@ import navTo from "@/utils/navTo.js";
|
||||
import hotImg from "@/static/hot_booklist.png";
|
||||
import downIng from "@/static/icon_library_down.png";
|
||||
let downList = uni.getStorageSync("downLoadPdf") || [];
|
||||
import empty from "@/components/empty/empty.vue";
|
||||
const downLoadList = ref(downList);
|
||||
// 响应式数据
|
||||
const guidelinesList = ref([]);
|
||||
@@ -173,8 +176,9 @@ const isSetStatus=ref(false);
|
||||
import downloadStore from "@/store/downloadStoreFile.js";
|
||||
const downloadTasks=ref([]);
|
||||
const downLoadtaskList=computed(()=>{
|
||||
return downloadTasks.value.filter((item)=>item.status == "completed").map((item)=>item.id);
|
||||
return downloadTasks.value.filter((item)=>item.status == "completed" && item.type == "zhinan").map((item)=>item.id);
|
||||
});
|
||||
const scrollTop = ref(0);
|
||||
const chooseInnerSort = (index) => {
|
||||
sort.value = index;
|
||||
isSetStatus.value = true;
|
||||
@@ -186,7 +190,20 @@ const chooseInnerSort = (index) => {
|
||||
innerSortTitle.value = "标题";
|
||||
}
|
||||
showInnerSort.value = false;
|
||||
loadGuidelinesList(true);
|
||||
currentPage.value = 1;
|
||||
hasMoreData.value = true;
|
||||
loadMoreStatus.value = "more";
|
||||
guidelinesList.value = [];
|
||||
// 滚动到顶部
|
||||
scrollTop.value = 0;
|
||||
|
||||
loadGuidelinesList(false);
|
||||
nextTick(() => {
|
||||
scrollTop.value = 0.01; // 触发滚动
|
||||
nextTick(() => {
|
||||
scrollTop.value = 0;
|
||||
});
|
||||
});
|
||||
};
|
||||
onLoad((options) => {
|
||||
console.log(options);
|
||||
@@ -223,7 +240,7 @@ onShow(() => {
|
||||
if (guidelinesList.value.length === 0) {
|
||||
loadGuidelinesList(false);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// 跳转到搜索页
|
||||
const goToSearch = () => {
|
||||
@@ -292,11 +309,12 @@ const onScrollToLower = () => {
|
||||
// 刷新数据
|
||||
const refreshData = async () => {
|
||||
try {
|
||||
guidelinesList.value = [];
|
||||
currentPage.value = 1;
|
||||
hasMoreData.value = true;
|
||||
loadMoreStatus.value = "more";
|
||||
|
||||
await loadGuidelinesList(true);
|
||||
await loadGuidelinesList(false);
|
||||
|
||||
uni.showToast({
|
||||
title: "刷新成功",
|
||||
@@ -325,7 +343,6 @@ const loadGuidelinesList = async (isRefresh = false) => {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
loadMoreStatus.value = "loading";
|
||||
|
||||
const params = {
|
||||
page: currentPage.value,
|
||||
pageSize: pageSize.value,
|
||||
@@ -336,7 +353,7 @@ const loadGuidelinesList = async (isRefresh = false) => {
|
||||
};
|
||||
|
||||
const res = await api.searchLibraryU(params);
|
||||
console.log("指南列表响应:", res);
|
||||
console.log("指南列表响应:", res.data.list);
|
||||
|
||||
if (res.code === 200 && res.data) {
|
||||
const newData = res.data.list;
|
||||
@@ -348,10 +365,7 @@ const loadGuidelinesList = async (isRefresh = false) => {
|
||||
guidelinesList.value = [...guidelinesList.value, ...newData];
|
||||
console.log("加载更多:追加数据到列表");
|
||||
}
|
||||
console.log(222222);
|
||||
console.log(res.data.pageSize);
|
||||
console.log(newData.length);
|
||||
// 判断是否还有更多数据
|
||||
|
||||
if (newData.length <res.data.pageSize) {
|
||||
loadMoreStatus.value = "noMore";
|
||||
hasMoreData.value = false;
|
||||
@@ -359,8 +373,6 @@ const loadGuidelinesList = async (isRefresh = false) => {
|
||||
} else {
|
||||
loadMoreStatus.value = "more";
|
||||
hasMoreData.value = true;
|
||||
console.log(333333);
|
||||
console.log(!isRefresh);
|
||||
// 只有在加载更多模式下才递增页码
|
||||
if (!isRefresh) {
|
||||
currentPage.value++;
|
||||
@@ -385,11 +397,7 @@ const loadGuidelinesList = async (isRefresh = false) => {
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
console.log("=== loadGuidelinesList 结束 ===");
|
||||
console.log("最终状态:", {
|
||||
loadMoreStatus: loadMoreStatus.value,
|
||||
page: currentPage.value,
|
||||
listLength: guidelinesList.value.length,
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user