vbea před 3 roky
rodič
revize
c0026ca0b6

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

@@ -3,7 +3,7 @@ apply plugin: 'com.google.gms.google-services'
 
 import com.android.build.OutputFile
 
-def myVersionName = "1.0.4" //★★★★★版本号★★★★★
+def myVersionName = "2.0.0" //★★★★★版本号★★★★★
 /**
  * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  * and bundleReleaseJsAndAssets).

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

@@ -1,2 +1,2 @@
-#Thu Feb 09 11:59:27 CST 2023
-VERSION_CODE=91
+#Thu Feb 09 13:28:17 CST 2023
+VERSION_CODE=95

+ 2 - 2
Strides-APP/app.json

@@ -1,8 +1,8 @@
 {
   "name": "JuicePlus",
   "displayName": "ChargEco",
-  "versionCode": 85,
-  "versionName": "V1.0.4",
+  "versionCode": 90,
+  "versionName": "V2.0.0",
   "product": false,
   "debug": false
 }

+ 0 - 3
Strides-APP/app/pages/home/Home.js

@@ -6,7 +6,6 @@ import React, { Component } from 'react';
 import { View, Text, Pressable, Image, StyleSheet, BackHandler } from 'react-native';
 import {check, request, openSettings, PERMISSIONS, RESULTS} from 'react-native-permissions';
 import apiStation from '../../api/apiStation';
-import Button from '../../components/Button';
 import Dialog from '../../components/Dialog';
 import { Styles } from '../../components/Toolbar';
 import utils from '../../utils/utils';
@@ -14,9 +13,7 @@ import { PageList } from '../Router';
 import { SettingUtil } from '../Settings';
 import BottomSiteInfo from './maps/BottomSiteInfo';
 import Maps from './maps/Maps';
-import MapTool from './maps/MapTool';
 import SearchTool from './maps/SearchTool';
-import TopInfo from './maps/TopInfo';
 
 export default class HomePage extends Component {
   constructor(props) {

+ 14 - 11
Strides-APP/app/pages/home/maps/BottomSiteInfo.js

@@ -3,15 +3,14 @@
  * @邠心vbe on 2022/12/23
  */
 import React from 'react';
-import { Pressable, StyleSheet, View, Text, Image } from 'react-native';
+import { Pressable, StyleSheet, View, Text } from 'react-native';
 import { ElevationObject } from '../../../components/Button';
 import utils from '../../../utils/utils';
 import { ChargeStyle } from '../../charge/Charging';
 import { PageList } from '../../Router';
