diff --git a/pages/index/downarrears.vue b/pages/index/downarrears.vue index 581d35a..0679c02 100644 --- a/pages/index/downarrears.vue +++ b/pages/index/downarrears.vue @@ -37,7 +37,10 @@ return { userId: '', nickname: '', - list: [] + list: [], + status: 'loadmore', + pages:1, + pageNumber:1 } }, onLoad(options) { @@ -47,14 +50,30 @@ }, onShow(){ this.getList() + }, + onReachBottom() { + if (this.pages >= this.pageNum) return; + this.status = 'loading'; + this.pages = ++this.pages; + this.getList(); }, methods: { getList() { this.tui.request("/app/sale/customSale", "post", { - userId: this.userId - }, false, true).then((res) => { + userId: this.userId, + pageVo: { + pageSize: 10, + pageNumber: this.pageNumber + } + }, false, false).then((res) => { + this.status = 'nomore'; if (res.code == 200) { - this.list = res.result + if (this.pages == 1) { + this.list = res.result + } else { + this.list = [...this.list, ...res.result] + } + this.pageNumber = res.result.pages } else { this.tui.toast(res.message) } diff --git a/pages/index/uparrears.vue b/pages/index/uparrears.vue index 8126ec4..9d0b18a 100644 --- a/pages/index/uparrears.vue +++ b/pages/index/uparrears.vue @@ -37,7 +37,10 @@ return { supplierId: '', consigneeName: '', - list: [], + list: [], + status: 'loadmore', + pages:1, + pageNumber:1, } }, onShow(){ @@ -46,14 +49,31 @@ onLoad(options) { this.supplierId = options.supplierId this.consigneeName = options.consigneeName + }, + onReachBottom() { + if (this.pages >= this.pageNum) return; + this.status = 'loading'; + this.pages = ++this.pages; + this.getList(); }, methods: { getList() { this.tui.request("/app/purchase/debtPurchase", "get", { - supplierId: this.supplierId - }, false, true).then((res) => { + supplierId: this.supplierId, + pageVo: { + pageSize: 10, + pageNumber: this.pageNumber + } + }, false, true).then((res) => { + this.status = 'nomore'; if (res.code == 200) { - this.list = res.result + // this.list = res.result + if (this.pages == 1) { + this.list = res.result + } else { + this.list = [...this.list, ...res.result] + } + this.pageNumber = res.result.pages } else { this.tui.toast(res.message) }