🐞 fix(ID1001461): 【内部商城】-在购物车内显示订单列表
【【内部商城】-在购物车内显示订单列表】 https://www.tapd.cn/53459131/bugtrace/bugs/view/1153459131001001461
This commit is contained in:
parent
d67d214d46
commit
58d5fd5747
@ -11,6 +11,7 @@ import { useSelector } from '@/reducers/hooks'
|
|||||||
import { TabBarType } from '@/constants/tabbar'
|
import { TabBarType } from '@/constants/tabbar'
|
||||||
import type { TabBarAction } from '@/reducers/tabBar'
|
import type { TabBarAction } from '@/reducers/tabBar'
|
||||||
import { UseSubscriptionMessage } from '@/use/useCommon'
|
import { UseSubscriptionMessage } from '@/use/useCommon'
|
||||||
|
import { debounce } from '@/common/util'
|
||||||
|
|
||||||
type IconfontName = Parameters<typeof IconFont>['0']['name']
|
type IconfontName = Parameters<typeof IconFont>['0']['name']
|
||||||
|
|
||||||
@ -41,16 +42,14 @@ const CustomTabBar: FC = () => {
|
|||||||
const setSelected = (id: TabBarIndexMap[number]['id']) => {
|
const setSelected = (id: TabBarIndexMap[number]['id']) => {
|
||||||
dispatch({ type: TabBarType.SET_SELECTED, data: { tabItem, selectedId: id } })
|
dispatch({ type: TabBarType.SET_SELECTED, data: { tabItem, selectedId: id } })
|
||||||
}
|
}
|
||||||
const handleSelectTabItem = (id: TabBarIndexMap[number]['id']) => {
|
const handleSelectTabItem = debounce(async(id: TabBarIndexMap[number]['id']) => {
|
||||||
return async() => {
|
setSelected(id)
|
||||||
setSelected(id)
|
if (id === 3) {
|
||||||
if (id === 3) {
|
await openSubscriptionMessage({ scenes: 1 })
|
||||||
await openSubscriptionMessage({ scenes: 1 })
|
|
||||||
}
|
|
||||||
console.log(id, 'item')
|
|
||||||
Taro.switchTab({ url: tabItem?.find(item => item.id === id)?.pagePath as string })
|
|
||||||
}
|
}
|
||||||
}
|
console.log(id, 'item')
|
||||||
|
Taro.switchTab({ url: tabItem?.find(item => item.id === id)?.pagePath as string })
|
||||||
|
}, 300)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className={styles.customTabBar}>
|
<View className={styles.customTabBar}>
|
||||||
@ -60,7 +59,7 @@ const CustomTabBar: FC = () => {
|
|||||||
<View
|
<View
|
||||||
key={index}
|
key={index}
|
||||||
className={classname(styles['customTabBar-item'], styles['customTabBar-item-title'], selectedId === item.id ? styles.selected : '')}
|
className={classname(styles['customTabBar-item'], styles['customTabBar-item-title'], selectedId === item.id ? styles.selected : '')}
|
||||||
onClick={handleSelectTabItem(item.id)}
|
onClick={() => handleSelectTabItem(item.id)}
|
||||||
>
|
>
|
||||||
<IconFont name={Number(selectedId) === item.id ? item.selectedIconPath : item.iconPath} size={56} />
|
<IconFont name={Number(selectedId) === item.id ? item.selectedIconPath : item.iconPath} size={56} />
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user