feat: 添加教练功能和更新用户界面
- 新增教练页面,用户可以与教练进行互动和咨询 - 更新首页,切换到教练 tab 并传递名称参数 - 优化个人信息页面,添加注销帐号和退出登录功能 - 更新隐私政策和用户协议的链接,确保用户在使用前同意相关条款 - 修改今日训练页面标题为“开始训练”,提升用户体验 - 删除不再使用的进度条组件,简化代码结构
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { ThemedView } from '@/components/ThemedView';
|
||||
import { useThemeColor } from '@/hooks/useThemeColor';
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import { router } from 'expo-router';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { ActivityIndicator, View } from 'react-native';
|
||||
@@ -18,22 +17,24 @@ export default function SplashScreen() {
|
||||
|
||||
const checkOnboardingStatus = async () => {
|
||||
try {
|
||||
const onboardingCompleted = await AsyncStorage.getItem(ONBOARDING_COMPLETED_KEY);
|
||||
// const onboardingCompleted = await AsyncStorage.getItem(ONBOARDING_COMPLETED_KEY);
|
||||
|
||||
if (onboardingCompleted === 'true') {
|
||||
router.replace('/(tabs)');
|
||||
} else {
|
||||
router.replace('/onboarding');
|
||||
}
|
||||
setIsLoading(false);
|
||||
// if (onboardingCompleted === 'true') {
|
||||
// router.replace('/(tabs)');
|
||||
// } else {
|
||||
// router.replace('/onboarding');
|
||||
// }
|
||||
// setIsLoading(false);
|
||||
router.replace('/(tabs)');
|
||||
} catch (error) {
|
||||
console.error('检查引导状态失败:', error);
|
||||
// 如果出现错误,默认显示引导页面
|
||||
setTimeout(() => {
|
||||
router.replace('/onboarding');
|
||||
setIsLoading(false);
|
||||
}, 1000);
|
||||
// setTimeout(() => {
|
||||
// router.replace('/onboarding');
|
||||
// setIsLoading(false);
|
||||
// }, 1000);
|
||||
}
|
||||
setIsLoading(false);
|
||||
};
|
||||
|
||||
if (!isLoading) {
|
||||
|
||||
Reference in New Issue
Block a user