wangfukang 3 years ago
parent
commit
c5232d37aa
  1. 27
      pages/index/downarrears.vue
  2. 28
      pages/index/uparrears.vue

27
pages/index/downarrears.vue

@ -37,7 +37,10 @@
return { return {
userId: '', userId: '',
nickname: '', nickname: '',
list: [] list: [],
status: 'loadmore',
pages:1,
pageNumber:1
} }
}, },
onLoad(options) { onLoad(options) {
@ -47,14 +50,30 @@
}, },
onShow(){ onShow(){
this.getList() this.getList()
},
onReachBottom() {
if (this.pages >= this.pageNum) return;
this.status = 'loading';
this.pages = ++this.pages;
this.getList();
}, },
methods: { methods: {
getList() { getList() {
this.tui.request("/app/sale/customSale", "post", { this.tui.request("/app/sale/customSale", "post", {
userId: this.userId userId: this.userId,
}, false, true).then((res) => { pageVo: {
pageSize: 10,
pageNumber: this.pageNumber
}
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) { 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 { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }

28
pages/index/uparrears.vue

@ -37,7 +37,10 @@
return { return {
supplierId: '', supplierId: '',
consigneeName: '', consigneeName: '',
list: [], list: [],
status: 'loadmore',
pages:1,
pageNumber:1,
} }
}, },
onShow(){ onShow(){
@ -46,14 +49,31 @@
onLoad(options) { onLoad(options) {
this.supplierId = options.supplierId this.supplierId = options.supplierId
this.consigneeName = options.consigneeName this.consigneeName = options.consigneeName
},
onReachBottom() {
if (this.pages >= this.pageNum) return;
this.status = 'loading';
this.pages = ++this.pages;
this.getList();
}, },
methods: { methods: {
getList() { getList() {
this.tui.request("/app/purchase/debtPurchase", "get", { this.tui.request("/app/purchase/debtPurchase", "get", {
supplierId: this.supplierId supplierId: this.supplierId,
}, false, true).then((res) => { pageVo: {
pageSize: 10,
pageNumber: this.pageNumber
}
}, false, true).then((res) => {
this.status = 'nomore';
if (res.code == 200) { 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 { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }

Loading…
Cancel
Save