🎈 perf(购物页面): 添加分页功能]

This commit is contained in:
xuan
2022-11-18 17:12:28 +08:00
parent 0ab2b22be5
commit 8deb8e56f0
5 changed files with 61 additions and 26 deletions
+13 -6
View File
@@ -13,33 +13,40 @@ type TabBarIndexMap = {
}
}
export enum TabBarIndex {
INDEX = 1,
SHOPPING = 2,
ORDER = 3,
USER = 4
}
const INITIAL_STATE = {
selectedId: 1,
selectedId: TabBarIndex.INDEX,
tabItem: [
{
id: 1,
id: TabBarIndex.INDEX,
pagePath: '/pages/index/index',
text: '首页',
iconPath: 'icon-shouye1',
selectedIconPath: 'icon-shouye',
},
{
id: 2,
id: TabBarIndex.SHOPPING,
pagePath: '/pages/shopping/index',
text: '购物',
iconPath: 'icon-gouwu1',
selectedIconPath: 'icon-gouwu',
},
{
id: 3,
id: TabBarIndex.ORDER,
pagePath: '/pages/order/index',
text: '订单',
iconPath: 'icon-dingdan1',
selectedIconPath: 'icon-dingdan',
},
{
id: 4,
id: TabBarIndex.USER,
pagePath: '/pages/user/index',
text: '我的',
iconPath: 'icon-gerenzhongxin1',
@@ -50,7 +57,7 @@ const INITIAL_STATE = {
export type TabBarData = {
selectedId: number
tabItem: TabBarIndexMap[number][]
tabItem?: TabBarIndexMap[number][]
}
export type TabBarAction = {