|
@@ -4,20 +4,18 @@ import {
|
|
View,
|
|
View,
|
|
Text,
|
|
Text,
|
|
StatusBar,
|
|
StatusBar,
|
|
- TouchableOpacity,
|
|
|
|
Image,
|
|
Image,
|
|
ScrollView,
|
|
ScrollView,
|
|
- Platform,
|
|
|
|
} from 'react-native';
|
|
} from 'react-native';
|
|
|
|
|
|
import {Button, Provider} from '@ant-design/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";
|
|
|
|
|
|
+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}))
|
|
@connect(auth => ({...auth}))
|
|
class MineHome extends Component {
|
|
class MineHome extends Component {
|
|
@@ -36,25 +34,25 @@ class MineHome extends Component {
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
Bugly.getVersion((ver) => {
|
|
Bugly.getVersion((ver) => {
|
|
this.setState({
|
|
this.setState({
|
|
- version: ver
|
|
|
|
- })
|
|
|
|
|
|
+ version: ver,
|
|
|
|
+ });
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
// 退出
|
|
// 退出
|
|
loginOut = () => {
|
|
loginOut = () => {
|
|
this.props.dispatch(createAction('auth/logout')());
|
|
this.props.dispatch(createAction('auth/logout')());
|
|
- }
|
|
|
|
|
|
+ };
|
|
onItemPress = (val) => {
|
|
onItemPress = (val) => {
|
|
if (val === 'settingURL') {
|
|
if (val === 'settingURL') {
|
|
- this.loginOut()
|
|
|
|
|
|
+ this.loginOut();
|
|
} else {
|
|
} else {
|
|
- this.props.navigation.navigate(val)
|
|
|
|
|
|
+ this.props.navigation.navigate(val);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ };
|
|
onCheckUpgrade = () => {
|
|
onCheckUpgrade = () => {
|
|
Bugly.checkUpgrade();
|
|
Bugly.checkUpgrade();
|
|
- }
|
|
|
|
|
|
+ };
|
|
|
|
|
|
render() {
|
|
render() {
|
|
const credential = SyncStorage.get('credential');
|
|
const credential = SyncStorage.get('credential');
|
|
@@ -75,44 +73,26 @@ class MineHome extends Component {
|
|
color: '#333333',
|
|
color: '#333333',
|
|
fontSize: 22,
|
|
fontSize: 22,
|
|
fontWeight: '900',
|
|
fontWeight: '900',
|
|
- textAlign: "center"
|
|
|
|
|
|
+ textAlign: 'center',
|
|
}}>{credential.username}</Text>
|
|
}}>{credential.username}</Text>
|
|
<Text
|
|
<Text
|
|
style={{
|
|
style={{
|
|
fontSize: 14,
|
|
fontSize: 14,
|
|
fontWeight: '900',
|
|
fontWeight: '900',
|
|
- textAlign: "center",
|
|
|
|
- marginTop: 5
|
|
|
|
|
|
+ textAlign: 'center',
|
|
|
|
+ marginTop: 5,
|
|
}}>{credential.dept_name}</Text>
|
|
}}>{credential.dept_name}</Text>
|
|
<Text
|
|
<Text
|
|
style={{
|
|
style={{
|
|
fontSize: 14,
|
|
fontSize: 14,
|
|
fontWeight: '900',
|
|
fontWeight: '900',
|
|
- textAlign: "center",
|
|
|
|
- marginTop: 5
|
|
|
|
|
|
+ textAlign: 'center',
|
|
|
|
+ marginTop: 5,
|
|
}}>{baseURL}</Text>
|
|
}}>{baseURL}</Text>
|
|
</View>
|
|
</View>
|
|
{/* 功能 */}
|
|
{/* 功能 */}
|
|
<TableView>
|
|
<TableView>
|
|
<Section sectionTintColor='#f2f2f2'>
|
|
<Section sectionTintColor='#f2f2f2'>
|
|
- <Cell
|
|
|
|
- accessory="DisclosureIndicator"
|
|
|
|
- cellStyle="RightDetail"
|
|
|
|
- title="APP下载"
|
|
|
|
- image={
|
|
|
|
- <Text style={styles.iconFont}>{'\ue603'}</Text>
|
|
|
|
- }
|
|
|
|
- onPress={() => this.onItemPress("Download")}
|
|
|
|
- />
|
|
|
|
- <Cell
|
|
|
|
- accessory="DisclosureIndicator"
|
|
|
|
- cellStyle="RightDetail"
|
|
|
|
- title="访问地址"
|
|
|
|
- image={
|
|
|
|
- <Text style={styles.iconFont}>{'\ue602'}</Text>
|
|
|
|
- }
|
|
|
|
- onPress={() => this.onItemPress("settingURL")}
|
|
|
|
- />
|
|
|
|
<Cell
|
|
<Cell
|
|
accessory="DisclosureIndicator"
|
|
accessory="DisclosureIndicator"
|
|
cellStyle="RightDetail"
|
|
cellStyle="RightDetail"
|
|
@@ -120,7 +100,7 @@ class MineHome extends Component {
|
|
image={
|
|
image={
|
|
<Text style={styles.iconFont}>{'\ue60e'}</Text>
|
|
<Text style={styles.iconFont}>{'\ue60e'}</Text>
|
|
}
|
|
}
|
|
- onPress={() => this.onItemPress("ChangePassword")}
|
|
|
|
|
|
+ onPress={() => this.onItemPress('ChangePassword')}
|
|
/>
|
|
/>
|
|
<Cell
|
|
<Cell
|
|
accessory="DisclosureIndicator"
|
|
accessory="DisclosureIndicator"
|
|
@@ -129,37 +109,16 @@ class MineHome extends Component {
|
|
image={
|
|
image={
|
|
<Text style={styles.iconFont}>{'\ue61c'}</Text>
|
|
<Text style={styles.iconFont}>{'\ue61c'}</Text>
|
|
}
|
|
}
|
|
- onPress={() => this.onItemPress("Privacy")}
|
|
|
|
|
|
+ onPress={() => this.onItemPress('Privacy')}
|
|
/>
|
|
/>
|
|
<Cell
|
|
<Cell
|
|
- accessory="DisclosureIndicator"
|
|
|
|
cellStyle="RightDetail"
|
|
cellStyle="RightDetail"
|
|
- title="关于我们"
|
|
|
|
|
|
+ title="当前版本"
|
|
|
|
+ detail={this.state.version}
|
|
image={
|
|
image={
|
|
- <Text style={styles.iconFont}>{'\ue605'}</Text>
|
|
|
|
|
|
+ <Text style={styles.iconFont}>{'\ue6aa'}</Text>
|
|
}
|
|
}
|
|
- onPress={() => this.onItemPress("About")}
|
|
|
|
/>
|
|
/>
|
|
- {Platform.OS === 'ios' ?
|
|
|
|
- <Cell
|
|
|
|
- cellStyle="RightDetail"
|
|
|
|
- title="当前版本"
|
|
|
|
- detail={this.state.version}
|
|
|
|
- image={
|
|
|
|
- <Text style={styles.iconFont}>{'\ue6aa'}</Text>
|
|
|
|
- }
|
|
|
|
- />
|
|
|
|
- :
|
|
|
|
- <Cell
|
|
|
|
- cellStyle="RightDetail"
|
|
|
|
- title="检查更新"
|
|
|
|
- detail={`当前版本:${this.state.version}`}
|
|
|
|
- onPress={this.onCheckUpgrade}
|
|
|
|
- image={
|
|
|
|
- <Text style={styles.iconFont}>{'\ue6aa'}</Text>
|
|
|
|
- }
|
|
|
|
- />
|
|
|
|
- }
|
|
|
|
|
|
|
|
</Section>
|
|
</Section>
|
|
</TableView>
|
|
</TableView>
|
|
@@ -194,11 +153,11 @@ const styles = StyleSheet.create({
|
|
fontFamily: 'iconfont',
|
|
fontFamily: 'iconfont',
|
|
fontSize: 20,
|
|
fontSize: 20,
|
|
color: '#1E90FF',
|
|
color: '#1E90FF',
|
|
- lineHeight: 30
|
|
|
|
|
|
+ lineHeight: 30,
|
|
},
|
|
},
|
|
button: {
|
|
button: {
|
|
marginHorizontal: 10,
|
|
marginHorizontal: 10,
|
|
},
|
|
},
|
|
-})
|
|
|
|
|
|
+});
|
|
|
|
|
|
export default MineHome;
|
|
export default MineHome;
|