wangfukang 3 years ago
parent
commit
54ae8affb1
  1. 23
      pages/index/downstream.vue
  2. 28
      pages/index/upstream.vue

23
pages/index/downstream.vue

@ -35,34 +35,17 @@ export default {
}], }],
popupShow: false, popupShow: false,
shopName: '', shopName: '',
list:[], list:[]
pages: 1,
pageNum:1,
status: 'loadmore'
} }
}, },
onShow() { onShow() {
this.getList() this.getList()
},
onReachBottom() {
if (this.pageNum >= this.pages) return;
this.status = 'loading';
this.pageNum += 1;
this.getList();
}, },
methods: { methods: {
getList() { getList() {
this.tui.request("/app/customer/debt", "POST", { this.tui.request("/app/customer/debt", "POST", {}, false, true).then((res) => {
pageNum:this.pageNum,
pageSize:10,
}, false, true).then((res) => {
if(res.code == 200){ if(res.code == 200){
this.pages = res.result.pages this.list = res.result
if (this.pages == 1) {
this.list = res.result.records
} else {
this.list = [...this.list, ...res.result.records]
}
}else{ }else{
this.tui.toast(res.message) this.tui.toast(res.message)
} }

28
pages/index/upstream.vue

@ -11,8 +11,7 @@
<view class="swipe-action__content__right__text">欠款总金额:</view> <view class="swipe-action__content__right__text">欠款总金额:</view>
<view class="swipe-action__content__right__money">{{ item.noPay == null ?'暂无':item.noPay }}</view> <view class="swipe-action__content__right__money">{{ item.noPay == null ?'暂无':item.noPay }}</view>
</view> </view>
</view> </view>
<u-loadmore :status="status" />
</view> </view>
</view> </view>
</view> </view>
@ -36,10 +35,7 @@
}], }],
popupShow: false, popupShow: false,
shopName: '', shopName: '',
list: [], list: []
pages: 1,
pageNum:1,
status: 'loadmore'
} }
}, },
onShow(){ onShow(){
@ -47,26 +43,12 @@
}, },
onLoad() { onLoad() {
},
onReachBottom() {
if (this.pageNum >= this.pages) return;
this.status = 'loading';
this.pageNum += 1;
this.getList();
}, },
methods: { methods: {
getList() { getList() {
this.tui.request("/app/purchase/debt", "get", { this.tui.request("/app/purchase/debt", "get", {}, false, true).then((res) => {
pageNum:this.pageNum, if (res.code == 200) {
pageSize:10 this.list = res.result
}, false, true).then((res) => {
if (res.code == 200) {
this.pages = res.result.pages
if (this.pages == 1) {
this.list = res.result.records
} else {
this.list = [...this.list, ...res.result.records]
}
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }

Loading…
Cancel
Save