|
@@ -74,7 +74,7 @@ export default class Feedback extends React.Component {
|
|
|
noTypeDialog() {
|
|
noTypeDialog() {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
if (this.pageShow) {
|
|
if (this.pageShow) {
|
|
|
- Dialog.showResultDialog('Can not fetch feedback type!', 'OK', back => {
|
|
|
|
|
|
|
+ Dialog.showResultDialog($t('feedback.errFetchType'), $t('nav.ok'), back => {
|
|
|
goBack();
|
|
goBack();
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -94,7 +94,7 @@ export default class Feedback extends React.Component {
|
|
|
}, () => {
|
|
}, () => {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
this.getChargeBox(searchId)
|
|
this.getChargeBox(searchId)
|
|
|
- }, 400);
|
|
|
|
|
|
|
+ }, 300);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -153,8 +153,9 @@ export default class Feedback extends React.Component {
|
|
|
this.setState({
|
|
this.setState({
|
|
|
imageUrl: imageUrl
|
|
imageUrl: imageUrl
|
|
|
});
|
|
});
|
|
|
|
|
+ toastShort($t('common.uploadSuccess'));
|
|
|
} else {
|
|
} else {
|
|
|
- toastShort('Upload failed, please retry');
|
|
|
|
|
|
|
+ toastShort($t('common.uploadFailed'));
|
|
|
}
|
|
}
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
|
toastShort(err);
|
|
toastShort(err);
|
|
@@ -167,11 +168,11 @@ export default class Feedback extends React.Component {
|
|
|
|
|
|
|
|
submitFeedback() {
|
|
submitFeedback() {
|
|
|
if (this.state.typeOfFeedback == '') {
|
|
if (this.state.typeOfFeedback == '') {
|
|
|
- toastShort('Please select type of feedback');
|
|
|
|
|
|
|
+ toastShort($t('feedback.errFeedbackType'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
if (this.state.feedback == '') {
|
|
if (this.state.feedback == '') {
|
|
|
- toastShort('Please type feedback content');
|
|
|
|
|
|
|
+ toastShort($t('feedback.errFeednackContent'));
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
const params = {
|
|
const params = {
|
|
@@ -186,7 +187,7 @@ export default class Feedback extends React.Component {
|
|
|
Dialog.showProgressDialog();
|
|
Dialog.showProgressDialog();
|
|
|
apiUser.feedback(params).then(res => {
|
|
apiUser.feedback(params).then(res => {
|
|
|
Dialog.dismissLoading();
|
|
Dialog.dismissLoading();
|
|
|
- Dialog.showResultDialog('Send feedback successfully!', 'OK', back => {
|
|
|
|
|
|
|
+ Dialog.showResultDialog($t('feedback.sendSuccess'), $t('nav.ok'), back => {
|
|
|
goBack();
|
|
goBack();
|
|
|
});
|
|
});
|
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
@@ -222,8 +223,8 @@ export default class Feedback extends React.Component {
|
|
|
contentInsetAdjustmentBehavior='automatic'>
|
|
contentInsetAdjustmentBehavior='automatic'>
|
|
|
<View style={styles.headerView}>
|
|
<View style={styles.headerView}>
|
|
|
<View style={ui.flex1}>
|
|
<View style={ui.flex1}>
|
|
|
- <Text style={styles.title}>Have something to tell us?</Text>
|
|
|
|
|
- <Text style={styles.content}>Please let us know below!</Text>
|
|
|
|
|
|
|
+ <Text style={styles.title}>{$t('feedback.tipsSomething')}</Text>
|
|
|
|
|
+ <Text style={styles.content}>{$t('feedback.tipsLetKnow')}</Text>
|
|
|
</View>
|
|
</View>
|
|
|
<Image
|
|
<Image
|
|
|
style={styles.headerImage}
|
|
style={styles.headerImage}
|
|
@@ -232,32 +233,33 @@ export default class Feedback extends React.Component {
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
<View style={styles.contentView}>
|
|
<View style={styles.contentView}>
|
|
|
- <Text style={styles.typeTitle}>Type of Feedback</Text>
|
|
|
|
|
|
|
+ <Text style={styles.typeTitle}>{$t('feedback.typeOfFeedback')}</Text>
|
|
|
<View style={styles.pickerView}>
|
|
<View style={styles.pickerView}>
|
|
|
<Dropdown
|
|
<Dropdown
|
|
|
style={styles.pickerViewInfo}
|
|
style={styles.pickerViewInfo}
|
|
|
- title='Type of Feedback'
|
|
|
|
|
|
|
+ title={$t('feedback.typeOfFeedback')}
|
|
|
list={this.state.typeList}
|
|
list={this.state.typeList}
|
|
|
value={this.state.typeOfFeedback}
|
|
value={this.state.typeOfFeedback}
|
|
|
nameKey={'value'}
|
|
nameKey={'value'}
|
|
|
valueKey={'key'}
|
|
valueKey={'key'}
|
|
|
- placeholder='Select'
|
|
|
|
|
|
|
+ placeholder={$t('common.select')}
|
|
|
onChange={(value, index) => this.changeType(value, index)}/>
|
|
onChange={(value, index) => this.changeType(value, index)}/>
|
|
|
</View>
|
|
</View>
|
|
|
|
|
|
|
|
- <Text style={styles.typeTitle}>Please fill in here (500 words)</Text>
|
|
|
|
|
|
|
+ <Text style={styles.typeTitle}>{$t('feedback.labelContent')}</Text>
|
|
|
<TextInput
|
|
<TextInput
|
|
|
style={styles.feedbackInput}
|
|
style={styles.feedbackInput}
|
|
|
multiline={true}
|
|
multiline={true}
|
|
|
- maxLength={1000}
|
|
|
|
|
numberOfLines={8}
|
|
numberOfLines={8}
|
|
|
|
|
+ maxLength={1000}
|
|
|
textAlignVertical='top'
|
|
textAlignVertical='top'
|
|
|
onChangeText={text => {
|
|
onChangeText={text => {
|
|
|
this.setState({
|
|
this.setState({
|
|
|
feedback: text
|
|
feedback: text
|
|
|
});
|
|
});
|
|
|
}}/>
|
|
}}/>
|
|
|
- <Text style={styles.typeTitle}>Please upload relevant images</Text>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <Text style={styles.typeTitle}>{$t('feedback.labelUpload')}</Text>
|
|
|
<View
|
|
<View
|
|
|
style={styles.uploadGroup}>
|
|
style={styles.uploadGroup}>
|
|
|
{ this.state.imageUrl.map((item, index) => {
|
|
{ this.state.imageUrl.map((item, index) => {
|
|
@@ -282,8 +284,9 @@ export default class Feedback extends React.Component {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
</View>
|
|
</View>
|
|
|
|
|
+
|
|
|
{this.state.typeOfFeedback == "csf" && <>
|
|
{this.state.typeOfFeedback == "csf" && <>
|
|
|
- <Text style={styles.typeTitle}>Which charging station?</Text>
|
|
|
|
|
|
|
+ <Text style={styles.typeTitle}>{$t('feedback.labelStation')}</Text>
|
|
|
<Pressable
|
|
<Pressable
|
|
|
style={[styles.pickerView, styles.stationView]}
|
|
style={[styles.pickerView, styles.stationView]}
|
|
|
android_ripple={ripple}
|
|
android_ripple={ripple}
|
|
@@ -295,20 +298,20 @@ export default class Feedback extends React.Component {
|
|
|
/>
|
|
/>
|
|
|
<Text style={styles.textStation}>{this.state.chargeBoxId}</Text>
|
|
<Text style={styles.textStation}>{this.state.chargeBoxId}</Text>
|
|
|
</Pressable>
|
|
</Pressable>
|
|
|
- <Text style={styles.typeTitle}>Which connecter?</Text>
|
|
|
|
|
|
|
+ <Text style={styles.typeTitle}>{$t('feedback.labelConnector')}</Text>
|
|
|
<View style={styles.pickerView}>
|
|
<View style={styles.pickerView}>
|
|
|
<Dropdown
|
|
<Dropdown
|
|
|
style={styles.pickerViewInfo}
|
|
style={styles.pickerViewInfo}
|
|
|
- title="Select a Connecter"
|
|
|
|
|
|
|
+ title={$t('feedback.selectConnector')}
|
|
|
list={this.state.connectorList}
|
|
list={this.state.connectorList}
|
|
|
value={this.state.connectorId}
|
|
value={this.state.connectorId}
|
|
|
- placeholder="Select"
|
|
|
|
|
|
|
+ placeholder={$t('common.select')}
|
|
|
onChange={value => this.changeConnector(value)}/>
|
|
onChange={value => this.changeConnector(value)}/>
|
|
|
</View>
|
|
</View>
|
|
|
</>}
|
|
</>}
|
|
|
<Button
|
|
<Button
|
|
|
style={styles.button}
|
|
style={styles.button}
|
|
|
- text='Submit Feedback'
|
|
|
|
|
|
|
+ text={$t('feedback.submitFeedback')}
|
|
|
elevation={1.5}
|
|
elevation={1.5}
|
|
|
onClick={() => {
|
|
onClick={() => {
|
|
|
this.submitFeedback();
|
|
this.submitFeedback();
|
|
@@ -333,7 +336,7 @@ export default class Feedback extends React.Component {
|
|
|
<TextInput
|
|
<TextInput
|
|
|
style={styles.inputView}
|
|
style={styles.inputView}
|
|
|
maxLength={50}
|
|
maxLength={50}
|
|
|
- placeholder="Searching for ChargeBoxId"
|
|
|
|
|
|
|
+ placeholder={$t('feedback.searchingChargeBox')}
|
|
|
onChangeText={text => this.listChargeBox(text)}
|
|
onChangeText={text => this.listChargeBox(text)}
|
|
|
/>
|
|
/>
|
|
|
</View>
|
|
</View>
|
|
@@ -348,7 +351,7 @@ export default class Feedback extends React.Component {
|
|
|
data={this.state.chargeBoxList}
|
|
data={this.state.chargeBoxList}
|
|
|
keyExtractor={(item,index) => index}
|
|
keyExtractor={(item,index) => index}
|
|
|
renderItem={this.listItem}
|
|
renderItem={this.listItem}
|
|
|
- ListEmptyComponent={<Text style={styles.noResult}>No Station</Text>}
|
|
|
|
|
|
|
+ ListEmptyComponent={<Text style={styles.noResult}>{$t('home.noSearch')}</Text>}
|
|
|
/>
|
|
/>
|
|
|
}
|
|
}
|
|
|
</View>
|
|
</View>
|
|
@@ -442,7 +445,7 @@ const styles = StyleSheet.create({
|
|
|
pickerViewInfo: {
|
|
pickerViewInfo: {
|
|
|
height: 44,
|
|
height: 44,
|
|
|
paddingLeft: 16,
|
|
paddingLeft: 16,
|
|
|
- paddingRight: 32,
|
|
|
|
|
|
|
+ paddingRight: 8,
|
|
|
alignItems: 'center',
|
|
alignItems: 'center',
|
|
|
flexDirection: 'row'
|
|
flexDirection: 'row'
|
|
|
},
|
|
},
|
|
@@ -497,7 +500,8 @@ const styles = StyleSheet.create({
|
|
|
fontSize: 15
|
|
fontSize: 15
|
|
|
},
|
|
},
|
|
|
seachingIcon: {
|
|
seachingIcon: {
|
|
|
- width: 100,
|
|
|
|
|
- height: 100
|
|
|
|
|
|
|
+ width: 50,
|
|
|
|
|
+ height: 50,
|
|
|
|
|
+ marginTop: 20
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|