Quellcode durchsuchen

add new feature

vbea vor 2 Jahren
Ursprung
Commit
ff013c061f

+ 2 - 2
Strides-APP/app/pages/charging/StepStartView.js

@@ -7,9 +7,9 @@ import { Image, StyleSheet, Text, View } from 'react-native';
 import Button from '../../components/Button';
 import { ChargeStyle, TypeImage } from '../chargeV2/Charging';
 import { PageList } from '../Router';
-import app from '../../../app.json';
 import TextView from '../../components/TextView';
 
+const hideTaxRates = true; //隐藏税率显示
 export default StepStartView = ({
   isPrivate,
   stationInfo={},
@@ -19,7 +19,7 @@ export default StepStartView = ({
 }) => (
   <View>
     <View style={{minHeight: $vht(80)}}>
-      <TextView style={styles.gstText}>{app.modules.nationally ? $t('charging.tipsRatesTax2') : $t('charging.tipsRatesTax')}</TextView>
+      <TextView style={styles.gstText}>{hideTaxRates ? $t('charging.tipsRatesTax2') : $t('charging.tipsRatesTax')}</TextView>
       <TextView style={styles.title}>{$t('charging.acChargers')} ({(stationInfo?.acConnector?.available ?? "0") + $t('charging.numberAvailable')})</TextView>
       { stationInfo.acRates?.length > 0
         ? stationInfo.acRates.map((item, index) => {

+ 14 - 9
Strides-APP/app/pages/chargingV2/StepCharging.js

@@ -3,7 +3,8 @@
  * @邠心vbe on 2023/06/20
  */
 import React, { useEffect, useRef, useState } from 'react';
-import { Animated, Easing, Image, ScrollView, StyleSheet, Text, View } from 'react-native';
+import { Animated, Easing, Image, ScrollView, StyleSheet, View } from 'react-native';
+import app from '../../../app.json';
 import Button, { ElevationObject } from '../../components/Button';
 import TextView from '../../components/TextView';
 import utils from '../../utils/utils';
@@ -132,10 +133,12 @@ const StepCharging = ({
               numberOfLines={2}
               ellipsizeMode="tail"
               style={styles.infoText}>{connectorInfo.rates || "S$0.00/kWh"}</TextView>
-            <TextView
-              numberOfLines={1}
-              ellipsizeMode="tail"
-              style={styles.infoDesc}>({connectorInfo.userRates || "S$0.00/kWh"})</TextView>
+            { app.modules.nationally && (
+              <TextView
+                numberOfLines={1}
+                ellipsizeMode="tail"
+                style={styles.infoDesc}>({connectorInfo.userRates || "S$0.00/kWh"})</TextView>)
+            }
           </View>
           <View style={skipAnim ? styles.infoCarded : styles.infoCard}>
             <TextView style={styles.infoTitle}>{$t('charging.labelTotalCharges')}</TextView>
@@ -143,10 +146,12 @@ const StepCharging = ({
               numberOfLines={2}
               ellipsizeMode="tail"
               style={styles.infoText}>{connectorInfo.totalCharges || "S$ 0.0"}</TextView>
-            <TextView
-              numberOfLines={1}
-              ellipsizeMode="tail"
-              style={styles.infoDesc}>({connectorInfo.userTotalCharges || "S$ 0.0"})</TextView>
+            { app.modules.nationally && (
+              <TextView
+                numberOfLines={1}
+                ellipsizeMode="tail"
+                style={styles.infoDesc}>({connectorInfo.userTotalCharges || "S$ 0.0"})</TextView>)
+            }
           </View>
         </View>
       </Animated.View>

+ 8 - 5
Strides-APP/app/pages/chargingV2/StepStart.js

@@ -3,7 +3,8 @@
  * @邠心vbe on 2023/06/20
  */
 import React from 'react';
-import { View, Text, Image, StyleSheet, ScrollView } from 'react-native';
+import { View, Image, StyleSheet, ScrollView } from 'react-native';
+import app from '../../../app.json';
 import Button, { ElevationObject } from '../../components/Button';
 import TextView from '../../components/TextView';
 import { ChargeStyle } from '../chargeV2/Charging';
@@ -57,10 +58,12 @@ export default StepStart = ({
             numberOfLines={2}
             ellipsizeMode="tail"
             style={styles.infoText}>{connectorInfo.rates || "S$0.00/kWh"}</TextView>
-          <TextView
-            numberOfLines={1}
-            ellipsizeMode="tail"
-            style={styles.infoDesc}>({connectorInfo.userRates || "S$0.00/kWh"})</TextView>
+          { app.modules.nationally && (
+            <TextView
+              numberOfLines={1}
+              ellipsizeMode="tail"
+              style={styles.infoDesc}>({connectorInfo.userRates || "S$0.00/kWh"})</TextView>)
+          }
         </View>
         <View style={styles.infoCard}>
           <TextView style={styles.infoTitle}>{$t('charging.labelStatus')}</TextView>

+ 5 - 19
Strides-APP/index.js

@@ -12,14 +12,12 @@ import './app/utils/notification';
 import './app/utils/vector_icon';
 import Router from './app/pages/Router';
 import app from './app.json';
-//import {ModalPortal} from 'react-native-modals';
 import ModalPortal from './app/components/ModalPortal';
 import {RootSiblingParent} from 'react-native-root-siblings';
 import { SafeAreaView } from 'react-native-safe-area-context';
 import MyStatusBar from './app/components/MyStatusBar';
 import { i18nUtil } from './app/i18n';
 
-//let context;
 class Index extends Component {
   constructor(props) {
     super(props);
@@ -27,7 +25,6 @@ class Index extends Component {
       visible: false,
       refreshTime: 0
     }
-    //context = this;
   }
 
   componentDidMount() {
@@ -38,17 +35,6 @@ class Index extends Component {
     })
   }
 
-  /*restartApp() {
-    console.log("----------------RESTART-----------------");
-    this.setState({
-      visible:false
-    }, () => {
-      this.setState({
-        visible: true
-      })
-    })
-  }*/
-
   render() {
     return (
       <RootSiblingParent>
@@ -62,14 +48,16 @@ class Index extends Component {
           : <></>
         }
         <ModalPortal />
-        { isIOS &&
-          <SafeAreaView style={{flex: 0, backgroundColor: colorLight}}></SafeAreaView>
+        { isIOS && (
+          <SafeAreaView style={{flex: 0, backgroundColor: colorLight}}></SafeAreaView>)
         }
       </RootSiblingParent>
     );
   }
 };
 
+AppRegistry.registerComponent(app.name, () => Index);
+
 /*if (app.modules.codePush ) {
   //热更新配置
   let codePushOptions = {
@@ -81,7 +69,5 @@ class Index extends Component {
     //下次进入安装
     //installMode: codePush.InstallMode.ON_NEXT_RESTART
   };
-
   AppRegistry.registerComponent(app.name, () => codePush(codePushOptions)(Index));
-}*/
-AppRegistry.registerComponent(app.name, () => Index);
+}*/