diff --git a/src/app.config.js b/src/app.config.js index 15c683b..b3c6609 100644 --- a/src/app.config.js +++ b/src/app.config.js @@ -1,6 +1,8 @@ export default defineAppConfig({ pages: [ - 'pages/index/index' + 'pages/index/index', + 'pages/my/index', + ], window: { backgroundTextStyle: 'light', diff --git a/src/pages/index/index.jsx b/src/pages/index/index.jsx index 8642ff3..89ddfd2 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -188,8 +188,14 @@ export default function Index() { // { title: "活动", iconType: "camera" }, { title: "我的", iconType: "user" }, //, text: "100", max: 99 ]} - // onClick={this.handleClick.bind(this)} - // current={this.state.current} + onClick={(current)=>{ + if (current !== 0) { + Taro.redirectTo({ + url: "/pages/my/index", + }); + } + }} + current={0} /> diff --git a/src/pages/my/index.jsx b/src/pages/my/index.jsx new file mode 100644 index 0000000..3f922c2 --- /dev/null +++ b/src/pages/my/index.jsx @@ -0,0 +1,42 @@ +import { View, Text, Image } from "@tarojs/components"; +import { useLoad } from "@tarojs/taro"; +import Taro from "@tarojs/taro"; +import { AtAvatar, AtTag, AtIcon, AtTabBar, AtButton } from "taro-ui"; +import "./index.scss"; +import beijing from "@/images/city/beijing.jpg"; +import guangzhou from "@/images/city/guangzhou.jpg"; +import shanghai from "@/images/city/shanghai.jpg"; +import shenzhen from "@/images/city/shenzhen.jpg"; +import touxiang from "@/images/index/touxiang.jpg"; + +import { useEffect, useState } from "react"; +const my = () => { + return ( + + + my + {/* 底部tabbar */} + + { + console.log("current", current); + if (current !== 1) { + Taro.redirectTo({ + url: "/pages/index/index", + }); + } + }} + current={1} + /> + + + + ); +}; + +export default my; diff --git a/src/pages/my/index.scss b/src/pages/my/index.scss new file mode 100644 index 0000000..d688140 --- /dev/null +++ b/src/pages/my/index.scss @@ -0,0 +1,17 @@ +.my{ + .myContent{ + padding-left: 20px; + padding-right: 20px; + } + .tabbbarDiv { + width: 100%; + height: 140px; + // background-color: red; + } + + .tabbbar { + position: fixed; + bottom: 0px; + width: 100%; + } +} \ No newline at end of file