|
@@ -16,22 +16,6 @@ interface ILayoutProps extends ViewProps {
|
|
|
safe?: boolean;
|
|
|
bottomBarIndex?: number;
|
|
|
}
|
|
|
-const barList = [
|
|
|
- {
|
|
|
- icon: require('../../assets/icon_bottom_bar_apply.png'),
|
|
|
- activeIcon: require('../../assets/icon_bottom_bar_apply_active.png'),
|
|
|
- label: "申请",
|
|
|
- index: 0,
|
|
|
- mustLogin: false,
|
|
|
- },
|
|
|
- {
|
|
|
- icon: require('../../assets/icon_bottom_bar_mine.png'),
|
|
|
- activeIcon: require('../../assets/icon_bottom_bar_mine_active.png'),
|
|
|
- label: "我的",
|
|
|
- mustLogin: true,
|
|
|
- index: 1
|
|
|
- }
|
|
|
-]
|
|
|
|
|
|
const BottomNavBar = () => {
|
|
|
const appContext = useContext(AppContext);
|
|
@@ -42,13 +26,13 @@ const BottomNavBar = () => {
|
|
|
<Flex style={{ height: pxTransform(104) }} direction="row" alignItem="center" justifyContent="center" >
|
|
|
{
|
|
|
menu.map(p => {
|
|
|
- let _index = p.code === "home" ? 0 : 1;
|
|
|
+ let _index = ["home", "user_center"].findIndex(sp => sp === p.code);
|
|
|
return (
|
|
|
<Flex key={p.code} onClick={() => {
|
|
|
UserHelper.afterLogin({
|
|
|
callback: async () => {
|
|
|
if (['home', 'user_center'].includes(p.code)) {
|
|
|
- bottomBarContext.switchTo(_index);
|
|
|
+ bottomBarContext.switchTo(_index as number);
|
|
|
}
|
|
|
else {
|
|
|
RouteUtil.toWebViewPage({
|
|
@@ -59,9 +43,7 @@ const BottomNavBar = () => {
|
|
|
})
|
|
|
return;
|
|
|
}} flex={1} alignItem="center" justifyContent="center" >
|
|
|
- {/* <Image className='bottom-nav-icon' src={p.icon} /> */}
|
|
|
<Image className='bottom-nav-icon' src={_index === bottomBarContext?.index ? p.iconActive : p.icon} />
|
|
|
- {/* <Label size="sm" type={"default"} > */}
|
|
|
<Label size="sm" type={_index === bottomBarContext?.index ? "default" : "secondary"} >
|
|
|
{p.name}
|
|
|
</Label>
|