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 {
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)
}

28
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)
}

Loading…
Cancel
Save