From 7a012e04ea98f939f9099498753314ff4fc17ba6 Mon Sep 17 00:00:00 2001
From: wangfukang <15630117759@163.com>
Date: Wed, 22 Jul 2026 15:22:56 +0800
Subject: [PATCH] 1
---
package2/shop/shopSettlementDetail.vue | 38 ++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/package2/shop/shopSettlementDetail.vue b/package2/shop/shopSettlementDetail.vue
index ad0fa92..46d8f5f 100644
--- a/package2/shop/shopSettlementDetail.vue
+++ b/package2/shop/shopSettlementDetail.vue
@@ -68,6 +68,7 @@
暂无账单明细
+ {{loadStatus === 'loading' ? '加载中...' : loadStatus === 'nomore' ? '没有更多了' : '上拉加载更多'}}
@@ -78,6 +79,11 @@
return {
menuButtonInfo: {},
loading: false,
+ loadStatus: 'more',
+ total: 0,
+ pages: 1,
+ pageNumber: 1,
+ pageSize: 10,
query: {
shopId: '',
regionId: '',
@@ -94,6 +100,11 @@
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
},
+ onReachBottom() {
+ if (this.loading || this.pageNumber >= this.pages) return
+ this.pageNumber++
+ this.getDetailList()
+ },
onLoad(option) {
this.query = {
shopId: option.shopId || uni.getStorageSync('shopId') || '',
@@ -105,6 +116,9 @@
totalBaseAmount: option.totalBaseAmount || 0,
totalCommissionAmount: option.totalCommissionAmount || 0
}
+ this.pageNumber = 1
+ this.pages = 1
+ this.detailList = []
this.getDetailList()
},
methods: {
@@ -121,20 +135,34 @@
getDetailList() {
if (!this.query.shopId || !this.query.billTime) return
this.loading = true
+ this.loadStatus = 'loading'
this.tui.request('/mall/admin/settlement/detailList', 'POST', {
regionId: this.query.regionId,
shopId: this.query.shopId,
settlementDate: this.query.billTime,
- status: this.query.status
+ status: this.query.status,
+ pageNumber: this.pageNumber,
+ pageSize: this.pageSize
}, false, false).then((res) => {
this.loading = false
if (res.code == 200) {
- this.detailList = Array.isArray(res.result) ? res.result : []
+ const result = res.result || {}
+ const records = Array.isArray(result.records) ? result.records : (Array.isArray(result) ? result : [])
+ this.total = result.total || records.length
+ this.pages = result.pages || 1
+ if (this.pageNumber == 1) {
+ this.detailList = records
+ } else {
+ this.detailList = this.detailList.concat(records)
+ }
+ this.loadStatus = this.pageNumber >= this.pages ? 'nomore' : 'more'
} else {
+ this.loadStatus = 'more'
this.tui.toast(res.message || '获取账单明细失败')
}
}).catch(() => {
this.loading = false
+ this.loadStatus = 'more'
})
},
toAmount(value) {
@@ -341,4 +369,10 @@
text-align: center;
color: #9aa6a2;
}
+
+ .load-state {
+ padding: 36rpx 0 60rpx;
+ text-align: center;
+ color: #9aa6a2;
+ }