Leon 1 year ago
parent
commit
084bdbb3ac

+ 1 - 1
ios/AppDelegate.mm

@@ -129,7 +129,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
 - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
 {
 //  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
-#if DEBUGaaa
+#if DEBUG
   return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
 #else
   return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

+ 2 - 2
ios/hola.xcodeproj/project.pbxproj

@@ -572,7 +572,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 68;
+				CURRENT_PROJECT_VERSION = 72;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -605,7 +605,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 68;
+				CURRENT_PROJECT_VERSION = 72;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

+ 1 - 1
ios/hola/Info.plist

@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>70</string>
+	<string>72</string>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>LSApplicationCategoryType</key>

File diff suppressed because it is too large
+ 0 - 0
ios/main.jsbundle


+ 1 - 1
src/components/basic/ActionSheet.tsx

@@ -28,7 +28,7 @@ export default function showActionSheet(props: any) {
         };
         var destructiveButtonIndex = -1;
         list.map((item, index) => {
-            if (item == 'Delete' || item == '删除')
+            if (item == 'Delete' || item == '删除'|| item == 'Delete Account'|| item == '注销账号')
                 destructiveButtonIndex = index
         });
         (options as any).destructiveButtonIndex = destructiveButtonIndex

+ 1 - 1
src/components/basic/Alert.tsx

@@ -51,7 +51,7 @@ export default function showAlert(props: any) {
                             props.confirm()
                         }
                     },
-                    // style:'destructive'
+                    style:props.redConfirm?'destructive':'default'
                     // isPreferred:true,
                     // style: "default"
 

+ 8 - 2
src/context/locales/en.js

@@ -350,8 +350,14 @@ export default {
                 logout_title: 'Log out',
                 logout_content: 'Are you sure you want to log out?',
 
-                deluser_title: 'Delete account',
-                deluser_content: 'Are you sure you want to delete this account?',
+                del:'Delete',
+                deluser_title: 'Confirm Deletion of Account',
+                deluser_content: 'This action cannot be undone.\nAre you sure you want to delete this account?',
+                deluser_cancel:'Cancel',
+                deluser_confirm:'Confirm Deletion',
+                deluser_action_title:'This account will be deleted permanently.',
+                deluser_action_confirm:'Delete Account',
+                deluser_action_cancel:'Cancel',
 
                 reset_session_title: 'Reset session',
                 reset_session_content: 'Are you sure you want to reset the session?'

+ 8 - 2
src/context/locales/zh.js

@@ -349,9 +349,15 @@ export default {
                 logout_title: '退出登录',
                 logout_content: '确定退出登录吗?',
 
+                del:'注销',
+                deluser_title: '确认注销账号注销',
+                deluser_content: '账号注销后不可恢复。 确定要注销此账号吗?',
+                deluser_cancel:'取消',
+                deluser_confirm:'确认注销',
+                deluser_action_title:'账号将被永久注销。',
+                deluser_action_confirm:'注销账号',
+                deluser_action_cancel:'取消',
 
-                deluser_title: '注销账号',
-                deluser_content: '确定注销此账号吗?',
 
                 reset_session_title: '重置session',
                 reset_session_content: '确认重置session吗?'

+ 47 - 2
src/pages/account/Setting.tsx

@@ -1,3 +1,4 @@
+import showActionSheet from "@/components/basic/ActionSheet";
 import showAlert from "@/components/basic/Alert";
 import Buttons from "@/components/basic/Buttons";
 import Footer from "@/components/layout/Footer";
@@ -14,9 +15,10 @@ import { useEffect } from "react";
 import { useTranslation } from "react-i18next";
 import { useDispatch, useSelector } from "react-redux";
 
-let useNavigation;
+let useNavigation,useActionSheet;
 if (process.env.TARO_ENV == 'rn') {
     useNavigation = require("@react-navigation/native").useNavigation
+    useActionSheet = require('@expo/react-native-action-sheet').useActionSheet
 }
 
 let hasCache = false;
@@ -25,6 +27,10 @@ export default function Page() {
     const dispatch = useDispatch();
     const { t } = useTranslation()
     const user = useSelector((state: any) => state.user);
+    let showActionSheetWithOptions;
+    if (process.env.TARO_ENV == 'rn') {
+        showActionSheetWithOptions = useActionSheet()
+    }
     let navigation;
     if (useNavigation) {
         navigation = useNavigation()
@@ -103,6 +109,40 @@ export default function Page() {
 
     }
 
+    function del(){
+        showActionSheet({
+            title:t('feature.common.modal.deluser_action_title'),
+            showActionSheetWithOptions: showActionSheetWithOptions,
+            itemList: [t('feature.common.modal.deluser_action_confirm')],
+            success: (res) => {
+                switch (res) {
+                    case 0:
+                        {
+                            showAlert({
+                                title: t('feature.common.modal.deluser_title'),
+                                content: t('feature.common.modal.deluser_content'),
+                                showCancel: true,
+                                cancelText:t('feature.common.modal.deluser_cancel'),
+                                confirmText:t('feature.common.modal.deluser_confirm'),
+                                redConfirm:true,
+                                confirm: () => {
+                                    delUser()
+                                }
+                            })
+                        }
+                        break;
+                }
+            }
+        })
+    }
+
+    function delUser(){
+        dispatch(clear() as any);
+        setTimeout(()=>{
+            navigation.goBack()
+        },1500)
+    }
+
     return <View style={{ color: '#fff', display: 'flex', flexDirection: 'column', flex: 1 }}>
         <View style={{ height: 20 }} />
         <TableCell title={t('page.setting.version')} ><Text style={{ opacity: 0.8, color: '#fff' }}>{process.env.TARO_ENV == 'weapp' ? WX_VERSION : APP_VERSION}</Text></TableCell>
@@ -112,7 +152,12 @@ export default function Page() {
         }
 
         <Footer>
-            <ChooseScenarioBtn title={t('page.setting.logout')} onClick={logoutF} background={ColorType.fast} />
+            <View>
+                <ChooseScenarioBtn title={t('page.setting.logout')} onClick={logoutF} background={ColorType.fast} />
+                <View style={{display:'flex',alignItems:'center',justifyContent:'center',marginTop:20}}>
+                    <Text onClick={del} style={{color:'#fff',opacity:0.4}}>{t('feature.common.modal.del')}</Text>
+                </View>
+            </View>
         </Footer>
         {
             process.env.TARO_ENV == 'rn' && <View style={{ height: 50 }} />

Some files were not shown because too many files changed in this diff