vbea před 2 roky
rodič
revize
7c081c5a96

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

@@ -1,2 +1,2 @@
-#Thu Jun 29 18:18:55 CST 2023
-VERSION_CODE=246
+#Wed Jul 05 19:00:17 CST 2023
+VERSION_CODE=257

+ 2 - 1
Strides-APP/app.json

@@ -1,13 +1,14 @@
 {
   "name": "JuicePlus",
   "displayName": "ChargEco",
-  "versionCode": 240,
+  "versionCode": 242,
   "versionName": "V2.4.0",
   "product": false,
   "debug": true,
   "modules": {
     "i18n": false,
     "bookmarks": true,
+    "codePush": false,
     "notifications": false
   },
   "storeUrl": {

+ 2 - 1
Strides-APP/app/i18n/locales/en.js

@@ -396,7 +396,8 @@ export default {
     notifyPromotionsOffers: "Notify me for promotions and offers",
     refreshInterval: "Refresh interval",
     seconds: "s",
-    showMyLocations: "Always show my locations"
+    showMyLocations: "Always show my locations",
+    moveMyLocations: "Move to my locations when refresh"
   },
   feedback: {
     errFeedbackType: "Please select type of feedback",

+ 2 - 1
Strides-APP/app/i18n/locales/zh-TW.js

@@ -396,7 +396,8 @@
     notifyPromotionsOffers: "促銷和優惠訊息",
     refreshInterval: "刷新時間",
     seconds: "秒",
-    showMyLocations: "顯示當前位置"
+    showMyLocations: "顯示我的位置",
+    moveMyLocations: "刷新時移動到我的位置"
   },
   feedback: {
     errFeedbackType: "請選擇反饋類型",

+ 2 - 1
Strides-APP/app/i18n/locales/zh.js

@@ -396,7 +396,8 @@ export default {
     notifyPromotionsOffers: "促销和优惠信息",
     refreshInterval: "刷新时间",
     seconds: "秒",
-    showMyLocations: "显示当前位置"
+    showMyLocations: "显示我的位置",
+    moveMyLocations: "刷新时移动到我的位置"
   },
   feedback: {
     errFeedbackType: "请选择反馈类型",

+ 12 - 1
Strides-APP/app/pages/Settings.js

@@ -13,7 +13,7 @@ import routeUtil from '../utils/routeUtil';
 import storage, { getStorage, setStorage } from '../utils/storage';
 import app from '../../app.json';
 
-export const SETTINGS_KEY = 'CHARGE_SETTINGS'
+export const SETTINGS_KEY = 'CHARGE_SETTINGS_V2'
 export const SettingUtil = {
   getSettings: (back) => {
     if (!global.settingsInfo) {
@@ -25,6 +25,7 @@ export const SettingUtil = {
         } else {
           back({
             alwaysLocation: true,
+            moveMyLocation: true,
             refreshInterval: 10
           })
         }
@@ -41,6 +42,7 @@ export default class Settings extends Component {
     this.state = {
       settings: {
         alwaysLocation: true,
+        moveMyLocation: true,
         refreshInterval: undefined
       },
       userInfo: {
@@ -214,6 +216,15 @@ export default class Settings extends Component {
             value={this.state.settings.alwaysLocation}
             onValueChange={v => this.changeSwitch('alwaysLocation', v)}/>
         </Button>
+        <Button
+          style={styles.itemButton}
+          viewStyle={styles.itemView}
+          onClick={() => this.changeSwitch('moveMyLocation', !this.state.settings.moveMyLocation)}>
+          <Text style={styles.buttonText}>{$t('settings.moveMyLocations')}</Text>
+          <Switch
+            value={this.state.settings.moveMyLocation}
+            onValueChange={v => this.changeSwitch('moveMyLocation', v)}/>
+        </Button>
         <View style={styles.menuView}>
           <Text style={styles.buttonText}>{$t('settings.autoRefreshInterval')}</Text>
           <Dropdown

+ 2 - 2
Strides-APP/app/pages/home/Drawer.js

@@ -315,7 +315,7 @@ const DrawerContent = ({isLogin, userInfo, onLogout, navigation}) => {
       }
 
       {/*附加功能-开始*/}
-      { app.modules.notifications &&
+      { (app.modules.notifications && isLogin) &&
         <Button
           style={styles.itemButton}
           viewStyle={styles.itemView}
@@ -330,7 +330,7 @@ const DrawerContent = ({isLogin, userInfo, onLogout, navigation}) => {
           <Text style={styles.label}>{$t('route.bookmarks')}</Text>
         </Button>
       }
-      { app.modules.bookmarks &&
+      { (app.modules.bookmarks && isLogin) &&
         <Button
           style={styles.itemButton}
           viewStyle={styles.itemView}

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

@@ -239,7 +239,7 @@ export default class HomePage extends Component {
         if (first || time - this.refreshTime > interval) { //一分钟(10秒)加载一次
           this.getStationList(region, first);
           this.refreshTime = time;
-        } else if (this.settingInfo.alwaysLocation) {
+        } else if (this.settingInfo.moveMyLocation) {
           this.setState({
             region: region
           });
@@ -289,7 +289,8 @@ export default class HomePage extends Component {
             siteType: item.siteType,
             latitude: item.locationLatitude,
             longitude: item.locationLongitude,
-            favorite: item.favorite,
+            favorite: item?.favorite ? true : false,
+            upcoming: false
             /*acConnector: item.acConnector,
             allConnector: item.allConnector,
             dcConnector: item.dcConnector,
@@ -300,7 +301,7 @@ export default class HomePage extends Component {
           stopList: list
         });
         //this.viewChargeStation(list[0].id) //测试显示站点
-        if (region && (this.settingInfo.alwaysLocation || first)) {
+        if (region && (this.settingInfo.moveMyLocation || first)) {
           setTimeout(() => {
             this.setState({
               region: region

+ 3 - 3
Strides-APP/app/pages/home/maps/Maps3.js

@@ -8,7 +8,7 @@ import MapView from "react-native-map-clustering";
 import { MyCluster, MyMarker } from './Cluster';
 import VbeClusterMap from 'vbe-cluster-map'
 
-export default Maps3 = ({ region, onMapReady, stopList, onMarkerPress }) => {
+export default Maps3 = ({ region, onMapReady, stopList, showUserLocation=true, onMarkerPress }) => {
   const mapRef = useRef();
   const superClusterRef = useRef();
 
@@ -82,7 +82,7 @@ export default Maps3 = ({ region, onMapReady, stopList, onMarkerPress }) => {
       nodeSize={64}
       provider={PROVIDER_GOOGLE}
       onMapReady={onMapReady}
-      showsUserLocation={true}
+      showsUserLocation={showUserLocation}
       initialRegion={region}
       renderCluster={(info) => renderCluster(info)}>
       { stopList.map((marker, index) => {
@@ -104,7 +104,7 @@ export default Maps3 = ({ region, onMapReady, stopList, onMarkerPress }) => {
       animation={true}
       onMapReady={onMapReady}
       onMarkerPress={e => onMarkerPress(e.id)}
-      showUserLocation={true}
+      showUserLocation={showUserLocation}
       moveOnMarkerPress={true}
     />
   );

+ 1 - 0
Strides-APP/app/pages/home/maps/Test.js

@@ -50,6 +50,7 @@ export default class Test extends Component {
             available: available,
             latitude: item.locationLatitude,
             longitude: item.locationLongitude,
+            favorite: item?.favorite ? true : false,
             /*acConnector: item.acConnector,
             allConnector: item.allConnector,
             dcConnector: item.dcConnector,*/

+ 1 - 1
Strides-APP/index.js

@@ -70,7 +70,7 @@ class Index extends Component {
   }
 };
 
-if (app.codePush) {
+if (app.modules.codePush) {
   //热更新配置
   let codePushOptions = {
     updateDialog: false,

+ 1 - 1
Strides-APP/package.json

@@ -46,7 +46,7 @@
     "react-native-device-info": "^8.3.1",
     "react-native-gesture-handler": "^1.10.3",
     "react-native-gradients": "^1.1.1",
-    "react-native-i18n": "^2.0.15",
+    "react-native-i18n": "https://gitee.com/vbes/react-native-i18n.git",
     "react-native-image-crop-picker": "^0.36.2",
     "react-native-map-clustering": "^3.4.2",
     "react-native-map-link": "^2.7.27",