From 0b4be1572d5fc9e52e2b96fc61a49655883ee55d Mon Sep 17 00:00:00 2001 From: hackrobot Date: Tue, 19 Mar 2024 19:50:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=88=91=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2,=E4=BB=A5=E5=8F=8Atabbar=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.config.js | 4 +++- src/pages/index/index.jsx | 10 ++++++++-- src/pages/my/index.jsx | 42 +++++++++++++++++++++++++++++++++++++++ src/pages/my/index.scss | 17 ++++++++++++++++ 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 src/pages/my/index.jsx create mode 100644 src/pages/my/index.scss 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