|
@@ -3,7 +3,7 @@
|
|
|
* @邠心vbe on 2021/04/27
|
|
* @邠心vbe on 2021/04/27
|
|
|
*/
|
|
*/
|
|
|
import React, { Component } from 'react';
|
|
import React, { Component } from 'react';
|
|
|
-import { View, Text, StyleSheet, Image, ScrollView, Switch, Pressable } from 'react-native';
|
|
|
|
|
|
|
+import { View, Text, StyleSheet, Image, ScrollView } from 'react-native';
|
|
|
import apiUser from '../../api/apiUser';
|
|
import apiUser from '../../api/apiUser';
|
|
|
import { host, setAccessToken } from '../../api/http';
|
|
import { host, setAccessToken } from '../../api/http';
|
|
|
import Button, { ElevationObject } from '../../components/Button';
|
|
import Button, { ElevationObject } from '../../components/Button';
|
|
@@ -129,36 +129,36 @@ export default class ProfileV2 extends Component {
|
|
|
return (
|
|
return (
|
|
|
<ScrollView style={styles.container}>
|
|
<ScrollView style={styles.container}>
|
|
|
{/* Profile Info */}
|
|
{/* Profile Info */}
|
|
|
- <View style={styles.cardView}>
|
|
|
|
|
- <Pressable
|
|
|
|
|
- style={styles.profileView}
|
|
|
|
|
- onPress={() => startPage(PageList.editProfile)}>
|
|
|
|
|
- { this.state.userInfo.photoUrl
|
|
|
|
|
- ? <Image
|
|
|
|
|
- style={styles.avatar}
|
|
|
|
|
- source={{uri: host + this.state.userInfo.photoUrl}}/>
|
|
|
|
|
- : <Image
|
|
|
|
|
- style={styles.avatar}
|
|
|
|
|
- source={require('../../images/user/ic-avatar-default.png')}/>
|
|
|
|
|
- }
|
|
|
|
|
- <View style={styles.infoContent}>
|
|
|
|
|
- <Text
|
|
|
|
|
- style={styles.nickname}
|
|
|
|
|
- ellipsizeMode='tail'
|
|
|
|
|
- numberOfLines={1}>{this.state.userInfo.nickName}</Text>
|
|
|
|
|
- <Text style={styles.userText}>{this.state.userInfo.email}</Text>
|
|
|
|
|
- <Text style={styles.userText}>{(utils.isNotEmpty(this.state.userInfo.callingCode) && "+" + this.state.userInfo.callingCode + " ") + this.state.userInfo.phone}</Text>
|
|
|
|
|
- </View>
|
|
|
|
|
- <FontAwesome
|
|
|
|
|
- size={34}
|
|
|
|
|
- color={textCancel}
|
|
|
|
|
- name='angle-right'/>
|
|
|
|
|
- </Pressable>
|
|
|
|
|
- </View>
|
|
|
|
|
|
|
+ <Button
|
|
|
|
|
+ style={styles.cardView}
|
|
|
|
|
+ viewStyle={styles.profileView}
|
|
|
|
|
+ onClick={() => startPage(PageList.editProfile)}>
|
|
|
|
|
+ { this.state.userInfo.photoUrl
|
|
|
|
|
+ ? <Image
|
|
|
|
|
+ style={styles.avatar}
|
|
|
|
|
+ source={{uri: host + this.state.userInfo.photoUrl}}/>
|
|
|
|
|
+ : <Image
|
|
|
|
|
+ style={styles.avatar}
|
|
|
|
|
+ source={require('../../images/user/ic-avatar-default.png')}/>
|
|
|
|
|
+ }
|
|
|
|
|
+ <View style={styles.infoContent}>
|
|
|
|
|
+ <Text
|
|
|
|
|
+ style={styles.nickname}
|
|
|
|
|
+ ellipsizeMode='tail'
|
|
|
|
|
+ numberOfLines={1}>{this.state.userInfo.nickName}</Text>
|
|
|
|
|
+ <Text style={styles.userText}>{this.state.userInfo.email}</Text>
|
|
|
|
|
+ <Text style={styles.userText}>{(utils.isNotEmpty(this.state.userInfo.callingCode) && "+" + this.state.userInfo.callingCode + " ") + this.state.userInfo.phone}</Text>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <FontAwesome
|
|
|
|
|
+ size={34}
|
|
|
|
|
+ color={textCancel}
|
|
|
|
|
+ name='angle-right'/>
|
|
|
|
|
+ </Button>
|
|
|
{/* Wallet Info */}
|
|
{/* Wallet Info */}
|
|
|
- <Pressable
|
|
|
|
|
|
|
+ <Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
- onPress={() => startPage(PageList.wallet)}>
|
|
|
|
|
|
|
+ viewStyle={styles.profileView}
|
|
|
|
|
+ onClick={() => startPage(PageList.wallet)}>
|
|
|
<Image
|
|
<Image
|
|
|
style={styles.cardIcon}
|
|
style={styles.cardIcon}
|
|
|
source={require('../../images/user/card-wallet.png')}/>
|
|
source={require('../../images/user/card-wallet.png')}/>
|
|
@@ -170,11 +170,12 @@ export default class ProfileV2 extends Component {
|
|
|
size={28}
|
|
size={28}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
- </Pressable>
|
|
|
|
|
|
|
+ </Button>
|
|
|
{/* Vehicle Info */}
|
|
{/* Vehicle Info */}
|
|
|
- <Pressable
|
|
|
|
|
|
|
+ <Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
- onPress={() => startPage(PageList.myVehicles)}>
|
|
|
|
|
|
|
+ viewStyle={styles.profileView}
|
|
|
|
|
+ onClick={() => startPage(PageList.myVehicles)}>
|
|
|
<Image
|
|
<Image
|
|
|
style={styles.cardIcon}
|
|
style={styles.cardIcon}
|
|
|
source={require('../../images/user/card-vehicle.png')}/>
|
|
source={require('../../images/user/card-vehicle.png')}/>
|
|
@@ -186,7 +187,7 @@ export default class ProfileV2 extends Component {
|
|
|
size={28}
|
|
size={28}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
- </Pressable>
|
|
|
|
|
|
|
+ </Button>
|
|
|
{/* Vehicle List */}
|
|
{/* Vehicle List */}
|
|
|
{/* <View style={styles.titleView}>
|
|
{/* <View style={styles.titleView}>
|
|
|
<Text style={styles.title}>My Vehicles</Text>
|
|
<Text style={styles.title}>My Vehicles</Text>
|
|
@@ -228,9 +229,10 @@ export default class ProfileV2 extends Component {
|
|
|
<View style={styles.accountList}>
|
|
<View style={styles.accountList}>
|
|
|
<CardList refreshId={this.state.refreshId}/>
|
|
<CardList refreshId={this.state.refreshId}/>
|
|
|
</View> */}
|
|
</View> */}
|
|
|
- <Pressable
|
|
|
|
|
|
|
+ <Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
- onPress={() => startPage(PageList.changePassword, {action: "change"})}>
|
|
|
|
|
|
|
+ viewStyle={styles.profileView}
|
|
|
|
|
+ onClick={() => startPage(PageList.changePassword, {action: "change"})}>
|
|
|
<Image
|
|
<Image
|
|
|
style={styles.cardIcon}
|
|
style={styles.cardIcon}
|
|
|
source={require('../../images/user/card-account.png')}/>
|
|
source={require('../../images/user/card-account.png')}/>
|
|
@@ -241,11 +243,12 @@ export default class ProfileV2 extends Component {
|
|
|
size={28}
|
|
size={28}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
- </Pressable>
|
|
|
|
|
|
|
+ </Button>
|
|
|
{/* Notifications */}
|
|
{/* Notifications */}
|
|
|
- <Pressable
|
|
|
|
|
|
|
+ <Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
- onPress={() => startPage(PageList.settings)}>
|
|
|
|
|
|
|
+ viewStyle={styles.profileView}
|
|
|
|
|
+ onClick={() => startPage(PageList.settings)}>
|
|
|
<Image
|
|
<Image
|
|
|
style={styles.cardIcon}
|
|
style={styles.cardIcon}
|
|
|
source={require('../../images/user/card-notification.png')}/>
|
|
source={require('../../images/user/card-notification.png')}/>
|
|
@@ -256,11 +259,12 @@ export default class ProfileV2 extends Component {
|
|
|
size={28}
|
|
size={28}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
- </Pressable>
|
|
|
|
|
|
|
+ </Button>
|
|
|
{ this.state.userInfo.userType == "Public" &&
|
|
{ this.state.userInfo.userType == "Public" &&
|
|
|
- <Pressable
|
|
|
|
|
|
|
+ <Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
- onPress={() => startPage(PageList.registerFleet)}>
|
|
|
|
|
|
|
+ viewStyle={styles.profileView}
|
|
|
|
|
+ onClick={() => startPage(PageList.registerFleet)}>
|
|
|
<MaterialCommunityIcons
|
|
<MaterialCommunityIcons
|
|
|
style={styles.cardIcon}
|
|
style={styles.cardIcon}
|
|
|
name="credit-card-edit"
|
|
name="credit-card-edit"
|
|
@@ -273,11 +277,12 @@ export default class ProfileV2 extends Component {
|
|
|
size={28}
|
|
size={28}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
- </Pressable>
|
|
|
|
|
|
|
+ </Button>
|
|
|
}
|
|
}
|
|
|
- <Pressable
|
|
|
|
|
|
|
+ <Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
- onPress={() => this.deleteAccount()}>
|
|
|
|
|
|
|
+ viewStyle={styles.profileView}
|
|
|
|
|
+ onClick={() => this.deleteAccount()}>
|
|
|
<MaterialCommunityIcons
|
|
<MaterialCommunityIcons
|
|
|
style={styles.cardIcon}
|
|
style={styles.cardIcon}
|
|
|
name="account-remove"
|
|
name="account-remove"
|
|
@@ -290,7 +295,7 @@ export default class ProfileV2 extends Component {
|
|
|
size={28}
|
|
size={28}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
- </Pressable>
|
|
|
|
|
|
|
+ </Button>
|
|
|
{/* <Button
|
|
{/* <Button
|
|
|
style={styles.deleteButton}
|
|
style={styles.deleteButton}
|
|
|
text="DELETE MY ACCOUNT"
|
|
text="DELETE MY ACCOUNT"
|
|
@@ -326,6 +331,7 @@ const styles = StyleSheet.create({
|
|
|
},
|
|
},
|
|
|
profileView: {
|
|
profileView: {
|
|
|
zIndex: 10,
|
|
zIndex: 10,
|
|
|
|
|
+ padding: 16,
|
|
|
alignItems: 'center',
|
|
alignItems: 'center',
|
|
|
flexDirection: 'row'
|
|
flexDirection: 'row'
|
|
|
},
|
|
},
|
|
@@ -353,7 +359,7 @@ const styles = StyleSheet.create({
|
|
|
paddingTop: 1.5
|
|
paddingTop: 1.5
|
|
|
},
|
|
},
|
|
|
cardView: {
|
|
cardView: {
|
|
|
- padding: 16,
|
|
|
|
|
|
|
+ //padding: 16,
|
|
|
marginTop: 16,
|
|
marginTop: 16,
|
|
|
marginLeft: 16,
|
|
marginLeft: 16,
|
|
|
marginRight: 16,
|
|
marginRight: 16,
|