From aacf4d73c23cf52b800ff2d115edd0835ae146df Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Sat, 3 Feb 2024 22:18:40 +0800 Subject: [PATCH] 11 --- pages/index/downstream.vue | 21 ++++++++++++++++++--- pages/index/index.vue | 12 ++++++------ pages/index/upstream.vue | 24 ++++++++++++++++++++---- 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/pages/index/downstream.vue b/pages/index/downstream.vue index 43e829a..634f43e 100644 --- a/pages/index/downstream.vue +++ b/pages/index/downstream.vue @@ -35,19 +35,34 @@ export default { }], popupShow: false, shopName: '', - list:[] + list:[], + pages: 1, + pageNum:1, + status: 'loadmore' } }, onShow() { this.getList() + }, + onReachBottom() { + if (this.pageNum >= this.pages) return; + this.status = 'loading'; + this.pageNum += 1; + this.getList(); }, methods: { getList() { this.tui.request("/app/customer/debt", "POST", { - shopId:this.shopIndex + pageNum:this.pageNum, + pageSize:10, }, false, true).then((res) => { if(res.code == 200){ - this.list = res.result + this.pages = res.result.pages + if (this.pages == 1) { + this.list = res.result.records + } else { + this.list = [...this.list, ...res.result.records] + } }else{ this.tui.toast(res.message) } diff --git a/pages/index/index.vue b/pages/index/index.vue index e9722af..e282f8e 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -227,11 +227,6 @@ totalJCount:res.result.totalJCount, totalProfit:res.result.totalProfit } - for (var i = 0; i <= res.result.salePage.records.length; i++) { - res.result.salePage.records[i].img = '/static/images/dingdan/dd' + i + '.png' - this.inventoryList = res.result.salePage.records - } - this.waitCount = res.result.countMap let dataList = { categories: this.getWeek(), series: [{ @@ -247,7 +242,12 @@ data: res.result.weekSale }] }; - this.chartData = JSON.parse(JSON.stringify(dataList)); + this.chartData = JSON.parse(JSON.stringify(dataList)); + for (var i = 0; i <= res.result.salePage.records.length; i++) { + res.result.salePage.records[i].img = '/static/images/dingdan/dd' + i + '.png' + this.inventoryList = res.result.salePage.records + } + this.waitCount = res.result.countMap } else { this.tui.toast(res.message) } diff --git a/pages/index/upstream.vue b/pages/index/upstream.vue index 0d3ea89..aafd287 100644 --- a/pages/index/upstream.vue +++ b/pages/index/upstream.vue @@ -11,7 +11,8 @@ 欠款总金额: {{ item.noPay == null ?'暂无':item.noPay }} - + + @@ -35,7 +36,10 @@ }], popupShow: false, shopName: '', - list: [] + list: [], + pages: 1, + pageNum:1, + status: 'loadmore' } }, onShow(){ @@ -43,14 +47,26 @@ }, onLoad() { + }, + onReachBottom() { + if (this.pageNum >= this.pages) return; + this.status = 'loading'; + this.pageNum += 1; + this.getList(); }, methods: { getList() { this.tui.request("/app/purchase/debt", "get", { - shopId: this.shopIndex + pageNum:this.pageNum, + pageSize:10 }, false, true).then((res) => { if (res.code == 200) { - this.list = res.result + this.pages = res.result.pages + if (this.pages == 1) { + this.list = res.result.records + } else { + this.list = [...this.list, ...res.result.records] + } } else { this.tui.toast(res.message) }