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,
shopName: '',
list:[],
pages: 1,
pageNum:1,
status: 'loadmore'
list:[]
}
},
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", {
pageNum:this.pageNum,
pageSize:10,
}, false, true).then((res) => {
this.tui.request("/app/customer/debt", "POST", {}, 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]
}
this.list = res.result
}else{
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__money">{{ item.noPay == null ?'暂无':item.noPay }}</view>
</view>
</view>
<u-loadmore :status="status" />
</view>
</view>
</view>
</view>
@ -36,10 +35,7 @@
}],
popupShow: false,
shopName: '',
list: [],
pages: 1,
pageNum:1,
status: 'loadmore'
list: []
}
},
onShow(){
@ -47,26 +43,12 @@
},
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", {
pageNum:this.pageNum,
pageSize:10
}, 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]
}
this.tui.request("/app/purchase/debt", "get", {}, false, true).then((res) => {
if (res.code == 200) {
this.list = res.result
} else {
this.tui.toast(res.message)
}

Loading…
Cancel
Save