-import { ConnectType } from '../../search/Search';
- 
- 
-export default TopInfo = ({stationInfo = {}}) => {
+import ConnectType from '../../search/ConnectType';
+
+export default BottomSiteInfo = ({stationInfo = {}}) => {
   const getAvailable = (type) => {
     const all = stationInfo.allConnector;
     if (all) {
@@ -45,6 +44,10 @@ export default TopInfo = ({stationInfo = {}}) => {
     }
   }
 
+  const toChargePage = () => {
+    startPage(PageList.chargeDetailPage, {stationInfo: stationInfo, action: 'view', from: PageList.home})
+  }
+
   if (stationInfo.id) {
     return (
       <View style={styles.stationBarView}>
@@ -52,7 +55,7 @@ export default TopInfo = ({stationInfo = {}}) => {
           <Pressable
             style={styles.stationInfo}
             //onPress={() => startPage(PageList.chargeDetail, {stationInfo: stationInfo, action: 'view'})}}
-            onPress={() => startPage(PageList.chargeDetailPage, {stationInfo: stationInfo, action: 'view', from: PageList.home})}>
+            onPress={toChargePage}>
             <Text
               ellipsizeMode='tail'
               numberOfLines={1}
@@ -88,11 +91,11 @@ export default TopInfo = ({stationInfo = {}}) => {
         </View>
         <View style={ui.flex}>
           <View style={styles.connectView}>
-            <ConnectType {...stationInfo.acConnector}/>
-            <ConnectType {...stationInfo.dcConnector}/>
+            <ConnectType {...stationInfo?.acConnector}/>
+            <ConnectType {...stationInfo?.dcConnector}/>
           </View>
           <View style={styles.stationStatusView}>
-            { stationInfo.allConnector && stationInfo.allConnector.available > 0 &&
+            { (stationInfo.allConnector && stationInfo.allConnector.available > 0) &&
               <Text style={[ChargeStyle.infoStatus, ChargeStyle.statusAvailable, styles.stationStatus]}>Available</Text>
             }
             <Text style={[ChargeStyle.infoStatus, stationInfo.siteType == 'Public' ? ChargeStyle.statusAvailable : ChargeStyle.statusWarning, styles.siteTypes]}>{stationInfo.siteType}</Text>
@@ -101,7 +104,7 @@ export default TopInfo = ({stationInfo = {}}) => {
         <View style={styles.divideLine}></View>
         <Pressable
           style={styles.infoDetailsView}
-          onPress={() => startPage(PageList.chargeDetailPage, {stationInfo: stationInfo, action: 'view', from: PageList.home})}>
+          onPress={toChargePage}>
           <View style={ui.flex1}>
             <Text style={styles.infoTitle}>Operating Hours</Text>
             <View style={styles.infoView}>
@@ -119,7 +122,7 @@ export default TopInfo = ({stationInfo = {}}) => {
           <View style={ui.flex1}>
             <Text style={styles.infoTitle}>Additional Info</Text>
             <View style={styles.infoView}>
-              <Text style={styles.infoText}>{stationInfo.additionalNotes}</Text>
+              <Text style={styles.infoText}>{stationInfo?.additionalNotes}</Text>
             </View>
           </View>
         </Pressable>

+ 35 - 5
Strides-APP/app/pages/wallet/Overview.js

@@ -82,14 +82,14 @@ export default class Overview extends Component {
             item.y0 = 0;
             item.label = currency + item.y;
             item.title = item.x + ' | ' + item.label + ' | ' + item.power + 'kw';
-            if (this.enableChartArea) {
+            /*if (this.enableChartArea) {
               if (index == 0) {
                 item.label = "     " + currency + item.y
               } else if (index == res.data.pastSixMonths.length - 1) {
                 item.label = currency + item.y + "     "
               }
-              item.y += (item.y * 10 + 5);
-            }
+              //item.y += (item.y * 10 + 5);
+            }*/
             monthData.push(item);
           });
         }
@@ -127,7 +127,17 @@ export default class Overview extends Component {
     },
     labels: {
       fontSize: 12,
-      fill: ({index}) => (index == active ? "#000" : "#555")
+      fill: ({index}) => (index == active ? "#000" : textSecondary)
+    }
+  })
+
+  barSpacesTheme = () => ({
+    data: { 
+      fill: "transparent",
+    },
+    labels: {
+      fontSize: 12,
+      fill: textSecondary
     }
   })
 
@@ -140,7 +150,7 @@ export default class Overview extends Component {
       strokeWidth: 1
     },
     labels: {
-      fontSize: 10,
+      fontSize: 0,
       fill: textSecondary
     }
   })
@@ -260,6 +270,26 @@ export default class Overview extends Component {
                         labels={({ datum }) => datum.y}
                         labelComponent={<VictoryLabel dy={10}/>}
                       />
+                      <VictoryBar
+                        barWidth={28}
+                        data={this.state.monthData}
+                        style={this.barSpacesTheme()}
+                        events={[{
+                          target: "data",
+                          eventHandlers: {
+                            onPress: () => {
+                              return [{
+                                target: "data",
+                                mutation: (props) => {
+                                  this.setState({
+                                    monthIndex: props.index
+                                  });
+                                }
+                              }];
+                            }
+                          }
+                        }]}
+                      />
                     </VictoryChart>
                   }
                 </Svg>