feat: 我的页面

This commit is contained in:
eric
2022-11-13 11:08:30 +08:00
parent c27e8ce790
commit 750a6344a7
29 changed files with 25009 additions and 895 deletions

View File

@@ -4,6 +4,8 @@ export default {
"pages/home/index",
"pages/activityList/index",
"pages/mountainPeak/index",
"pages/my/index",
],

View 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;

View File

@@ -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
View 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;