From e7d735e93ec619fd0e199ddf1f3ce9b7a2f0706b Mon Sep 17 00:00:00 2001 From: "@QQNZX" Date: Tue, 5 Dec 2023 15:43:39 +0800 Subject: [PATCH] =?UTF-8?q?12.05=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pagesHome/PointsMing/PointsMing.vue | 47 +++++++++++++++++-- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/gasStation-uni/pagesHome/PointsMing/PointsMing.vue b/gasStation-uni/pagesHome/PointsMing/PointsMing.vue index 3be1975ca..e9cc617dc 100644 --- a/gasStation-uni/pagesHome/PointsMing/PointsMing.vue +++ b/gasStation-uni/pagesHome/PointsMing/PointsMing.vue @@ -21,7 +21,7 @@ - + @@ -32,7 +32,11 @@ export default { data() { return { - title: '', + show: false, + status: 'loading', + pageNo: 1, + pageSize: 10, + totalDetail: '', detailList: [], mingList: [ "3", "4", "5", "6", @@ -47,6 +51,21 @@ }, onShow() { this.getIntegralDetailList() + }, + onReachBottom() { + this.show = true + if (this.detailList.length >= this.totalDetail) { + uni.showToast({ + title: '没有下一页数据', + icon: 'none' + }) + this.status = "nomore" + } else { + this.pageNo++ + this.getIntegralDetailList() + } + + }, methods: { goback() { @@ -54,15 +73,30 @@ }, // 查询我的积分明细 getIntegralDetailList() { + uni.showLoading({ + title: '加载中' + }); request({ url: 'business/integral/integralDetail/queryByPageUni', method: 'get', params: { - chainStoreId: uni.getStorageSync('chainStoreId') + chainStoreId: uni.getStorageSync('chainStoreId'), + pageNo: this.pageNo, + pageSize: this.pageSize } }).then((res) => { if (res.code == 200) { - this.detailList = res.data.records + + if (this.pageNo != 1) { + this.detailList = this.detailList.concat(res.data.records) + } else { + this.detailList = res.data.records + } + this.totalDetail = res.data.total + // let total = res.data.total + // this.totalDetail = Math.ceil(total / this.pageSize); + console.log(this.totalDetail); + uni.hideLoading(); } }) }, @@ -73,13 +107,16 @@