From 58d5fd5747bc2c926431369aaaa2e0a13e010f29 Mon Sep 17 00:00:00 2001 From: xuan Date: Tue, 7 Mar 2023 19:29:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(ID1001461):=20=E3=80=90?= =?UTF-8?q?=E5=86=85=E9=83=A8=E5=95=86=E5=9F=8E=E3=80=91-=E5=9C=A8?= =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E5=86=85=E6=98=BE=E7=A4=BA=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【【内部商城】-在购物车内显示订单列表】 https://www.tapd.cn/53459131/bugtrace/bugs/view/1153459131001001461 --- src/custom-tab-bar/index.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/custom-tab-bar/index.tsx b/src/custom-tab-bar/index.tsx index c642196..d31332e 100644 --- a/src/custom-tab-bar/index.tsx +++ b/src/custom-tab-bar/index.tsx @@ -11,6 +11,7 @@ import { useSelector } from '@/reducers/hooks' import { TabBarType } from '@/constants/tabbar' import type { TabBarAction } from '@/reducers/tabBar' import { UseSubscriptionMessage } from '@/use/useCommon' +import { debounce } from '@/common/util' type IconfontName = Parameters['0']['name'] @@ -41,16 +42,14 @@ const CustomTabBar: FC = () => { const setSelected = (id: TabBarIndexMap[number]['id']) => { dispatch({ type: TabBarType.SET_SELECTED, data: { tabItem, selectedId: id } }) } - const handleSelectTabItem = (id: TabBarIndexMap[number]['id']) => { - return async() => { - setSelected(id) - if (id === 3) { - await openSubscriptionMessage({ scenes: 1 }) - } - console.log(id, 'item') - Taro.switchTab({ url: tabItem?.find(item => item.id === id)?.pagePath as string }) + const handleSelectTabItem = debounce(async(id: TabBarIndexMap[number]['id']) => { + setSelected(id) + if (id === 3) { + await openSubscriptionMessage({ scenes: 1 }) } - } + console.log(id, 'item') + Taro.switchTab({ url: tabItem?.find(item => item.id === id)?.pagePath as string }) + }, 300) return ( @@ -60,7 +59,7 @@ const CustomTabBar: FC = () => { handleSelectTabItem(item.id)} >