|
@@ -13,6 +13,7 @@ import ImageCropPicker from 'react-native-image-crop-picker';
|
|
|
import { UploadThemes } from '../../components/ThemesConfig';
|
|
import { UploadThemes } from '../../components/ThemesConfig';
|
|
|
import apiUpload from '../../api/apiUpload';
|
|
import apiUpload from '../../api/apiUpload';
|
|
|
import utils from '../../utils/utils';
|
|
import utils from '../../utils/utils';
|
|
|
|
|
+import app from '../../../app.json';
|
|
|
|
|
|
|
|
const options = {
|
|
const options = {
|
|
|
width: 300,
|
|
width: 300,
|
|
@@ -159,7 +160,11 @@ export default class VehicleDetail extends Component {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (!this.state.vehicleInfo.licensePlate) {
|
|
if (!this.state.vehicleInfo.licensePlate) {
|
|
|
- toastShort($t('profile.msgInputPlate'));
|
|
|
|
|
|
|
+ if (app.vehicle.showLicencePlate) {
|
|
|
|
|
+ toastShort($t('profile.msgInputPlate'));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ toastShort($t('profile.msgInputCarNo'));
|
|
|
|
|
+ }
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
/*if (!this.state.vehicleInfo.batteryCapacity) {
|
|
/*if (!this.state.vehicleInfo.batteryCapacity) {
|
|
@@ -206,6 +211,14 @@ export default class VehicleDetail extends Component {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ getAsterisk() {
|
|
|
|
|
+ if (app.vehicle.showRequiredAsterisk) {
|
|
|
|
|
+ return " *";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
return (
|
|
return (
|
|
|
<ScrollView
|
|
<ScrollView
|
|
@@ -223,7 +236,7 @@ export default class VehicleDetail extends Component {
|
|
|
<Dropdown
|
|
<Dropdown
|
|
|
style={styles.formDropdown}
|
|
style={styles.formDropdown}
|
|
|
list={this.state.brandOptions}
|
|
list={this.state.brandOptions}
|
|
|
- placeholder={$t('profile.selectBrand')}
|
|
|
|
|
|
|
+ placeholder={$t('profile.selectBrand') + this.getAsterisk()}
|
|
|
title={$t('profile.vehicleBrand')}
|
|
title={$t('profile.vehicleBrand')}
|
|
|
value={this.state.vehicleInfo.brand}
|
|
value={this.state.vehicleInfo.brand}
|
|
|
autoSelect={false}
|
|
autoSelect={false}
|
|
@@ -235,7 +248,7 @@ export default class VehicleDetail extends Component {
|
|
|
<Dropdown
|
|
<Dropdown
|
|
|
style={styles.formDropdown}
|
|
style={styles.formDropdown}
|
|
|
list={this.state.modelOptions}
|
|
list={this.state.modelOptions}
|
|
|
- placeholder={$t('profile.selectModel')}
|
|
|
|
|
|
|
+ placeholder={$t('profile.selectModel') + this.getAsterisk()}
|
|
|
title={$t('profile.vehicleModel')}
|
|
title={$t('profile.vehicleModel')}
|
|
|
value={this.state.vehicleInfo.vehicleModelId}
|
|
value={this.state.vehicleInfo.vehicleModelId}
|
|
|
valueKey={"vehicleModelId"}
|
|
valueKey={"vehicleModelId"}
|
|
@@ -246,7 +259,7 @@ export default class VehicleDetail extends Component {
|
|
|
<TextInput
|
|
<TextInput
|
|
|
style={styles.formInput}
|
|
style={styles.formInput}
|
|
|
defaultValue={this.state.vehicleInfo.licensePlate}
|
|
defaultValue={this.state.vehicleInfo.licensePlate}
|
|
|
- placeholder={$t('profile.enterLicensePlate')}
|
|
|
|
|
|
|
+ placeholder={$t(app.vehicle.showLicencePlate ? 'profile.enterLicensePlate' : 'profile.enterLicenseNumber') + this.getAsterisk()}
|
|
|
placeholderTextColor={textPlacehoder}
|
|
placeholderTextColor={textPlacehoder}
|
|
|
maxLength={20}
|
|
maxLength={20}
|
|
|
onChangeText={text => this.changeForm("licensePlate", text)}
|
|
onChangeText={text => this.changeForm("licensePlate", text)}
|
|
@@ -263,24 +276,27 @@ export default class VehicleDetail extends Component {
|
|
|
/>
|
|
/>
|
|
|
<TextView style={styles.titleText}>kWh</TextView>
|
|
<TextView style={styles.titleText}>kWh</TextView>
|
|
|
</View>
|
|
</View>
|
|
|
- <View style={ui.flexc}>
|
|
|
|
|
- <MaterialCommunityIcons
|
|
|
|
|
- name="form-dropdown"
|
|
|
|
|
- size={20}
|
|
|
|
|
- color={textPrimary}
|
|
|
|
|
- style={ui.bold}
|
|
|
|
|
|
|
+ { app.vehicle.requireConnectorType && <>
|
|
|
|
|
+ <View style={ui.flexc}>
|
|
|
|
|
+ <MaterialCommunityIcons
|
|
|
|
|
+ name="form-dropdown"
|
|
|
|
|
+ size={20}
|
|
|
|
|
+ color={textPrimary}
|
|
|
|
|
+ style={ui.bold}
|
|
|
|
|
+ />
|
|
|
|
|
+ <TextView style={styles.titleText}>{$t('profile.connecterType')}</TextView>
|
|
|
|
|
+ </View>
|
|
|
|
|
+ <Dropdown
|
|
|
|
|
+ style={styles.formDropdown}
|
|
|
|
|
+ list={this.state.typeOptions}
|
|
|
|
|
+ placeholder={$t('profile.selectConnecterType')}
|
|
|
|
|
+ title={$t('profile.connecterType')}
|
|
|
|
|
+ value={this.state.vehicleInfo.connectorType}
|
|
|
|
|
+ onChange={value => this.changeForm("connectorType", value)}
|
|
|
|
|
+ autoSelect={false}
|
|
|
/>
|
|
/>
|
|
|
- <TextView style={styles.titleText}>{$t('profile.connecterType')}</TextView>
|
|
|
|
|
- </View>
|
|
|
|
|
- <Dropdown
|
|
|
|
|
- style={styles.formDropdown}
|
|
|
|
|
- list={this.state.typeOptions}
|
|
|
|
|
- placeholder={$t('profile.selectConnecterType')}
|
|
|
|
|
- title={$t('profile.connecterType')}
|
|
|
|
|
- value={this.state.vehicleInfo.connectorType}
|
|
|
|
|
- onChange={value => this.changeForm("connectorType", value)}
|
|
|
|
|
- autoSelect={false}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ </> }
|
|
|
|
|
+ { app.vehicle.requireImageUpload && <>
|
|
|
<View style={ui.flexc}>
|
|
<View style={ui.flexc}>
|
|
|
<MaterialCommunityIcons
|
|
<MaterialCommunityIcons
|
|
|
name="tray-arrow-up"
|
|
name="tray-arrow-up"
|
|
@@ -313,6 +329,7 @@ export default class VehicleDetail extends Component {
|
|
|
</Pressable>
|
|
</Pressable>
|
|
|
}
|
|
}
|
|
|
</View>
|
|
</View>
|
|
|
|
|
+ </> }
|
|
|
<View style={styles.buttonView}>
|
|
<View style={styles.buttonView}>
|
|
|
<Button
|
|
<Button
|
|
|
text={$t('common.save')}
|
|
text={$t('common.save')}
|