wangfukang 3 years ago
parent
commit
aacf4d73c2
  1. 21
      pages/index/downstream.vue
  2. 12
      pages/index/index.vue
  3. 24
      pages/index/upstream.vue

21
pages/index/downstream.vue

@ -35,19 +35,34 @@ 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", {
shopId:this.shopIndex pageNum:this.pageNum,
pageSize:10,
}, false, true).then((res) => { }, false, true).then((res) => {
if(res.code == 200){ if(res.code == 200){
this.list = res.result 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)
} }

12
pages/index/index.vue

@ -227,11 +227,6 @@
totalJCount:res.result.totalJCount, totalJCount:res.result.totalJCount,
totalProfit:res.result.totalProfit totalProfit:res.result.totalProfit
} }
for (var i = 0; i <= res.result.salePage.records.length; i++) {
res.result.salePage.records[i].img = '/static/images/dingdan/dd' + i + '.png'
this.inventoryList = res.result.salePage.records
}
this.waitCount = res.result.countMap
let dataList = { let dataList = {
categories: this.getWeek(), categories: this.getWeek(),
series: [{ series: [{
@ -247,7 +242,12 @@
data: res.result.weekSale data: res.result.weekSale
}] }]
}; };
this.chartData = JSON.parse(JSON.stringify(dataList)); this.chartData = JSON.parse(JSON.stringify(dataList));
for (var i = 0; i <= res.result.salePage.records.length; i++) {
res.result.salePage.records[i].img = '/static/images/dingdan/dd' + i + '.png'
this.inventoryList = res.result.salePage.records
}
this.waitCount = res.result.countMap
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }

24
pages/index/upstream.vue

@ -11,7 +11,8 @@
<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>
@ -35,7 +36,10 @@
}], }],
popupShow: false, popupShow: false,
shopName: '', shopName: '',
list: [] list: [],
pages: 1,
pageNum:1,
status: 'loadmore'
} }
}, },
onShow(){ onShow(){
@ -43,14 +47,26 @@
}, },
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", {
shopId: this.shopIndex pageNum:this.pageNum,
pageSize:10
}, false, true).then((res) => { }, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.list = res.result 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