import React, {Component} from 'react'; import { StyleSheet, View, Text, StatusBar, Image, ScrollView, } from 'react-native'; import {Button, Provider} from '@ant-design/react-native'; import {Cell, Section, TableView} from 'react-native-tableview-simple'; import {Img} from '../../components'; import {createAction} from '../../utils'; import {connect} from 'react-redux'; import SyncStorage from 'sync-storage'; import Bugly from '../../utils/Bugly'; import {ComponentsStyles} from '../../components/ComponentsStyles'; @connect(auth => ({...auth})) class MineHome extends Component { constructor(props) { super(props); this.state = { currentPage: 1, version: '', }; } static navigationOptions = { headerShown: false, //隐藏顶部导航栏 }; componentDidMount() { Bugly.getVersion((ver) => { this.setState({ version: ver, }); }); } // 退出 loginOut = () => { this.props.dispatch(createAction('auth/logout')()); }; onItemPress = (val) => { if (val === 'settingURL') { this.loginOut(); } else { this.props.navigation.navigate(val); } }; onCheckUpgrade = () => { Bugly.checkUpgrade(); }; render() { const credential = SyncStorage.get('credential'); const baseURL = SyncStorage.get('baseURL'); return ( {/* 头像 */} {/* 名字 */} {credential.username} {credential.dept_name} {baseURL} {/* 功能 */}
{'\ue60e'} } onPress={() => this.onItemPress('ChangePassword')} /> {'\ue61c'} } onPress={() => this.onItemPress('Privacy')} /> {'\ue6aa'} } />
{/* 退出登录 */}
); } } const styles = StyleSheet.create({ centerView: { width: 3, backgroundColor: '#d7d7d7', borderRadius: 3, justifyContent: 'center', }, headImg: { flexDirection: 'row', justifyContent: 'center', }, img: { width: 70, height: 70, marginVertical: 20, borderRadius: 50, }, iconFont: { fontFamily: 'iconfont', fontSize: 20, color: '#1E90FF', lineHeight: 30, }, button: { marginHorizontal: 10, }, }); export default MineHome;