Jelajahi Sumber

add RefundPolicy

vbea 2 tahun lalu
induk
melakukan
c71575a017

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

@@ -1,2 +1,2 @@
-#Mon Sep 11 14:51:22 CST 2023
-VERSION_CODE=316
+#Mon Sep 11 18:07:42 CST 2023
+VERSION_CODE=318

+ 3 - 2
Strides-APP/app.json

@@ -1,7 +1,7 @@
 {
   "name": "Strides",
   "displayName": "ChargEco",
-  "versionCode": 310,
+  "versionCode": 320,
   "versionName": "V3.0.0",
   "product": false,
   "debug": true,
@@ -19,6 +19,7 @@
   },
   "storeUrl": {
     "android": "market://details?id=com.strides.chargeco",
-    "ios": "itms-appss://apps.apple.com/app/id1664718768"
+    "ios": "itms-appss://apps.apple.com/app/id1664718768",
+    "refundUrl": "https://uat.chargeco.global/RefundPolicy.html"
   }
 }

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

@@ -76,7 +76,8 @@ export default {
     topUpWithCard: "Top Up with Card",
     wallet: "Transactions",
     applyMember: "Apply Membership",
-    yourMembers: "Your Membership"
+    yourMembers: "Your Membership",
+    refundPolicy: "Refund Policy"
   },
   sign: {
     aConfirmationEmailTo: "a confirmation email has been sent to",
@@ -241,7 +242,7 @@ export default {
     chooseConnector: "Choose Connector",
     chooseRate: "Choose Rate",
     comfirmCancleReservation: "Are you sure you want to cancle reservation?",
-    confirmStopCharging: "Are you sure stop charging?",
+    confirmStopCharging: "Confirm stop charging?",
     dcChargers: "DC Chargers",
     enterStationId: "Enter Station ID",
     errAuthenticationError: "There seems to be an authentication error! Please try again",

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

@@ -76,7 +76,8 @@
     topUpWithCard: "使用信用卡充值",
     wallet: "我的餘額",
     applyMember: "申請會員",
-    yourMembers: "我的會員"
+    yourMembers: "我的會員",
+    refundPolicy: "退款政策"
   },
   sign: {
     aConfirmationEmailTo: "我們已向以下信箱發送壹封確認電子郵件",

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

@@ -76,7 +76,8 @@ export default {
     topUpWithCard: "使用信用卡充值",
     wallet: "我的余额",
     applyMember: "申请会员",
-    yourMembers: "我的会员"
+    yourMembers: "我的会员",
+    refundPolicy: "退款政策"
   },
   sign: {
     aConfirmationEmailTo: "我们已向以下邮箱发送一封确认电子邮件",

+ 6 - 0
Strides-APP/app/pages/Router.js

@@ -59,6 +59,7 @@ import Contact from './about/Contact';
 import Notification from './alert/Notification';
 import Message from './alert/Message';
 import Campaign from './alert/Campaign';
+import RefundPolicy from './payment/RefundPolicy';
 
 export var PageList = {
   'splash': {
@@ -317,6 +318,11 @@ export var PageList = {
     titleScope: 'route.applyMember',
     component: ApplyMember
   },
+  'refundPolicy': {
+    title: "Refund Policy",
+    titleScope: 'route.refundPolicy',
+    component: RefundPolicy
+  },
   'settings': {
     title: 'Settings',
     titleScope: 'route.settings',

+ 1 - 1
Strides-APP/app/pages/chargeV2/ChargeAdapter.js

@@ -42,7 +42,7 @@ export default class ChargeAdapter extends Component {
       title: $t('charging.tabCharge'),
       name: "Charge",
       component: Charge
-    }/*, {
+    }, {
       title: $t('charging.tabReserve'),
       name: "Reserve",
       component: Reserve

+ 31 - 17
Strides-APP/app/pages/chargeV2/TabReserve.js

@@ -3,7 +3,7 @@
  * @邠心vbe on 2023/02/06
  */
  import React, { Component } from 'react'
- import { Image, StyleSheet, Text, View } from 'react-native'
+ import { Image, RefreshControl, ScrollView, StyleSheet, Text, View } from 'react-native'
  import Button from '../../components/Button';
  import { ChargeStyle, EnterStationDialog, TypeImage } from './Charging';
  import apiCharge from '../../api/apiCharge';
@@ -13,6 +13,7 @@
 import PagerUtil from './PagerUtil';
 import BadgeSelectItem from '../../components/BadgeSelectItem';
 import TextView from '../../components/TextView';
+import { MyRefreshProps } from '../../components/ThemesConfig';
 
 export default class TabReserve extends Component {
   constructor(props) {
@@ -20,7 +21,7 @@ export default class TabReserve extends Component {
     this.state = {
       total: 0,
       leftId: 0,
-      refreshId: 0,
+      refreshing: false,
       checkIndex: -1,
       available: false,
       showReserve: false,
@@ -41,10 +42,18 @@ export default class TabReserve extends Component {
   onRefresh() {
     console.log("Reserve刷新", this.props.route.name);
     this.setState({
+      refreshing: false,
       stationInfo: PagerUtil.getStationInfo()
     }, () => this.init());
   }
 
+  onPullRefresh() {
+    this.setState({
+      refreshing: true
+    })
+    PagerUtil.setBackRefreshing();
+  }
+
   init() {
     this.stopCountdown(true);
     if (this.state.stationInfo.rateList && this.state.stationInfo.rateList.length > 0) {
@@ -248,21 +257,26 @@ export default class TabReserve extends Component {
 
   render() {
     return (
-      <View
-        style={{
-          paddingLeft: 16,
-          paddingRight: 16,
-          ...this.props.style
-        }}>
+      <ScrollView
+        style={ui.flex1}
+        keyboardShouldPersistTaps={'handled'}
+        contentContainerStyle={$padding(0, 16)}
+        refreshControl={
+          <RefreshControl
+            {...MyRefreshProps()}
+            refreshing={this.state.refreshing}
+            onRefresh={() => this.onPullRefresh()}
+          />
+        }>
         { this.state.showReserve
-          ? (
-            this.state.userReserve.reservePk
-              ? this.countdownView()
-              : this.reserveView()
-            )
-          : <View style={[{height: $vh(50)}, ui.flexvc]}>
-              <TextView style={{color: textPrimary, fontSize: 14}}>{$t('charging.unallowReservation')}</TextView>
-            </View>
+        ? (
+          this.state.userReserve.reservePk
+            ? this.countdownView()
+            : this.reserveView()
+          )
+        : <View style={[{height: $vh(50)}, ui.flexvc]}>
+            <TextView style={{color: textPrimary, fontSize: 14}}>{$t('charging.unallowReservation')}</TextView>
+          </View>
         }
         <CancelReserveDialog
           visible={this.state.showCancelDialog}
@@ -284,7 +298,7 @@ export default class TabReserve extends Component {
             });
           }}
         />
-      </View>
+      </ScrollView>
     );
   }
 

+ 13 - 0
Strides-APP/app/pages/payment/RefundPolicy.js

@@ -0,0 +1,13 @@
+/**
+ * 退款条款页面
+ * @邠心vbe on 2023/09/1
+ */
+import React from 'react';
+import WebView from 'react-native-webview';
+import app from '../../../app.json';
+ 
+export default RefundPrivacy = () => {
+  return (
+    <WebView source={{uri: app.storeUrl.refundUrl}}/>
+  )
+}

+ 1 - 1
Strides-APP/app/pages/search/ListViewV2.js

@@ -18,7 +18,7 @@ export default ListViewV2 = ({item, index, separators, onPress, onFavorite}) =>
         style={styles.itemView}
         viewStyle={styles.itemContent}
         key={index}
-        onPress={onPress}
+        onClick={onPress}
         android_ripple={ripple}>
         {/* <Ionicons
           name="md-location-sharp"

+ 50 - 1
Strides-APP/app/pages/wallet/TopupNew.js

@@ -3,7 +3,7 @@
  * @邠心vbe on 2023/02/02
  */
 import React, { Component } from 'react';
-import { View, Text, ScrollView, StyleSheet, Switch } from 'react-native';
+import { View, Text, StyleSheet, Switch } from 'react-native';
 import apiWallet from '../../api/apiWallet';
 import BadgeSelectItem from '../../components/BadgeSelectItem';
 import Button, { ElevationObject } from '../../components/Button';
@@ -14,6 +14,8 @@ import { PageList } from '../Router';
 import { Balance } from './Payment';
 import TopupPaythod from './TopupPaythod';
 import app from '../../../app.json';
+import utils from '../../utils/utils';
+import CheckBox from '../../components/CheckBox';
 
 export default class TopupNew extends Component {
   constructor(props) {
@@ -24,6 +26,7 @@ export default class TopupNew extends Component {
       selectIndex: 0,
       payType: {},
       balance: 0,
+      agree: true
     };
   }
 
@@ -117,6 +120,12 @@ export default class TopupNew extends Component {
     }
   }
 
+  changeAgree(ag) {
+    this.setState({
+      agree: ag
+    })
+  }
+
   render() {
     return (
       <View style={styles.container}>
@@ -184,10 +193,27 @@ export default class TopupNew extends Component {
           }
         </View>
         <View style={ui.flex1}></View>
+        { utils.isNotEmpty(app.storeUrl.refundUrl) &&
+          <View style={styles.agreeView}>
+            <CheckBox
+              value={this.state.agree}
+              onTintColor={colorAccent}
+              onCheckColor={colorAccent}
+              onValueChange={v => this.changeAgree(v)}
+            />
+            <View style={styles.agreeTextRow}>
+              <TextView style={styles.agreeText} onPress={() => this.changeAgree(!this.state.agree)}>
+                {$t('sign.iHaveReadAndAgree')}
+              </TextView>
+              <TextView style={styles.agreeLink} onPress={() => startPage(PageList.refundPolicy)}>Refund Policy</TextView>
+            </View>
+          </View>
+        }
         <View style={styles.buttonView}>
           <Button
             text={$t('wallet.btnPurchase')}
             elevation={1.5}
+            disabled={!this.state.agree}
             onClick={() => {
               PaymentDefault.is2c2p 
               ? this.topup2()
@@ -306,5 +332,28 @@ const styles = StyleSheet.create({
     padding: 16,
     marginTop: 0,
     marginBottom: 16
+  },
+  agreeView: {
+    margin: 16,
+    flexDirection: 'row',
+    alignItems: 'center',
+  },
+  agreeTextRow: {
+    flex: 1,
+    flexWrap: 'wrap',
+    flexDirection: 'row'
+  },
+  agreeText: {
+    color: textPrimary,
+    fontSize: 14,
+    paddingTop: 4,
+    paddingBottom: 4
+  },
+  agreeLink: {
+    ...ui.link,
+    fontSize: 14,
+    paddingTop: 4,
+    paddingBottom: 4,
+    textDecorationLine: 'underline'
   }
 })