feat: 我的页面
This commit is contained in:
@@ -4,6 +4,8 @@ export default {
|
||||
"pages/home/index",
|
||||
"pages/activityList/index",
|
||||
"pages/mountainPeak/index",
|
||||
"pages/my/index",
|
||||
|
||||
|
||||
|
||||
],
|
||||
|
||||
33
src/pages/components/TabbarCom/index.tsx
Normal file
33
src/pages/components/TabbarCom/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { Tabbar, TabbarItem } from "@antmjs/vantui";
|
||||
import { View } from "@tarojs/components";
|
||||
import Taro from "@tarojs/taro";
|
||||
import react from "react";
|
||||
|
||||
const TabbarCom = (props: any) => {
|
||||
const [active, setActive] = react.useState(props?.active ?? 0);
|
||||
|
||||
return (
|
||||
<View>
|
||||
<Tabbar
|
||||
active={active}
|
||||
onChange={(e: any) => {
|
||||
console.log("e", e);
|
||||
setActive(e?.detail);
|
||||
if(e?.detail===2){
|
||||
Taro.navigateTo({
|
||||
url: "/pages/my/index",
|
||||
});
|
||||
}
|
||||
}}
|
||||
safeAreaInsetBottom={false}
|
||||
>
|
||||
<TabbarItem icon="home-o">首页</TabbarItem>
|
||||
{/* <TabbarItem icon="search">标签</TabbarItem> */}
|
||||
<TabbarItem icon="friends-o">活动</TabbarItem>
|
||||
<TabbarItem icon="setting-o">我的</TabbarItem>
|
||||
</Tabbar>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default TabbarCom;
|
||||
@@ -15,6 +15,7 @@ import react from "react";
|
||||
import { NoticeBar } from "@antmjs/vantui";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { Tabbar, TabbarItem } from "@antmjs/vantui";
|
||||
import TabbarCom from "../components/TabbarCom";
|
||||
|
||||
const Home = () => {
|
||||
// const { images } = COMMON
|
||||
@@ -114,18 +115,18 @@ const Home = () => {
|
||||
);
|
||||
})}
|
||||
|
||||
<Tabbar
|
||||
{/* <Tabbar
|
||||
active={active}
|
||||
// onChange={(e) => setActive(e?.detail)}
|
||||
safeAreaInsetBottom={false}
|
||||
|
||||
|
||||
>
|
||||
<TabbarItem icon="home-o">首页</TabbarItem>
|
||||
{/* <TabbarItem icon="search">标签</TabbarItem> */}
|
||||
<TabbarItem icon="friends-o">活动</TabbarItem>
|
||||
<TabbarItem icon="setting-o">我的</TabbarItem>
|
||||
</Tabbar>
|
||||
</Tabbar> */}
|
||||
|
||||
<TabbarCom active={0}/>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
17
src/pages/my/index.tsx
Normal file
17
src/pages/my/index.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Tabbar, TabbarItem } from "@antmjs/vantui";
|
||||
import { View } from "@tarojs/components";
|
||||
import react from "react";
|
||||
import TabbarCom from "../components/TabbarCom";
|
||||
|
||||
const my = (props: any) => {
|
||||
// const [active, setActive] = react.useState(props?.active ?? 0);
|
||||
|
||||
return (
|
||||
<View>
|
||||
my
|
||||
<TabbarCom active={2} />;
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default my;
|
||||
Reference in New Issue
Block a user