From 11f74b9aa262bbd2e38948a4b06dabc10b5f38fc Mon Sep 17 00:00:00 2001 From: tianyi <13521030702@163.com> Date: Fri, 8 May 2026 09:34:58 +0800 Subject: [PATCH] 1 --- components/tab-bar/myCenter.vue | 43 +++------------------------------ components/tab-bar/tab-bar.vue | 15 +++++++++++- 2 files changed, 17 insertions(+), 41 deletions(-) diff --git a/components/tab-bar/myCenter.vue b/components/tab-bar/myCenter.vue index 8adf5c3..3ca728b 100644 --- a/components/tab-bar/myCenter.vue +++ b/components/tab-bar/myCenter.vue @@ -53,48 +53,11 @@ this.workerCounts = 0 this.shopCounts = 0 if(worker){ - this.tui.request("/mall/delivery/countOrderByStatus", "POST", {workerId:uni.getStorageSync('worker').workerId,regionId:JSON.parse(uni.getStorageSync('area')).id}, false, true).then((res) => { - if (res.code == 200) { - if(res.result != null){ - for(let i = 0;i {}); + this.workerCounts = uni.getStorageSync('workerCounts') + } if(shopId){ - this.tui.request("/mall/order/countByShop/"+uni.getStorageSync('shopId'), "GET", {}, false, true).then((res) => { - if (res.code == 200) { - this.shopData = res.result - for(let i=0;i {}) + this.shopCounts = uni.getStorageSync('shopCounts') } }, clickShop(item){ diff --git a/components/tab-bar/tab-bar.vue b/components/tab-bar/tab-bar.vue index 45b2cc1..c7f6bf7 100644 --- a/components/tab-bar/tab-bar.vue +++ b/components/tab-bar/tab-bar.vue @@ -95,7 +95,7 @@ if (index == i) { this.$emit('tab-index', i); if(index == 2) return - if(index != 0 && index != 4){ + if(index != 0){ this.getWorkerCounts() } this.tabList[i].isCheck = true @@ -134,6 +134,10 @@ }else{ this.indexMyCount += Number(res.result[i].orderCount) } + if(res.result[i].status == 3){ + let workerCounts = Number(res.result[i].orderCount) + uni.setStorageSync('workerCounts',workerCounts) + } } } that.$forceUpdate(); @@ -148,21 +152,30 @@ this.tui.request("/mall/order/countByShop/"+uni.getStorageSync('shopId'), "GET", {}, false, true).then((res) => { if (res.code == 200) { this.shopData = res.result + let shopCounts = 0 for(let i=0;i