From 627dadb39cd61f333c734ae6ce761969919c61b1 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 23 Jun 2026 18:29:03 +0800 Subject: [PATCH] 1 --- pages/index/index.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index e626792..19f096c 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -915,7 +915,17 @@ const tabIndex = this.pendingTabIndex this.pendingTabIndex = null this.$nextTick(() => { - this.changeIndex(tabIndex) + Promise.resolve(this.refreshTabCounts()).then(() => { + this.changeIndex(tabIndex) + }) + }) + } else { + this.$nextTick(() => { + Promise.resolve(this.refreshTabCounts()).then(() => { + if (this.currentIndex == 4 && this.$refs.myCenterPage) { + this.$refs.myCenterPage.init() + } + }) }) } }, @@ -926,6 +936,12 @@ }, 500); }, methods: { + refreshTabCounts() { + if (this.$refs.tabBar && this.$refs.tabBar.getWorkerCounts) { + return this.$refs.tabBar.getWorkerCounts() + } + return Promise.resolve() + }, runHomeInit() { // 保证首页数据实时:每次显示首页都重新初始化数据。 this.indexInit() @@ -1013,7 +1029,6 @@ this.searchForm.kuaidiData = []; this.getDelivery(); this.getShopArea(); - this.$refs.tabBar.getWorkerCounts() } // 计算导航栏高度用于sticky offset:statusBarHeight + 40px内容区 const info = uni.getSystemInfoSync();