feat: 新增我的页面
This commit is contained in:
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
export default {
|
export default {
|
||||||
pages: [
|
pages: [
|
||||||
'pages/index/index'
|
'pages/index/index',
|
||||||
|
'pages/my/index'
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
backgroundTextStyle: 'light',
|
backgroundTextStyle: 'light',
|
||||||
|
|||||||
@@ -1,21 +1,124 @@
|
|||||||
import { Component } from 'react'
|
import { Component } from "react";
|
||||||
import { View, Text } from '@tarojs/components'
|
import Taro from '@tarojs/taro'
|
||||||
import './index.scss'
|
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 {
|
// export default class Index extends Component {
|
||||||
componentDidMount () { }
|
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 (
|
||||||
|
<View className="index">
|
||||||
|
{/* <Text>Hello world!</Text> */}
|
||||||
|
|
||||||
componentWillUnmount () { }
|
<Swiper
|
||||||
|
className="indexSwiper"
|
||||||
|
indicatorColor="#999"
|
||||||
|
indicatorActiveColor="#333"
|
||||||
|
// vertical
|
||||||
|
circular
|
||||||
|
indicatorDots
|
||||||
|
autoplay
|
||||||
|
>
|
||||||
|
<SwiperItem>
|
||||||
|
<View className="demo-text">
|
||||||
|
{" "}
|
||||||
|
<Image
|
||||||
|
// style="width: 300px;height: 100px;background: #fff;"
|
||||||
|
src={
|
||||||
|
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</SwiperItem>
|
||||||
|
<SwiperItem>
|
||||||
|
<View className="demo-text">
|
||||||
|
{" "}
|
||||||
|
<Image
|
||||||
|
// style="width: 300px;height: 100px;background: #fff;"
|
||||||
|
src={
|
||||||
|
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</SwiperItem>
|
||||||
|
<SwiperItem>
|
||||||
|
<View className="demo-text">
|
||||||
|
{" "}
|
||||||
|
<Image
|
||||||
|
// style="width: 300px;height: 100px;background: #fff;"
|
||||||
|
src={
|
||||||
|
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</SwiperItem>
|
||||||
|
</Swiper>
|
||||||
|
|
||||||
componentDidShow () { }
|
<AtGrid
|
||||||
|
data={[
|
||||||
|
{
|
||||||
|
image:
|
||||||
|
"https://img12.360buyimg.com/jdphoto/s72x72_jfs/t6160/14/2008729947/2754/7d512a86/595c3aeeNa89ddf71.png",
|
||||||
|
value: "打卡",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image:
|
||||||
|
"https://img20.360buyimg.com/jdphoto/s72x72_jfs/t15151/308/1012305375/2300/536ee6ef/5a411466N040a074b.png",
|
||||||
|
value: "活动",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image:
|
||||||
|
"https://img10.360buyimg.com/jdphoto/s72x72_jfs/t5872/209/5240187906/2872/8fa98cd/595c3b2aN4155b931.png",
|
||||||
|
value: "视频",
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
|
||||||
componentDidHide () { }
|
<AtCard
|
||||||
|
note="星期三 2023-12-06"
|
||||||
|
extra=""
|
||||||
|
title="这是个[副业交流] 沙龙茶话会标题"
|
||||||
|
thumb="http://www.logoquan.com/upload/list/20180421/logoquan15259400209.PNG"
|
||||||
|
>
|
||||||
|
{/* 这也是内容区 可以随意定义功能 */}
|
||||||
|
<Image
|
||||||
|
style="width: 300px;height: 100px;background: #fff;"
|
||||||
|
src={
|
||||||
|
"https://7084298024874.huodongxing.com/file/ue/20211008/115427740E13BBD5BD7B56940467DC03B4/30435083489707317.jpeg"
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</AtCard>
|
||||||
|
|
||||||
render () {
|
<View className="indexTablebar">
|
||||||
return (
|
<AtTabBar
|
||||||
<View className='index'>
|
tabList={[
|
||||||
<Text>Hello world!</Text>
|
{ title: "首页", text: "" },
|
||||||
|
{ title: "活动" },
|
||||||
|
{ title: "我的" },
|
||||||
|
]}
|
||||||
|
onClick={(value) => handleClick(value)}
|
||||||
|
current={current}
|
||||||
|
/>
|
||||||
</View>
|
</View>
|
||||||
)
|
</View>
|
||||||
}
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export default Index;
|
||||||
|
|||||||
@@ -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%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
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