|
@@ -13,6 +13,7 @@ import { getStorageJsonSync, setStorage, setStorageJson } from '../../utils/stor
|
|
|
import utils from '../../utils/utils';
|
|
import utils from '../../utils/utils';
|
|
|
import { PageList } from '../Router';
|
|
import { PageList } from '../Router';
|
|
|
import app from '../../../app.json';
|
|
import app from '../../../app.json';
|
|
|
|
|
+import { ShadowViewV2 } from '../../components/ShadowView';
|
|
|
|
|
|
|
|
export default class ProfileV2 extends Component {
|
|
export default class ProfileV2 extends Component {
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
@@ -124,6 +125,7 @@ export default class ProfileV2 extends Component {
|
|
|
return (
|
|
return (
|
|
|
<ScrollView style={styles.container}>
|
|
<ScrollView style={styles.container}>
|
|
|
{/* Profile Info */}
|
|
{/* Profile Info */}
|
|
|
|
|
+ <EndView/>
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
viewStyle={styles.profileView}
|
|
viewStyle={styles.profileView}
|
|
@@ -144,18 +146,19 @@ export default class ProfileV2 extends Component {
|
|
|
numberOfLines={1}>{this.state.userInfo.nickName}</TextView>
|
|
numberOfLines={1}>{this.state.userInfo.nickName}</TextView>
|
|
|
<TextView style={styles.userText}>{this.state.userInfo.email}</TextView>
|
|
<TextView style={styles.userText}>{this.state.userInfo.email}</TextView>
|
|
|
<TextView style={styles.userText}>{(utils.isNotEmpty(this.state.userInfo.callingCode) && "+" + this.state.userInfo.callingCode + " ") + this.state.userInfo.phone}</TextView>
|
|
<TextView style={styles.userText}>{(utils.isNotEmpty(this.state.userInfo.callingCode) && "+" + this.state.userInfo.callingCode + " ") + this.state.userInfo.phone}</TextView>
|
|
|
- <View style={styles.userTypeView}>
|
|
|
|
|
|
|
+ {/* <View style={styles.userTypeView}>
|
|
|
{ this.state.userInfo.userType?.split(";").map((item, index) => {
|
|
{ this.state.userInfo.userType?.split(";").map((item, index) => {
|
|
|
return <TextView key={index} style={styles.userTypeText}>{item}</TextView>
|
|
return <TextView key={index} style={styles.userTypeText}>{item}</TextView>
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- </View>
|
|
|
|
|
|
|
+ </View> */}
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={34}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
{/* Wallet Info */}
|
|
{/* Wallet Info */}
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
@@ -169,12 +172,28 @@ export default class ProfileV2 extends Component {
|
|
|
<TextView style={styles.cardPrimary}>{this.state.userInfo.creditStr}</TextView>
|
|
<TextView style={styles.cardPrimary}>{this.state.userInfo.creditStr}</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={28}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
|
|
+ { utils.isNotEmpty(this.state.userInfo.groupWallet) && <>
|
|
|
|
|
+ <Button
|
|
|
|
|
+ style={styles.cardView}
|
|
|
|
|
+ viewStyle={styles.profileItem}>
|
|
|
|
|
+ <Image
|
|
|
|
|
+ style={styles.cardIcon}
|
|
|
|
|
+ source={require('../../images/user/card-wallet.png')}/>
|
|
|
|
|
+ <View style={styles.cardInfo}>
|
|
|
|
|
+ <TextView style={styles.cardLabel}>{this.state.userInfo.groupWallet.walletName}</TextView>
|
|
|
|
|
+ <TextView style={styles.cardPrimary}>{this.state.userInfo.groupWallet.expireTime}</TextView>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
|
|
+ </>
|
|
|
|
|
+ }
|
|
|
{/* Vehicle Info */}
|
|
{/* Vehicle Info */}
|
|
|
- { app.vehicle.enable &&
|
|
|
|
|
|
|
+ { app.vehicle.enable && <>
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
viewStyle={styles.profileItem}
|
|
viewStyle={styles.profileItem}
|
|
@@ -187,10 +206,12 @@ export default class ProfileV2 extends Component {
|
|
|
<TextView style={styles.cardPrimary}>{this.state.userInfo.countVehicle}</TextView>
|
|
<TextView style={styles.cardPrimary}>{this.state.userInfo.countVehicle}</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={28}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
|
|
+ </>
|
|
|
}
|
|
}
|
|
|
{/* Vehicle List */}
|
|
{/* Vehicle List */}
|
|
|
{/* <View style={styles.titleView}>
|
|
{/* <View style={styles.titleView}>
|
|
@@ -233,6 +254,24 @@ 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> */}
|
|
|
|
|
+ <Button
|
|
|
|
|
+ style={styles.cardView}
|
|
|
|
|
+ viewStyle={styles.profileItem}
|
|
|
|
|
+ onClick={() => this.deleteAccount()}>
|
|
|
|
|
+ <MaterialCommunityIcons
|
|
|
|
|
+ style={styles.cardIcon}
|
|
|
|
|
+ name="account-remove"
|
|
|
|
|
+ size={32}
|
|
|
|
|
+ color="#00638C"/>
|
|
|
|
|
+ <View style={styles.cardInfo}>
|
|
|
|
|
+ <TextView style={styles.cardLabel}>{$t('profile.deleteAccount')}</TextView>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <FontAwesome
|
|
|
|
|
+ size={24}
|
|
|
|
|
+ color={textCancel}
|
|
|
|
|
+ name='angle-right'/>
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
viewStyle={styles.profileItem}
|
|
viewStyle={styles.profileItem}
|
|
@@ -244,12 +283,13 @@ export default class ProfileV2 extends Component {
|
|
|
<TextView style={styles.cardLabel}>{$t('route.changePassword')}</TextView>
|
|
<TextView style={styles.cardLabel}>{$t('route.changePassword')}</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={28}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
{/* Notifications */}
|
|
{/* Notifications */}
|
|
|
- { !app.v3.drawer &&
|
|
|
|
|
|
|
+ { !app.v3.drawer && <>
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
viewStyle={styles.profileItem}
|
|
viewStyle={styles.profileItem}
|
|
@@ -261,12 +301,14 @@ export default class ProfileV2 extends Component {
|
|
|
<TextView style={styles.cardLabel}>{$t('profile.notificationSettings')}</TextView>
|
|
<TextView style={styles.cardLabel}>{$t('profile.notificationSettings')}</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={28}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
|
|
+ </>
|
|
|
}
|
|
}
|
|
|
- { (app.modules.apply_phv && this.state.userInfo.userType.toLowerCase() == "public") &&
|
|
|
|
|
|
|
+ { (app.modules.apply_phv && this.state.userInfo.userType.toLowerCase() == "public") && <>
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
viewStyle={styles.profileItem}
|
|
viewStyle={styles.profileItem}
|
|
@@ -280,28 +322,13 @@ export default class ProfileV2 extends Component {
|
|
|
<TextView style={styles.cardLabel}>{$t('profile.apply2Fleet')}</TextView>
|
|
<TextView style={styles.cardLabel}>{$t('profile.apply2Fleet')}</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={28}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
|
|
+ </>
|
|
|
}
|
|
}
|
|
|
- <Button
|
|
|
|
|
- style={styles.cardView}
|
|
|
|
|
- viewStyle={styles.profileItem}
|
|
|
|
|
- onClick={() => this.deleteAccount()}>
|
|
|
|
|
- <MaterialCommunityIcons
|
|
|
|
|
- style={styles.cardIcon}
|
|
|
|
|
- name="account-remove"
|
|
|
|
|
- size={32}
|
|
|
|
|
- color="#00638C"/>
|
|
|
|
|
- <View style={styles.cardInfo}>
|
|
|
|
|
- <TextView style={styles.cardLabel}>{$t('profile.deleteAccount')}</TextView>
|
|
|
|
|
- </View>
|
|
|
|
|
- <FontAwesome
|
|
|
|
|
- size={28}
|
|
|
|
|
- color={textCancel}
|
|
|
|
|
- name='angle-right'/>
|
|
|
|
|
- </Button>
|
|
|
|
|
{ app.v3.drawer && <>
|
|
{ app.v3.drawer && <>
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
@@ -317,10 +344,11 @@ export default class ProfileV2 extends Component {
|
|
|
<TextView style={styles.cardLabel}>{$t('drawer.feedback')}</TextView>
|
|
<TextView style={styles.cardLabel}>{$t('drawer.feedback')}</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={28}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
viewStyle={styles.profileItem}
|
|
viewStyle={styles.profileItem}
|
|
@@ -335,10 +363,11 @@ export default class ProfileV2 extends Component {
|
|
|
<TextView style={styles.cardLabel}>{$t('drawer.settings')}</TextView>
|
|
<TextView style={styles.cardLabel}>{$t('drawer.settings')}</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={28}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.cardView}
|
|
style={styles.cardView}
|
|
|
viewStyle={styles.profileItem}
|
|
viewStyle={styles.profileItem}
|
|
@@ -353,10 +382,11 @@ export default class ProfileV2 extends Component {
|
|
|
<TextView style={styles.cardLabel}>{$t('drawer.about')}</TextView>
|
|
<TextView style={styles.cardLabel}>{$t('drawer.about')}</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
<FontAwesome
|
|
<FontAwesome
|
|
|
- size={28}
|
|
|
|
|
|
|
+ size={24}
|
|
|
color={textCancel}
|
|
color={textCancel}
|
|
|
name='angle-right'/>
|
|
name='angle-right'/>
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <ShadowViewV2/>
|
|
|
</>}
|
|
</>}
|
|
|
{/* <Button
|
|
{/* <Button
|
|
|
style={styles.deleteButton}
|
|
style={styles.deleteButton}
|
|
@@ -368,6 +398,7 @@ export default class ProfileV2 extends Component {
|
|
|
style={styles.deleteButton}
|
|
style={styles.deleteButton}
|
|
|
text={$t('profile.logout')}
|
|
text={$t('profile.logout')}
|
|
|
textColor={textLight}
|
|
textColor={textLight}
|
|
|
|
|
+ elevation={16}
|
|
|
onClick={() => this.logout()}
|
|
onClick={() => this.logout()}
|
|
|
/>
|
|
/>
|
|
|
</ScrollView>
|
|
</ScrollView>
|
|
@@ -421,8 +452,8 @@ const styles = StyleSheet.create({
|
|
|
paddingTop: 1.5
|
|
paddingTop: 1.5
|
|
|
},
|
|
},
|
|
|
cardView: {
|
|
cardView: {
|
|
|
- //padding: 16,
|
|
|
|
|
- marginTop: 16,
|
|
|
|
|
|
|
+ zIndex: 2,
|
|
|
|
|
+ marginTop: 0,
|
|
|
marginLeft: 16,
|
|
marginLeft: 16,
|
|
|
marginRight: 16,
|
|
marginRight: 16,
|
|
|
borderRadius: 10,
|
|
borderRadius: 10,
|
|
@@ -433,7 +464,7 @@ const styles = StyleSheet.create({
|
|
|
backgroundColor: colorLight,
|
|
backgroundColor: colorLight,
|
|
|
},
|
|
},
|
|
|
profileItem: {
|
|
profileItem: {
|
|
|
- padding: 16,
|
|
|
|
|
|
|
+ ...$padding(24, 16),
|
|
|
alignItems: 'center',
|
|
alignItems: 'center',
|
|
|
flexDirection: 'row',
|
|
flexDirection: 'row',
|
|
|
justifyContent: 'center',
|
|
justifyContent: 'center',
|
|
@@ -455,12 +486,13 @@ const styles = StyleSheet.create({
|
|
|
cardInfo: {
|
|
cardInfo: {
|
|
|
flex: 1,
|
|
flex: 1,
|
|
|
paddingLeft: 16,
|
|
paddingLeft: 16,
|
|
|
- alignItems: 'center',
|
|
|
|
|
- flexDirection: 'row'
|
|
|
|
|
|
|
+ alignItems: 'flex-start',
|
|
|
|
|
+ flexDirection: 'column'
|
|
|
},
|
|
},
|
|
|
cardPrimary: {
|
|
cardPrimary: {
|
|
|
color: textPrimary,
|
|
color: textPrimary,
|
|
|
- fontSize: 18
|
|
|
|
|
|
|
+ fontSize: 16,
|
|
|
|
|
+ paddingTop: 2
|
|
|
},
|
|
},
|
|
|
cardLabel: {
|
|
cardLabel: {
|
|
|
color: textPrimary,
|
|
color: textPrimary,
|
|
@@ -523,7 +555,8 @@ const styles = StyleSheet.create({
|
|
|
borderTopColor: '#eee'
|
|
borderTopColor: '#eee'
|
|
|
},
|
|
},
|
|
|
deleteButton: {
|
|
deleteButton: {
|
|
|
- ...$margin(48, 16, 16),
|
|
|
|
|
|
|
+ borderRadius: 4,
|
|
|
|
|
+ ...$margin(4, 16, 16),
|
|
|
backgroundColor: '#EA0A2A'
|
|
backgroundColor: '#EA0A2A'
|
|
|
},
|
|
},
|
|
|
userTypeView: {
|
|
userTypeView: {
|