|
|
@@ -56,29 +56,31 @@ export default class PaymentListV2 extends Component {
|
|
|
chargeBoxId: this.props.chargeBoxId
|
|
|
}).then(res => {
|
|
|
if (res.data) {
|
|
|
- this.setState({
|
|
|
- options: res.data,
|
|
|
- isloading: false
|
|
|
- })
|
|
|
+ let index = 0;
|
|
|
if (this.props.payType && this.props.payType.code) {
|
|
|
for (let i = 0; i < res.data.length; i++) {
|
|
|
let type = res.data[i];
|
|
|
if (type.code == this.props.payType.code) {
|
|
|
- this.changeMethod(i);
|
|
|
+ index = i;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- let index = 0;
|
|
|
for (let i = 0; i < res.data.length; i++) {
|
|
|
let type = res.data[i];
|
|
|
- if (type.def) {
|
|
|
+ if (type.code == "fleet_group_wallet" || type.code == "fleet_individual_wallet") {
|
|
|
index = i;
|
|
|
+ type.def = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- this.changeMethod(index);
|
|
|
}
|
|
|
+ this.setState({
|
|
|
+ options: res.data,
|
|
|
+ isloading: false
|
|
|
+ }, () => {
|
|
|
+ this.changeMethod(index);
|
|
|
+ });
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
|