123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- import React,{Component} from 'react';
- import {Button, View,OpenData} from '@tarojs/components'
- import Taro from '@tarojs/taro';
- import { AtIcon } from 'taro-ui'
- import 'taro-ui/dist/style/components/icon.scss';
- import './index.less';
- class UserFloatingLayer extends Component{
- constructor(props) {
- super(props);
- this.state={
- userInfor:{}
- }
- }
- componentDidMount() {
- let userInfor = Taro.getStorageSync('userInfor');
- this.setState({
- userInfor
- })
- }
- render() {
- return(
- <View className='userFloatingLayer'>
- <View className='userAvatarUrl'>
- <OpenData type='userAvatarUrl'/>
- </View>
- <View className='userNickName'>
- {this.state.userInfor.name}
- <View className='welcome' onClick={()=>{
- Taro.setStorageSync("token", "");
- Taro.setStorageSync('userInfor', "");
- Taro.closeSocket();
- Taro.reLaunch({
- url: '/pages/login/index'
- })
- }}>退出</View>
- </View>
- </View>
- );
- }
- }
- export default UserFloatingLayer;
|