Procházet zdrojové kódy

update app/pages/chargingV2/ChargingPage.js

wudebin před 9 měsíci
rodič
revize
37530f274c
1 změnil soubory, kde provedl 17 přidání a 0 odebrání
  1. 17 0
      Strides-APP/app/pages/chargingV2/ChargingPage.js

+ 17 - 0
Strides-APP/app/pages/chargingV2/ChargingPage.js

@@ -37,6 +37,7 @@ export default class ChargingPage extends Component {
       currentPayment: PaymentDefault.DEFAULT.payType,
       currentPaytype: PaymentDefault.DEFAULT.payName,
       selectedVoucher: {},
+      idleFeeConfig: "",
       showDialogPayPerUse: false
     };
     this.isPageShow = true;
@@ -54,6 +55,7 @@ export default class ChargingPage extends Component {
         //测试进入
         //this.testInit();
         //正常进入
+        this.getIdleFeeConfig();
         this.getConnectorInfo();
       })
     }
@@ -242,6 +244,20 @@ export default class ChargingPage extends Component {
     })
   }
 
+  getIdleFeeConfig() {
+    apiCharge.getIdleFeeConfig(this.state.stationInfo.chargeBoxId).then(res => {
+      if (res.data && res.data.idleFee) {
+        this.setState({
+          idleFeeConfig: res.data
+        })
+      }
+    }).catch(err => {
+      this.setState({
+        idleFeeConfig: ""
+      })
+    })
+  }
+
   refreshChargeData(time=2000) {
     if (this.isPageShow) {
       //console.log("[刷新获取充电信息]", time);
@@ -513,6 +529,7 @@ export default class ChargingPage extends Component {
                 onPaymentMethodChanged={(type) => this.onPaymentMethodChanged(type)}
               />
             : <StepStart
+                idleFeeConfig={this.state.idleFeeConfig}
                 connectorInfo={this.state.connectorInfo}
                 currentPayment={this.state.currentPayment}
                 onAuthenticate={() => this.onAuthenticate()}