From b51e2aad88af70617e9a06336879a7088f2fad8d Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期五, 24 十月 2025 17:27:18 +0800
Subject: [PATCH] fix: bug
---
apps/cMiniApp/src/custom-tab-bar/index.tsx | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/apps/cMiniApp/src/custom-tab-bar/index.tsx b/apps/cMiniApp/src/custom-tab-bar/index.tsx
index fec3385..44fb564 100644
--- a/apps/cMiniApp/src/custom-tab-bar/index.tsx
+++ b/apps/cMiniApp/src/custom-tab-bar/index.tsx
@@ -29,7 +29,8 @@
const TarBarItem = function (props: TarBarItemProps, context: SetupContext<TarBarItemEvents>) {
const _badge = props.badge > 99 ? '99+' : props.badge;
- const isActive = props.currentPath.toLowerCase().includes(props.pagePath.toLowerCase());
+ // const isActive = props.currentPath.toLowerCase().includes(props.pagePath.toLowerCase());
+ const isActive = props.active;
return (
<div
class={['bottom-tab-item', { active: isActive }, props.className]}
@@ -67,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;
@@ -84,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