feat: 新增我的页面
This commit is contained in:
49
src/pages/my/index.jsx
Normal file
49
src/pages/my/index.jsx
Normal file
@@ -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 (
|
||||
<View className="index">
|
||||
{/* <Text>Hello world!</Text> */}
|
||||
my
|
||||
<View className="indexTablebar">
|
||||
<AtTabBar
|
||||
tabList={[
|
||||
{ title: "首页", text: "" },
|
||||
{ title: "活动" },
|
||||
{ title: "我的" },
|
||||
]}
|
||||
onClick={(value) => handleClick(value)}
|
||||
current={current}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default Index;
|
||||
0
src/pages/my/index.scss
Normal file
0
src/pages/my/index.scss
Normal file
Reference in New Issue
Block a user