Compare commits
No commits in common. "96922cb4cf0166a6532d1323dc0ba473fae58673" and "128175339b2f09562da540a09aa782fbb8c9c70a" have entirely different histories.
96922cb4cf
...
128175339b
10
app.json
10
app.json
@ -11,9 +11,9 @@
|
|||||||
"ios": {
|
"ios": {
|
||||||
"supportsTablet": true,
|
"supportsTablet": true,
|
||||||
"infoPlist": {
|
"infoPlist": {
|
||||||
"NSPhotoLibraryUsageDescription": "允许访问照片库,以便模型使用您照片库中的素材进行视频创作”(例如:上传您参加音乐节的现场图,生成一个音乐节体验Vlog",
|
"NSPhotoLibraryUsageDescription": "Allow $(PRODUCT_NAME) to access your photos.",
|
||||||
"NSPhotoLibraryAddUsageDescription": "需要保存图片到相册",
|
"NSPhotoLibraryAddUsageDescription": "需要保存图片到相册",
|
||||||
"NSLocationWhenInUseUsageDescription": "允许获取位置信息,以便模型使用您的位置信息进行个性化创作”(例如:上传您去欧洲旅游的位置信息,结合在当地拍摄的照片,生成一个欧洲旅行攻略Vlog)",
|
"NSLocationWhenInUseUsageDescription": "Allow $(PRODUCT_NAME) to access your location to get photo location data.",
|
||||||
"ITSAppUsesNonExemptEncryption": false,
|
"ITSAppUsesNonExemptEncryption": false,
|
||||||
"UIBackgroundModes": [
|
"UIBackgroundModes": [
|
||||||
"fetch"
|
"fetch"
|
||||||
@ -61,7 +61,7 @@
|
|||||||
[
|
[
|
||||||
"expo-location",
|
"expo-location",
|
||||||
{
|
{
|
||||||
"locationWhenInUsePermission": "允许获取位置信息,以便模型使用您的位置信息进行个性化创作”(例如:上传您去欧洲旅游的位置信息,结合在当地拍摄的照片,生成一个欧洲旅行攻略Vlog)"
|
"locationWhenInUsePermission": "允许 $(PRODUCT_NAME) 访问您的位置"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -73,8 +73,8 @@
|
|||||||
[
|
[
|
||||||
"expo-media-library",
|
"expo-media-library",
|
||||||
{
|
{
|
||||||
"photosPermission": "允许访问照片库,以便模型使用您照片库中的素材进行视频创作”(例如:上传您参加音乐节的现场图,生成一个音乐节体验Vlog",
|
"photosPermission": "Allow $(PRODUCT_NAME) to access your photos.",
|
||||||
"savePhotosPermission": "允许访问照片库,以便模型使用您照片库中的素材进行视频创作”(例如:上传您参加音乐节的现场图,生成一个音乐节体验Vlog",
|
"savePhotosPermission": "Allow $(PRODUCT_NAME) to save photos.",
|
||||||
"isAccessMediaLocationEnabled": true
|
"isAccessMediaLocationEnabled": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -52,6 +52,10 @@ const LoginScreen = () => {
|
|||||||
router.setParams({ [key]: value });
|
router.setParams({ [key]: value });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// setError('123')
|
||||||
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
style={{ flex: 1 }}
|
style={{ flex: 1 }}
|
||||||
|
|||||||
@ -1,204 +0,0 @@
|
|||||||
import { useAuth } from '@/contexts/auth-context';
|
|
||||||
import { fetchApi } from '@/lib/server-api-util';
|
|
||||||
import { useRouter } from 'expo-router';
|
|
||||||
import React from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { Modal, Pressable, StyleSheet, View } from 'react-native';
|
|
||||||
import { ThemedText } from '../ThemedText';
|
|
||||||
|
|
||||||
const DeleteModal = (props: { modalVisible: boolean, setModalVisible: (visible: boolean) => void, setSettingModalVisible: (visible: boolean) => void }) => {
|
|
||||||
const { modalVisible, setModalVisible, setSettingModalVisible } = props;
|
|
||||||
const { logout } = useAuth();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const router = useRouter();
|
|
||||||
// 注销账号
|
|
||||||
const handleDeleteAccount = () => {
|
|
||||||
fetchApi("/iam/delete-user", {
|
|
||||||
method: "DELETE",
|
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.then(async (res) => {
|
|
||||||
await logout();
|
|
||||||
setModalVisible(false);
|
|
||||||
setSettingModalVisible(false);
|
|
||||||
router.replace('/login');
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
console.error("jwt has expired.");
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Modal
|
|
||||||
animationType="fade"
|
|
||||||
transparent={true}
|
|
||||||
visible={modalVisible}
|
|
||||||
onRequestClose={() => setModalVisible(false)}
|
|
||||||
>
|
|
||||||
<View style={styles.centeredView}>
|
|
||||||
<View style={styles.modalView}>
|
|
||||||
<ThemedText style={styles.modalTitle}>
|
|
||||||
{t("generalSetting.delete", { ns: "personal" })}
|
|
||||||
</ThemedText>
|
|
||||||
<View style={styles.buttonContainer}>
|
|
||||||
<Pressable
|
|
||||||
style={[styles.button, styles.cancelButton]}
|
|
||||||
onPress={() => setModalVisible(false)}
|
|
||||||
>
|
|
||||||
<ThemedText style={styles.cancelButtonText}>
|
|
||||||
{t("generalSetting.cancel", { ns: "personal" })}
|
|
||||||
</ThemedText>
|
|
||||||
</Pressable>
|
|
||||||
<Pressable
|
|
||||||
style={[styles.button, styles.deleteButton]}
|
|
||||||
onPress={handleDeleteAccount}
|
|
||||||
>
|
|
||||||
<ThemedText style={styles.deleteButtonText}>
|
|
||||||
{t("generalSetting.deleteAccount", { ns: "personal" })}
|
|
||||||
</ThemedText>
|
|
||||||
</Pressable>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</Modal>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
centeredView: {
|
|
||||||
flex: 1,
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
||||||
},
|
|
||||||
modalView: {
|
|
||||||
width: '80%',
|
|
||||||
backgroundColor: 'white',
|
|
||||||
borderRadius: 16,
|
|
||||||
padding: 24,
|
|
||||||
alignItems: 'center',
|
|
||||||
shadowColor: '#000',
|
|
||||||
shadowOffset: {
|
|
||||||
width: 0,
|
|
||||||
height: 2,
|
|
||||||
},
|
|
||||||
shadowOpacity: 0.25,
|
|
||||||
shadowRadius: 4,
|
|
||||||
elevation: 5,
|
|
||||||
marginBottom: 20,
|
|
||||||
},
|
|
||||||
buttonContainer: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
width: '100%',
|
|
||||||
marginTop: 20,
|
|
||||||
},
|
|
||||||
button: {
|
|
||||||
borderRadius: 20,
|
|
||||||
paddingVertical: 12,
|
|
||||||
paddingHorizontal: 20,
|
|
||||||
elevation: 2,
|
|
||||||
minWidth: 100,
|
|
||||||
alignItems: 'center',
|
|
||||||
},
|
|
||||||
cancelButton: {
|
|
||||||
backgroundColor: '#F5F5F5',
|
|
||||||
marginRight: 12,
|
|
||||||
},
|
|
||||||
deleteButton: {
|
|
||||||
backgroundColor: '#E2793F',
|
|
||||||
},
|
|
||||||
cancelButtonText: {
|
|
||||||
color: '#4C320C',
|
|
||||||
fontWeight: '600',
|
|
||||||
},
|
|
||||||
deleteButtonText: {
|
|
||||||
color: 'white',
|
|
||||||
fontWeight: '600',
|
|
||||||
},
|
|
||||||
modalTitle: {
|
|
||||||
fontSize: 20,
|
|
||||||
fontWeight: 'bold',
|
|
||||||
color: '#4C320C',
|
|
||||||
},
|
|
||||||
closeButton: {
|
|
||||||
fontSize: 28,
|
|
||||||
color: '#4C320C',
|
|
||||||
padding: 10,
|
|
||||||
},
|
|
||||||
modalContent: {
|
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
modalText: {
|
|
||||||
fontSize: 16,
|
|
||||||
color: '#4C320C',
|
|
||||||
},
|
|
||||||
premium: {
|
|
||||||
backgroundColor: "#FAF9F6",
|
|
||||||
padding: 16,
|
|
||||||
borderRadius: 24,
|
|
||||||
flexDirection: 'row',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
alignItems: 'center',
|
|
||||||
},
|
|
||||||
content: {
|
|
||||||
flex: 1,
|
|
||||||
flexDirection: 'column',
|
|
||||||
gap: 4,
|
|
||||||
backgroundColor: '#FAF9F6',
|
|
||||||
borderRadius: 24,
|
|
||||||
paddingVertical: 8
|
|
||||||
},
|
|
||||||
item: {
|
|
||||||
paddingHorizontal: 16,
|
|
||||||
paddingVertical: 8,
|
|
||||||
flexDirection: 'row',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
alignItems: 'center',
|
|
||||||
},
|
|
||||||
itemText: {
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: '600',
|
|
||||||
color: '#4C320C',
|
|
||||||
},
|
|
||||||
upgradeButton: {
|
|
||||||
backgroundColor: '#E2793F',
|
|
||||||
borderRadius: 20,
|
|
||||||
paddingHorizontal: 16,
|
|
||||||
paddingVertical: 8,
|
|
||||||
},
|
|
||||||
upgradeButtonText: {
|
|
||||||
color: '#fff',
|
|
||||||
fontSize: 14,
|
|
||||||
fontWeight: "600"
|
|
||||||
},
|
|
||||||
switchContainer: {
|
|
||||||
width: 50,
|
|
||||||
height: 30,
|
|
||||||
borderRadius: 15,
|
|
||||||
justifyContent: 'center',
|
|
||||||
paddingHorizontal: 2,
|
|
||||||
},
|
|
||||||
switchOn: {
|
|
||||||
backgroundColor: '#E2793F',
|
|
||||||
alignItems: 'flex-end',
|
|
||||||
},
|
|
||||||
switchOff: {
|
|
||||||
backgroundColor: '#E5E5E5',
|
|
||||||
alignItems: 'flex-start',
|
|
||||||
},
|
|
||||||
switchCircle: {
|
|
||||||
width: 26,
|
|
||||||
height: 26,
|
|
||||||
borderRadius: 13,
|
|
||||||
},
|
|
||||||
switchCircleOn: {
|
|
||||||
backgroundColor: 'white',
|
|
||||||
},
|
|
||||||
switchCircleOff: {
|
|
||||||
backgroundColor: '#A5A5A5',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
export default DeleteModal;
|
|
||||||
@ -1,4 +1,3 @@
|
|||||||
import DeleteSvg from '@/assets/icons/svg/delete.svg';
|
|
||||||
import LogoutSvg from '@/assets/icons/svg/logout.svg';
|
import LogoutSvg from '@/assets/icons/svg/logout.svg';
|
||||||
import RightArrowSvg from '@/assets/icons/svg/rightArrow.svg';
|
import RightArrowSvg from '@/assets/icons/svg/rightArrow.svg';
|
||||||
import { useAuth } from '@/contexts/auth-context';
|
import { useAuth } from '@/contexts/auth-context';
|
||||||
@ -10,7 +9,6 @@ import React, { useEffect, useState } from 'react';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Linking, Modal, Pressable, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
import { Linking, Modal, Pressable, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
||||||
import { ThemedText } from '../ThemedText';
|
import { ThemedText } from '../ThemedText';
|
||||||
import DeleteModal from './delete';
|
|
||||||
import LcensesModal from './qualification/lcenses';
|
import LcensesModal from './qualification/lcenses';
|
||||||
import PrivacyModal from './qualification/privacy';
|
import PrivacyModal from './qualification/privacy';
|
||||||
import CustomSwitch from './switch';
|
import CustomSwitch from './switch';
|
||||||
@ -26,8 +24,6 @@ const SettingModal = (props: { modalVisible: boolean, setModalVisible: (visible:
|
|||||||
// 许可证弹窗
|
// 许可证弹窗
|
||||||
const [lcensesModalVisible, setLcensesModalVisible] = useState(false);
|
const [lcensesModalVisible, setLcensesModalVisible] = useState(false);
|
||||||
|
|
||||||
// 删除弹窗
|
|
||||||
const [deleteModalVisible, setDeleteModalVisible] = useState(false);
|
|
||||||
const { logout } = useAuth();
|
const { logout } = useAuth();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// 打开设置
|
// 打开设置
|
||||||
@ -362,11 +358,6 @@ const SettingModal = (props: { modalVisible: boolean, setModalVisible: (visible:
|
|||||||
<ThemedText style={{ color: '#E2793F', fontSize: 14, fontWeight: '600' }}>{t('generalSetting.logout', { ns: 'personal' })}</ThemedText>
|
<ThemedText style={{ color: '#E2793F', fontSize: 14, fontWeight: '600' }}>{t('generalSetting.logout', { ns: 'personal' })}</ThemedText>
|
||||||
<LogoutSvg />
|
<LogoutSvg />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
{/* 注销账号 */}
|
|
||||||
<TouchableOpacity style={[styles.premium, { marginVertical: 8 }]} onPress={() => setDeleteModalVisible(true)}>
|
|
||||||
<ThemedText style={{ color: '#E2793F', fontSize: 14, fontWeight: '600' }}>{t('generalSetting.deleteAccount', { ns: 'personal' })}</ThemedText>
|
|
||||||
<DeleteSvg />
|
|
||||||
</TouchableOpacity>
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</Pressable>
|
</Pressable>
|
||||||
@ -376,8 +367,6 @@ const SettingModal = (props: { modalVisible: boolean, setModalVisible: (visible:
|
|||||||
<LcensesModal modalVisible={lcensesModalVisible} setModalVisible={setLcensesModalVisible} />
|
<LcensesModal modalVisible={lcensesModalVisible} setModalVisible={setLcensesModalVisible} />
|
||||||
{/* 通知 */}
|
{/* 通知 */}
|
||||||
{/* <AuthNotifications setNotificationsEnabled={setNotificationsEnabled} notificationsEnabled={notificationsEnabled} /> */}
|
{/* <AuthNotifications setNotificationsEnabled={setNotificationsEnabled} notificationsEnabled={notificationsEnabled} /> */}
|
||||||
{/* 退出登录 */}
|
|
||||||
<DeleteModal modalVisible={deleteModalVisible} setModalVisible={setDeleteModalVisible} setSettingModalVisible={setModalVisible} />
|
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -83,10 +83,6 @@
|
|||||||
"videoLength": "Video Duration",
|
"videoLength": "Video Duration",
|
||||||
"storiesCreated": "Stories Created",
|
"storiesCreated": "Stories Created",
|
||||||
"conversationsWithMemo": "Conversations with Memo",
|
"conversationsWithMemo": "Conversations with Memo",
|
||||||
"setting": "Settings",
|
"setting": "Settings"
|
||||||
"premium": "Upgrade to Premium",
|
|
||||||
"unlock": "Unlock more memory magic",
|
|
||||||
"delete": "Are you sure you want to delete your account?",
|
|
||||||
"cancel": "Cancel"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,10 +83,6 @@
|
|||||||
"videoLength": "视频时长",
|
"videoLength": "视频时长",
|
||||||
"storiesCreated": "创作视频",
|
"storiesCreated": "创作视频",
|
||||||
"conversationsWithMemo": "Memo对话",
|
"conversationsWithMemo": "Memo对话",
|
||||||
"setting": "设置",
|
"setting": "设置"
|
||||||
"premium": "升级至会员",
|
|
||||||
"unlock": "解锁更多记忆魔法",
|
|
||||||
"delete": "确定要注销账号吗?",
|
|
||||||
"cancel": "取消"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user