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

View File

@@ -181,7 +181,8 @@ const upCallback = async (mescroll) => {
list.value.push(...res.list); 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); }, 500);
} catch (error) { } catch (error) {
console.log(error) console.log(error)