Эх сурвалжийг харах

Enhancement webapp lite
https://dev.wormwood.com.sg/zentao/task-view-811.html

wudebin 9 сар өмнө
parent
commit
d48ced16bf

+ 37 - 1
WebApp-Lite/pages/charge/index.vue

@@ -6,7 +6,7 @@
       <view class="tool-desc" v-else>-</view>
     </view>
     <header-view
-      title="Insert Charging Cable"
+      :info="connectorInfo"
       :status="connectorInfo.status"
       :isLoading="isLoading"
       :password="password"/>
@@ -311,6 +311,42 @@ export default {
         this.showPin = true;
         return;
       }
+      if (this.connectorInfo.alertContent) {
+        uni.showModal({
+          title: "Note",
+          content: this.connectorInfo.alertContent,
+          showCancel: true,
+          success: rs => {
+            if (rs.confirm) {
+              this.requestPayment()
+            }
+          }
+        })
+      } else if (this.connectorInfo.preAuthAmount) {
+        uni.showModal({
+          title: "Pre-Authorization Payment",
+          content: this.connectorInfo.preAuthAmount + " will be held for Pre-Authorization.\nUpon charging completion, this amount will be refunded and actual usage will be charged.",
+          showCancel: true,
+          success: rs => {
+            if (rs.confirm) {
+              this.requestPayment()
+            }
+          }
+        })
+      } else {
+        uni.showModal({
+          title: "Pre-Authorization Payment",
+          content: "S$50 will be held for Pre-Authorization.\nUpon charging completion, this amount will be refunded and actual usage will be charged.",
+          showCancel: true,
+          success: rs => {
+            if (rs.confirm) {
+              this.requestPayment()
+            }
+          }
+        })
+      }
+    },
+    requestPayment() {
       uni.showLoading({
         title: "Waiting..."
       })