Bladeren bron

Display summary page if a remote stop transaction was performed on the active transactions.

vbea 3 jaren geleden
bovenliggende
commit
0a52ff3b72

+ 1 - 1
Strides-APP/android/app/build.gradle

@@ -280,7 +280,7 @@ dependencies {
     implementation 'com.google.android.gms:play-services-base:17.2.1'*/
     /*implementation 'com.google.android.gms:play-services-maps:17.0.0'
     implementation 'com.google.maps.android:android-maps-utils:2.2.3'*/
-    implementation platform('com.google.firebase:firebase-bom:28.2.1')
+    implementation platform('com.google.firebase:firebase-bom:32.0.0')
     implementation 'com.google.firebase:firebase-messaging'
     implementation 'com.google.firebase:firebase-analytics'
 }

+ 2 - 2
Strides-APP/android/app/version.properties

@@ -1,2 +1,2 @@
-#Fri May 05 14:58:21 CST 2023
-VERSION_CODE=217
+#Sat May 06 18:20:32 CST 2023
+VERSION_CODE=219

+ 1 - 1
Strides-APP/android/build.gradle

@@ -15,7 +15,7 @@ buildscript {
     }
     dependencies {
         classpath("com.android.tools.build:gradle:4.1.1")
-        classpath('com.google.gms:google-services:4.3.8')
+        classpath('com.google.gms:google-services:4.3.15')
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
     }

+ 6 - 1
Strides-APP/app/pages/charge/QRScan.js

@@ -1,5 +1,5 @@
 /**
- * 扫描二维码
+ * 扫描二维码(废弃)
  * @邠心vbe on 2021/03/24
  */
 import React, { Component } from 'react'
@@ -89,6 +89,11 @@ export default class QRScan extends Component {
         isResult: false
       });
     }, 300);
+    this.props.navigation.addListener('focus', () => {
+      this.setState({
+        isResult: false
+      });
+    });
   }
 
   scanResult = (msg) => {

+ 36 - 29
Strides-APP/app/pages/chargeV2/ChargeAdapter.js

@@ -44,7 +44,7 @@ export default class ChargeAdapter extends Component {
       component: Reserve
     }/*, {
       title: "Explore",
-      component: Reserve
+      component: Explore
     }*/]
     this.tabBarStyle = {
       style: styles.tabStyle,
@@ -54,6 +54,7 @@ export default class ChargeAdapter extends Component {
       activeTintColor: textPrimary,
       inactiveTintColor: textSecondary //"#E0E0E0", 
     }
+    this.action = "";
     this.isHide = false;
     this.titleName = "";
   }
@@ -101,9 +102,6 @@ export default class ChargeAdapter extends Component {
       this.setState({
         action: act
       });
-      if (act == 'qr') {
-        //this.onEnterStation();
-      }
     }
   }
 
@@ -128,11 +126,6 @@ export default class ChargeAdapter extends Component {
       });
       //if (this.action !== 'view')
       this.updateStationInfo();
-      if (this.action == 'qr') {
-        // setTimeout(() => {
-        //   this.changeTab(1)
-        // }, 300);
-      }
     } else {
       this.setState({
         showLoginDialog: true
@@ -152,28 +145,42 @@ export default class ChargeAdapter extends Component {
   updateStationInfo() {
     navigator.geolocation.getCurrentPosition(location => {
       let params = {
-        lat: location.coords.latitude,
-        lng: location.coords.longitude,
-        sitePk: this.state.stationInfo.id
+        latitude: location.coords.latitude,
+        longitude: location.coords.longitude,
       }
-      apiStation.getStationRate(params).then(res => {
-        if (res.data.sitePk) {
-          var info = utils.getSiteInfo(res.data);
-          PagerUtil.setStationInfo(info);
-          PagerUtil.setRefreshing(getFocusedRouteNameFromRoute(this.props.route));
-          this.setState({
-            refreshing: false,
-            stationInfo: info
-          }, () => {
-            this.setPageTitle();
-          });
-        }
-      }).catch(err => {
-        toastLong(err);
+      this.getStationInfo(params)
+    }, err => {
+      this.getStationInfo()
+    });
+  }
+
+  getStationInfo(location={}) {
+    apiStation.getStationRate({
+      sitePk: this.state.stationInfo.id,
+      lat: location?.latitude,
+      lng: location?.longitude
+    }).then(res => {
+      if (res.data.sitePk) {
+        var info = utils.getSiteInfo(res.data);
+        PagerUtil.setStationInfo(info);
+        PagerUtil.setRefreshing(getFocusedRouteNameFromRoute(this.props.route));
         this.setState({
-          refreshing: false
-        })
-      });
+          refreshing: false,
+          stationInfo: info
+        }, () => {
+          this.setPageTitle();
+        });
+        if (this.action == 'qr') {
+          setTimeout(() => {
+            this.changeTab(1)
+          }, 300);
+        }
+      }
+    }).catch((err) => {
+      toastLong(err);
+      this.setState({
+        refreshing: false
+      })
     });
   }
 

+ 5 - 0
Strides-APP/app/pages/chargeV2/QRScan.js

@@ -89,6 +89,11 @@ export default class QRScan extends Component {
         isResult: false
       });
     }, 300);
+    this.props.navigation.addListener('focus', () => {
+      this.setState({
+        isResult: false
+      });
+    });
   }
 
   scanResult = (msg) => {

+ 23 - 5
Strides-APP/app/pages/chargeV2/TabCharge.js

@@ -589,11 +589,29 @@ export default class TabCharge extends Component {
             });
             break;
           case 'Finishing': //已完成
-            this.setState({
-              isStart: true,
-              isPending: false,
-              isCharging: false
-            });
+            if (res.data.chargingPk) {
+              Dialog.showProgressDialog();
+              setTimeout(() => {
+                Dialog.dismissLoading();
+                this.setState({
+                  isStart: false,
+                  isPending: false,
+                  isCharging: false
+                });
+                startPage(PageList.summary, { 
+                  chargingPk: res.data.chargingPk,
+                  id: this.state.stationInfo.id,
+                  name: this.state.stationInfo.name,
+                  address: this.state.stationInfo.address
+                });
+              }, 2000);
+            } else {
+              this.setState({
+                isStart: true,
+                isPending: false,
+                isCharging: false
+              });
+            }
             break;
           default:
             this.setState({