You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.9 KiB
62 lines
1.9 KiB
import React from 'react';
|
|
import Taro from '@tarojs/taro';
|
|
import { View, Button, Image } from '@tarojs/components';
|
|
import { logout } from '@/actions/auth';
|
|
import { getLogoutUrl } from '@/services/api';
|
|
import cfg from '../../config';
|
|
import './index.scss';
|
|
import headImg from '../../static/img/my/head.png';
|
|
import moreImg from '../../static/img/my/more.svg';
|
|
import pswdImg from '../../static/img/my/pswd.svg';
|
|
import reportImg from '../../static/img/my/report.svg';
|
|
|
|
import Common from '../../components/echartForWx/common'; // 如果这行删掉微信小程序编译就一直死循环,待解决
|
|
|
|
const { webUrl } = cfg;
|
|
|
|
const Index = ({ ...props }) => {
|
|
const userInfo = Taro.getStorageSync('userInfo') || {};
|
|
|
|
const goRedirect = () => {
|
|
|
|
}
|
|
|
|
const onLogout = () => {
|
|
logout(getLogoutUrl()).then(() => {
|
|
Taro.reLaunch({
|
|
url: '/pages/auth/login/login'
|
|
});
|
|
});
|
|
|
|
}
|
|
|
|
return (
|
|
<View className='page'>
|
|
<View className='myBox'>
|
|
<View className='my-top'>
|
|
<Image className='my-portrait' src={headImg} />
|
|
<View className='my-item'>
|
|
<View className='my-username'>{userInfo.displayName}</View>
|
|
<View className='my-phone'>{userInfo.phone}</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
|
|
<View className='box' onClick={() => goRedirect(1)}>
|
|
<Image className='box-img' src={reportImg} />
|
|
<View className='box-txt'>我的填报</View>
|
|
<Image className='img' src={moreImg} />
|
|
</View>
|
|
|
|
<View className='box' onClick={() => goRedirect(2)} style={{ marginTop: '2rpx' }}>
|
|
<Image className='box-img' src={pswdImg} />
|
|
<View className='box-txt'>修改密码</View>
|
|
<Image className='img' src={moreImg} />
|
|
</View>
|
|
|
|
<View className='logout' onClick={onLogout}>退出登录</View>
|
|
|
|
</View>
|
|
);
|
|
}
|
|
export default Index;
|
|
|