tianyi 1 week ago
parent
commit
d8e90fcb00
  1. 27
      pages/index/index.vue

27
pages/index/index.vue

@ -508,6 +508,8 @@
lastScrollTop: 0, lastScrollTop: 0,
worker:null, worker:null,
isSwitching: true, isSwitching: true,
indexZhipaiCount:0,
indexWorkerCount:0,
getAreaData:{}, getAreaData:{},
putAreaData:{}, putAreaData:{},
yongjin:false, yongjin:false,
@ -615,6 +617,7 @@
} }
this.getDelivery(); this.getDelivery();
this.getShopArea(); this.getShopArea();
this.getWorkerCounts();
} }
// sticky offsetstatusBarHeight + 40px // sticky offsetstatusBarHeight + 40px
const info = uni.getSystemInfoSync(); const info = uni.getSystemInfoSync();
@ -707,6 +710,30 @@
uni.hideLoading(); uni.hideLoading();
}).catch((res) => {}); }).catch((res) => {});
}, },
getWorkerCounts(){
if(!uni.getStorageSync('worker')){
return;
}
let that = this
this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId}, false, true).then((res) => {
if (res.code == 200) {
if(res.result != null){
for(let i = 0;i<res.result.length;i++){
if(res.result[i].status == 0){
this.indexZhipaiCount = Number(res.result[i].orderCount)
}else{
this.indexWorkerCount += Number(res.result[i].orderCount)
}
}
}
that.$forceUpdate();
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
},
checkTab(index) { checkTab(index) {
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
this.menuList[i].checked = (i === index); this.menuList[i].checked = (i === index);

Loading…
Cancel
Save