yanqiliang 1 неделя назад
Родитель
Сommit
481910c524
2 измененных файлов с 10 добавлено и 2 удалено
  1. 5 2
      src/pages.json
  2. 5 0
      src/utils/unreadMessage.js

+ 5 - 2
src/pages.json

@@ -138,7 +138,8 @@
 		"selectedColor": "#1C86EE",
 		"borderStyle": "white",
 		"backgroundColor": "#fff",
-		"current": 1,
+		/* 消息 Tab 暂不展示,默认选中工作台。恢复消息 Tab 时请改回 1。 */
+		"current": 0,
 		"list": [
 			{
 				"pagePath": "pages/tabBar/home/home",
@@ -146,12 +147,14 @@
 				"iconPath": "static/assets/images/workbench.png",
 				"selectedIconPath": "static/assets/images/workbenchS.png"
 			},
+			/* 消息 Tab 暂时隐藏,保留配置以便后续恢复。
 			{
 				"pagePath": "pages/tabBar/messageCenter/messageCenter",
 				"text": "消息",
 				"iconPath": "static/assets/images/message.png",
 				"selectedIconPath": "static/assets/images/messageS.png"
 			},
+			*/
 			{
 				"pagePath": "pages/tabBar/login/login",
 				"text": "我的",
@@ -453,4 +456,4 @@
 			"van-skeleton": "./wxcomponents/vant/skeleton/index"
 		}
 	}
-}
+}

+ 5 - 0
src/utils/unreadMessage.js

@@ -114,11 +114,16 @@ function markAsRead(receiveID, opts) {
  */
 function updateMessageRedDot(total) {
     try {
+        // 消息 Tab 暂时隐藏,避免未读消息红点显示在当前索引 1 的“我的”Tab 上。
+        uni.hideTabBarRedDot({ index: 1 });
+
+        /* 恢复消息 Tab 后,取消以下注释以恢复未读红点展示逻辑。
         if (total > 0) {
             uni.showTabBarRedDot({ index: 1 });
         } else {
             uni.hideTabBarRedDot({ index: 1 });
         }
+        */
     } catch (e) {
         console.warn('[unreadMessage] updateMessageRedDot failed:', e);
     }