|
|
@@ -10,6 +10,7 @@ import Dialog from '../../components/Dialog';
|
|
|
import { MyRefreshProps } from '../../components/ThemesConfig';
|
|
|
import utils from '../../utils/utils';
|
|
|
import { PageList } from '../Router';
|
|
|
+import app from '../../../app.json';
|
|
|
|
|
|
export default class Summary extends Component {
|
|
|
constructor(props) {
|
|
|
@@ -105,6 +106,14 @@ export default class Summary extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ getTaxTitle(title="") {
|
|
|
+ if (this.state.summaryInfo?.taxRate) {
|
|
|
+ return title.replace("$s", this.state.summaryInfo.taxRate)
|
|
|
+ } else {
|
|
|
+ return title;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
return (
|
|
|
<ScrollView
|
|
|
@@ -118,12 +127,14 @@ export default class Summary extends Component {
|
|
|
}>
|
|
|
{ utils.isNotEmpty(this.state.summaryInfo.top) &&
|
|
|
<View style={styles.headerView}>
|
|
|
- <Octicons
|
|
|
- name="check-circle-fill"
|
|
|
- color={colorAccent}
|
|
|
- size={56}/>
|
|
|
- <Text style={styles.topTitle}>{$t('receipt.successful')}</Text>
|
|
|
- <Text style={styles.topDesc}>{$t('receipt.chargingSessionComplete')}</Text>
|
|
|
+ { this.state.isActully && <>
|
|
|
+ <Octicons
|
|
|
+ name="check-circle-fill"
|
|
|
+ color={colorAccent}
|
|
|
+ size={56}/>
|
|
|
+ <Text style={styles.topTitle}>{$t('receipt.successful')}</Text>
|
|
|
+ <Text style={styles.topDesc}>{$t('receipt.chargingSessionComplete')}</Text>
|
|
|
+ </>}
|
|
|
{ utils.isNotEmpty(this.state.summaryInfo.top.company) &&
|
|
|
<View style={styles.formRow}>
|
|
|
<Text style={styles.label}>{$t('sign.labelCompany')}:</Text>
|
|
|
@@ -181,15 +192,15 @@ export default class Summary extends Component {
|
|
|
<View style={styles.sections}>
|
|
|
<Text style={styles.formTitle}>{$t('wallet.labelYourConnector')}</Text>
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('charging.labelType')}</Text>
|
|
|
+ <Text style={styles.label}>{$t('charging.labelType')}:</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.connector.type}</Text>
|
|
|
</View>
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('charging.labelPower')}</Text>
|
|
|
+ <Text style={styles.label}>{$t('charging.labelPower')}:</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.connector.power}</Text>
|
|
|
</View>
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('charging.labelRates')}</Text>
|
|
|
+ <Text style={styles.label}>{$t('charging.labelRates')}:</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.connector.rates}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
@@ -206,7 +217,7 @@ export default class Summary extends Component {
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.chargingFee.chargeDelivered ?? 0}</Text>
|
|
|
</View>
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('receipt.labelChargTransSubtotal')}</Text>
|
|
|
+ <Text style={styles.label}>{this.getTaxTitle($t('receipt.labelChargTransSubtotal2'))}</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.chargingFee.transactionSubtotal}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
@@ -223,7 +234,7 @@ export default class Summary extends Component {
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.idleFee.duration}</Text>
|
|
|
</View>
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('receipt.labelIdleFeeSubtotal')}</Text>
|
|
|
+ <Text style={styles.label}>{this.getTaxTitle($t('receipt.labelIdleFeeSubtotal2'))}</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.idleFee.subtotal}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
@@ -240,7 +251,7 @@ export default class Summary extends Component {
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.reservationFee.reservationDuration}</Text>
|
|
|
</View>
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('receipt.labelReservationFeeSubtotal')}</Text>
|
|
|
+ <Text style={styles.label}>{this.getTaxTitle($t('receipt.labelReservationFeeSubtotal2'))}</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.reservationFee.reservationFeeSubtotal}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
@@ -254,26 +265,33 @@ export default class Summary extends Component {
|
|
|
</View>
|
|
|
{ utils.isNotEmpty(this.state.summaryInfo.payment.transactionSubtotal) &&
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('receipt.labelChargTransSubtotal')}</Text>
|
|
|
+ <Text style={styles.label}>{this.getTaxTitle($t('receipt.labelChargTransSubtotal2'))}</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.payment.transactionSubtotal}</Text>
|
|
|
</View>
|
|
|
}
|
|
|
{ utils.isNotEmpty(this.state.summaryInfo.payment.idleFeeSubtotal) &&
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('receipt.labelIdleFeeSubtotal')}</Text>
|
|
|
+ <Text style={styles.label}>{this.getTaxTitle($t('receipt.labelIdleFeeSubtotal2'))}</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.payment.idleFeeSubtotal}</Text>
|
|
|
</View>
|
|
|
}
|
|
|
{ utils.isNotEmpty(this.state.summaryInfo.payment.reservationFeeSubtotal) &&
|
|
|
<View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('receipt.labelReservationFeeSubtotal')}</Text>
|
|
|
+ <Text style={styles.label}>{this.getTaxTitle($t('receipt.labelReservationFeeSubtotal2'))}</Text>
|
|
|
<Text style={styles.text}>{this.state.summaryInfo.payment.reservationFeeSubtotal}</Text>
|
|
|
</View>
|
|
|
}
|
|
|
- <View style={styles.formRow}>
|
|
|
- <Text style={styles.label}>{$t('receipt.labelFinalPaymentAmount')}</Text>
|
|
|
- <Text style={styles.text}>{this.state.summaryInfo.payment.finalPayment ?? "-"}</Text>
|
|
|
- </View>
|
|
|
+ { utils.isNotEmpty(this.state.summaryInfo.payment.finalPayment) &&
|
|
|
+ <View style={styles.formRow}>
|
|
|
+ <Text style={styles.label}>
|
|
|
+ { utils.isNotEmpty(this.state.summaryInfo.payment.discountCredit)
|
|
|
+ ? $t('receipt.labelAfterDiscount')
|
|
|
+ : $t('receipt.labelFinalPaymentAmount')
|
|
|
+ }
|
|
|
+ </Text>
|
|
|
+ <Text style={styles.text}>{this.state.summaryInfo.payment.finalPayment ?? "-"}</Text>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
{/* <View style={styles.formRow}>
|
|
|
<Text style={styles.label}>{$t('wallet.labelChargeRates')}</Text>
|
|
|
<Text style={styles.text}>{currency}{this.state.summaryInfo.chargeRates ?? '0.0'}</Text>
|