fix: 上拉分页查询判断

This commit is contained in:
wangzhuo
2025-08-22 17:09:15 +08:00
parent 1703e5987c
commit 8389a78b3a
2 changed files with 80 additions and 77 deletions

View File

@@ -23,14 +23,17 @@
/>
</view>
<!-- 分页部分 -->
<!-- 分页部分 top="68rpx" -->
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
:up="upOption" :down="downOption" :fixed="false" textColor="#ffffff" bgColor="#ffffff"
class="scroll-h" :class="{'loading-scroll':cssFlag}"
>
<view class="white-bg margin-bottom20" v-for="(item, index) in list" :key="index"
<block v-for="(item, index) in list" :key="index">
<view class="white-bg margin-bottom20"
@touchstart="handleTouchStart(item)"
@touchend="handleTouchEnd">
@touchend="handleTouchEnd"
v-if="item && item.auditStatus !== '办事处审核通过'"
>
<view class="report-list">
<view class="w-b-title title" @dblclick.stop="handleDetail(item)">
{{ item.cusName }}
@@ -72,6 +75,7 @@
</view>
</view>
</block>
</mescroll-uni>
</view>
</view>
@@ -151,7 +155,7 @@ const downCallback = async (mescroll) => {
list.value = res.list;
cssFlag.value = false;
// 正确传递 total 参数
mescroll.endSuccess(res.list.length, res.total > (mescroll.size || upOption.page.size));
mescroll.endSuccess(res.list.length, res.total >= mescroll.size);
uni.hideLoading();
}, 500);
@@ -173,7 +177,7 @@ const upCallback = async (mescroll) => {
list.value.push(...res.list);
}
// 正确判断是否还有更多数据
mescroll.endSuccess(res.list.length, res.total > mescroll.num * mescroll.size);
mescroll.endSuccess(res.list.length, res.total >= mescroll.size);
uni.hideLoading();
}, 500);
} catch (error) {
@@ -203,9 +207,7 @@ const getList = (pageIndex, pageSize) => {
let handleDetail = (item) => {
uni.navigateTo({
url: "/pages/business/CRM/customer/components/customerUserEdit",
events: {
},
events: {},
success(res) {
res.eventChannel.emit('editCusData', {param: item, isAdd: false})
}
@@ -311,7 +313,6 @@ let handleCopyInfo=(item)=>{
}
.search .btn-search {
border: none;
background: none;
@@ -338,6 +339,7 @@ let handleCopyInfo=(item)=>{
.white-bg {
padding-bottom: 10rpx;
.w-b-title {
align-items: flex-start;
}

View File

@@ -181,7 +181,8 @@ const upCallback = async (mescroll) => {
list.value.push(...res.list);
}
// 正确判断是否还有更多数据
mescroll.endSuccess(res.list.length, res.total > mescroll.num * mescroll.size);
mescroll.endBySize(res.list.length, res.total)
// mescroll.endSuccess(res.list.length, res.total > mescroll.num * mescroll.size);
}, 500);
} catch (error) {
console.log(error)