From ffe6d39f01a92b9e71ccb14038cfd337d0b166ca Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期四, 23 十月 2025 21:00:35 +0800
Subject: [PATCH] fix: bug

---
 apps/cMiniApp/src/custom-tab-bar/index.tsx |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/apps/cMiniApp/src/custom-tab-bar/index.tsx b/apps/cMiniApp/src/custom-tab-bar/index.tsx
index aa19d04..44fb564 100644
--- a/apps/cMiniApp/src/custom-tab-bar/index.tsx
+++ b/apps/cMiniApp/src/custom-tab-bar/index.tsx
@@ -68,8 +68,10 @@
     const isLogin = useIsLogin();
 
     const loginTipShowed = ref(false);
+    const isClicking = ref(false);
 
     const switchTab = (url: string, index: number) => {
+      if (isClicking.value) return;
       if (!isLogin.value && whitePageList.every((x) => x !== url)) {
         if (!loginTipShowed.value) {
           loginTipShowed.value = true;
@@ -85,9 +87,14 @@
         }
         return;
       }
-      Taro.switchTab({ url }).then(() => {
-        system.setTabIndex(index);
-      });
+      isClicking.value = true;
+      Taro.switchTab({ url })
+        .then(() => {
+          system.setTabIndex(index);
+        })
+        .finally(() => {
+          isClicking.value = false;
+        });
     };
 
     function goPublish() {

--
Gitblit v1.9.1