Просмотр исходного кода

fix: 修复小程序登录后首页状态不更新 + TabBar图标缺失

User 4 месяцев назад
Родитель
Сommit
ec30c0e548
2 измененных файлов с 10 добавлено и 9 удалено
  1. 6 2
      cfc-frontend/pages.json
  2. 4 7
      cfc-frontend/pages/index/index.vue

+ 6 - 2
cfc-frontend/pages.json

@@ -540,6 +540,10 @@
         {
           "path": "orders/orders",
           "style": { "navigationBarTitleText": "订单管理" }
+        },
+        {
+          "path": "product-edit/product-edit",
+          "style": { "navigationBarTitleText": "发布商品" }
         }
       ]
     },
@@ -675,8 +679,8 @@
       {
         "pagePath": "pages/wisdom/index",
         "text": "智",
-        "iconPath": "static/tab-wisdom.png",
-        "selectedIconPath": "static/tab-wisdom-active.png"
+        "iconPath": "static/tab-wealth.png",
+        "selectedIconPath": "static/tab-wealth-active.png"
       },
       {
         "pagePath": "pages/mind/index",

+ 4 - 7
cfc-frontend/pages/index/index.vue

@@ -178,21 +178,18 @@ export default {
     // 冷启动检查:是否已展示品牌启动页
     if (!uni.getStorageSync('_splashReady') && !this.showSplash) {
       this.showSplash = true
+      // 立即标记已展示,防止 reLaunch 等场景下重复触发 splash
+      uni.setStorageSync('_splashReady', true)
       var self = this
       setTimeout(function() {
         self.showSplash = false
-        uni.setStorageSync('_splashReady', true)
-        // splash 结束后执行初始化
-        self._doInit()
       }, 2500)
-      return
+      // 不因 splash 阻塞初始化逻辑 — splash 仅是视觉遮盖层
     }
     this._doInit(options)
   },
   onShow() {
-    if (this.showSplash) {
-      return
-    }
+    // 始终执行初始化,不因 splash 状态跳过,确保登录态变更后及时切换视图
     this._doInit()
   },
   _doInit(options) {