|
|
@@ -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 }} />
|