diff --git a/pages/index/index.vue b/pages/index/index.vue index c910403..afdc968 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1117,6 +1117,10 @@ }, getDelivery() { let that = this + that.waimaiCount = 0 + that.kuaidiCount = 0 + that.paotuiCount = 0 + that.zhipaiCount = 0 this.tui.request("/mall/delivery/page", "POST", this.searchForm, false, false).then((res) => { that.loadStatus = 'nomore'; if (res.code == 200) { @@ -1142,7 +1146,7 @@ } else { that.deliveryItem = [...that.deliveryItem, ...res.result.records] } - if (res.result.orderCount != null) { + if (res.result.orderCount != null && res.result.orderCount.length > 0) { for (let i = 0; i < res.result.orderCount.length; i++) { if (res.result.orderCount[i].deliveryType == 1) { that.waimaiCount = res.result.orderCount[i].orderCount @@ -1152,7 +1156,12 @@ that.paotuiCount = res.result.orderCount[i].orderCount } } + }else{ + that.waimaiCount = 0 + that.kuaidiCount = 0 + that.paotuiCount = 0 } + if (res.result.zhipaiCount != undefined && res.result.zhipaiCount != null) { that.zhipaiCount = res.result.zhipaiCount }