From f670b79094c95d791fc43c8fc8b5858ebf8426dc Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 17 九月 2026 13:50:29 +0800
Subject: [PATCH] 一些向web对齐

---
 src/pages/login.vue |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/pages/login.vue b/src/pages/login.vue
index 82e3f18..5498c07 100644
--- a/src/pages/login.vue
+++ b/src/pages/login.vue
@@ -231,6 +231,16 @@
     }, 30000);
   }
 
+  // tabbar 瑙掓爣锛氱櫥褰曞悗瀹氭椂鍒锋柊鏃跺彲鑳藉凡涓嶅湪 tabBar 椤甸潰锛屽け璐ラ潤榛樺拷鐣�
+  function callTabBarApi(api, options) {
+    try {
+      const ret = uni[api](options);
+      if (ret && typeof ret.catch === "function") ret.catch(() => {});
+    } catch (e) {
+      /* 闈� tabBar 椤甸潰锛屽拷鐣� */
+    }
+  }
+
   // 鏇存柊鏈娑堟伅鏁伴噺
   function updateNoticeCount(userId) {
     getNoticeCount(userId)
@@ -239,12 +249,12 @@
         console.log("鏈娑堟伅鏁伴噺:", count);
         // 鏇存柊tabbar鐨勮鏍�
         if (count > 0) {
-          uni.setTabBarBadge({
+          callTabBarApi("setTabBarBadge", {
             index: 2, // 娑堟伅鏍囩椤电殑绱㈠紩
             text: count.toString(),
           });
         } else {
-          uni.removeTabBarBadge({
+          callTabBarApi("removeTabBarBadge", {
             index: 2,
           });
         }

--
Gitblit v1.9.3