diff --git a/.swc/plugins/v7_macos_aarch64_0.104.8/90faf4f7c8a00ffb0fa720cec7dab342ff5ad41d654795c6b4b8c17d335731d7 b/.swc/plugins/v7_macos_aarch64_0.104.8/90faf4f7c8a00ffb0fa720cec7dab342ff5ad41d654795c6b4b8c17d335731d7 new file mode 100644 index 0000000..35d9a62 Binary files /dev/null and b/.swc/plugins/v7_macos_aarch64_0.104.8/90faf4f7c8a00ffb0fa720cec7dab342ff5ad41d654795c6b4b8c17d335731d7 differ diff --git a/src/app.config.js b/src/app.config.js index 9870f49..cb35e55 100644 --- a/src/app.config.js +++ b/src/app.config.js @@ -1,6 +1,7 @@ export default { 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 df06308..efe628c 100644 --- a/src/pages/index/index.jsx +++ b/src/pages/index/index.jsx @@ -1,21 +1,124 @@ -import { Component } from 'react' -import { View, Text } from '@tarojs/components' -import './index.scss' +import { Component } from "react"; +import Taro from '@tarojs/taro' +import { View, Text, Image} from "@tarojs/components"; +import "./index.scss"; +import { AtTabBar } from "taro-ui"; +import React, { useCallback, useEffect, useState } from "react"; +import { AtGrid } from "taro-ui"; +import { Swiper, SwiperItem } from "@tarojs/components"; +import { AtCard } from "taro-ui"; +import { AtImagePicker } from "taro-ui"; -export default class Index extends Component { - componentDidMount () { } +// export default class Index extends Component { +const Index = () => { + const [current, setcurrent] = useState(0); + const handleClick = (value) => { + console.log("value", value); + setcurrent(value); + if (value == 2) { + // 跳转到目的页面,在当前页面打开 + Taro.redirectTo({ + url: "/pages/my/index", + }); + } + // + }; + return ( + + {/* Hello world! */} - componentWillUnmount () { } + + + + {" "} + + + + + + {" "} + + + + + + {" "} + + + + - componentDidShow () { } + - componentDidHide () { } + + {/* 这也是内容区 可以随意定义功能 */} + + - render () { - return ( - - Hello world! + + handleClick(value)} + current={current} + /> - ) - } -} + + ); +}; + +export default Index; diff --git a/src/pages/index/index.scss b/src/pages/index/index.scss index e69de29..ac76fe9 100644 --- a/src/pages/index/index.scss +++ b/src/pages/index/index.scss @@ -0,0 +1,29 @@ +.index { + display: flex; + flex-direction: column; + // align-items: center; + justify-content: center; + .indexSwiper { + // margin-top: 20px; + // padding: 20px; + + .demo-text { + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; + background-color: yellow; + height: 300px; + width: 100%; + // Image{ + // width: 90%; + // } + } + } + + .indexTablebar { + position: fixed; + bottom: 0; + width: 100%; + } +} diff --git a/src/pages/my/index.jsx b/src/pages/my/index.jsx new file mode 100644 index 0000000..39038ae --- /dev/null +++ b/src/pages/my/index.jsx @@ -0,0 +1,49 @@ +import { Component } from "react"; +import { View, Text, Image } from "@tarojs/components"; +import "./index.scss"; +import { AtTabBar } from "taro-ui"; +import React, { useCallback, useEffect, useState } from "react"; +import { AtGrid } from "taro-ui"; +import { Swiper, SwiperItem } from "@tarojs/components"; +import { AtCard } from "taro-ui"; +import { AtImagePicker } from "taro-ui"; +import Taro from '@tarojs/taro' + + +// export default class Index extends Component { +const Index = () => { + const [current, setcurrent] = useState(2); + const handleClick = (value) => { + console.log('value',value) + setcurrent(value) + if (value == 2) { + // 跳转到目的页面,在当前页面打开 + Taro.redirectTo({ + url: "/pages/my/index", + }); + }else if(value == 0){ + Taro.redirectTo({ + url: "/pages/index/index", + }); + } + }; + return ( + + {/* Hello world! */} + my + + handleClick(value)} + current={current} + /> + + + ); +}; + +export default Index; diff --git a/src/pages/my/index.scss b/src/pages/my/index.scss new file mode 100644 index 0000000..e69de29