Selaa lähdekoodia

Merge branch 'master' of https://ac.tastecn.com/github/wormwood-evcharge/strides

vbea 1 vuosi sitten
vanhempi
sitoutus
ee42dfb3b8

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

@@ -1,2 +1,2 @@
-#Wed Dec 25 14:47:16 CST 2024
-VERSION_CODE=518
+#Sat Dec 28 18:24:03 CST 2024
+VERSION_CODE=570

+ 2 - 1
Strides-APP/app/components/ShadowView.js

@@ -57,6 +57,7 @@ const styles = StyleSheet.create({
     opacity: .8,
     marginTop: -8,
     marginLeft: 20,
-    marginRight: 20
+    marginRight: 20,
+    display: "none"
   }
 })

+ 63 - 30
Strides-APP/app/pages/chargeV2/PaymentListV2.js

@@ -26,7 +26,8 @@ export default class PaymentListV2 extends Component {
       options: [],
       selectIndex: 0,
       selectOptions: {},
-      isloading: true
+      isloading: true,
+      delayTimes: 1738080000000
     };
   }
 
@@ -55,49 +56,81 @@ export default class PaymentListV2 extends Component {
     apiCharge.getPaymentTypeOptions({
       chargeBoxId: this.props.chargeBoxId
     }).then(res => {
-      if (res.data) {
-        let index = 0;
+      if (utils.isNotEmpty(res.data)) {
         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) {
-              index = i;
-              break;
-            }
-          }
-        } else {
-          let hasDef = false;
-          for (let i = 0; i < res.data.length; i++) {
-            let type = res.data[i];
-            if (type.code == "fleet_group_wallet" || type.code == "fleet_individual_wallet") {
-              index = i;
-              type.def = true;
-              hasDef = true;
-              break;
-            }
-          }
-          if (!hasDef) {
+          this.setState({
+            options: res.data,
+            isloading: false
+          }, () => {
             for (let i = 0; i < res.data.length; i++) {
               let type = res.data[i];
-              if (type.def) {
-                index = i;
+              if (type.code == this.props.payType.code) {
+                this.changeMethod(i);
                 break;
               }
             }
+          });
+        } else {
+          let time = new Date().getTime();
+          if (time > this.state.delayTimes) {
+            this.setDataToChargEco(res.data);
+          } else {
+            this.setDataToDefault(res.data);
           }
         }
-        this.setState({
-          options: res.data,
-          isloading: false
-        }, () => {
-          this.changeMethod(index);
-        });
       }
     }).catch(err => {
 
     })
   }
 
+  setDataToDefault(list) {
+    let index = 0;
+    for (let i = 0; i < list.length; i++) {
+      let type = list[i];
+      if (type.def) {
+        index = i;
+        break;
+      }
+    }
+    this.setState({
+      options: list,
+      isloading: false
+    }, () => {
+      this.changeMethod(index);
+    })
+  }
+
+  setDataToChargEco(list) {
+    let index = 0;
+    let hasDef = false;
+    for (let i = 0; i < list.length; i++) {
+      let type = list[i];
+      if (type.code == "fleet_group_wallet" || type.code == "fleet_individual_wallet") {
+        index = i;
+        type.def = true;
+        hasDef = true;
+      } else {
+        type.def = false;
+      }
+    }
+    if (!hasDef) {
+      for (let i = 0; i < list.length; i++) {
+        let type = list[i];
+        if (type.def) {
+          index = i;
+          break;
+        }
+      }
+    }
+    this.setState({
+      options: list,
+      isloading: false
+    }, () => {
+      this.changeMethod(index);
+    });
+  }
+
   showDialog(visible) {
     if (this.state.isSelect) {
       this.setState({

+ 8 - 6
Strides-APP/app/pages/my/ProfileV2.js

@@ -125,7 +125,7 @@ export default class ProfileV2 extends Component {
     return (
       <ScrollView style={styles.container}>
         {/* Profile Info */}
-        <EndView/>
+        <EndView half/>
         <Button
           style={styles.cardView}
           viewStyle={styles.profileView}
@@ -159,6 +159,7 @@ export default class ProfileV2 extends Component {
             name='angle-right'/>
         </Button>
         <ShadowViewV2/>
+        <EndView half/>
         {/* Wallet Info */}
         <Button 
           style={styles.cardView}
@@ -185,8 +186,8 @@ export default class ProfileV2 extends Component {
               style={styles.cardIcon}
               source={require('../../images/user/card-wallet.png')}/>
             <View style={styles.cardInfo}>
-              <TextView style={styles.cardLabel}>{this.state.userInfo.groupWallet.walletName}</TextView>
-              <TextView style={styles.cardPrimary}>{this.state.userInfo.groupWallet.expireTime}</TextView>
+              <TextView style={styles.cardLabel}>{this.state.userInfo.groupWallet.walletName}:</TextView>
+              <TextView style={styles.cardPrimary}>{this.state.userInfo.groupWallet.creditStr}, Expires on {this.state.userInfo.groupWallet.expireTime}</TextView>
             </View>
           </Button>
           <ShadowViewV2/>
@@ -398,7 +399,8 @@ export default class ProfileV2 extends Component {
           style={styles.deleteButton}
           text={$t('profile.logout')}
           textColor={textLight}
-          elevation={16}
+          elevation={4}
+          textSize={20}
           onClick={() => this.logout()}
         />
       </ScrollView>
@@ -453,7 +455,7 @@ const styles = StyleSheet.create({
   },
   cardView: {
     zIndex: 2,
-    marginTop: 0,
+    marginTop: 8,
     marginLeft: 16,
     marginRight: 16,
     borderRadius: 10,
@@ -556,7 +558,7 @@ const styles = StyleSheet.create({
   },
   deleteButton: {
     borderRadius: 4,
-    ...$margin(4, 16, 16),
+    ...$margin(16, 16, 24),
     backgroundColor: '#EA0A2A'
   },
   userTypeView: {