feature:基本功能

This commit is contained in:
吕新雨
2026-01-29 19:09:36 +08:00
parent c1a433a469
commit 0dd84b1873
47 changed files with 2978 additions and 219 deletions

View File

@@ -2,10 +2,10 @@ import { useEffect } from 'react';
import { ActivityIndicator, StyleSheet, View } from 'react-native';
import { useRouter } from 'expo-router';
import { getOnboardingCompleted } from '@/src/storage/appStorage';
import { getOnboardingCompleted, getConsentAccepted } from '@/src/storage/appStorage';
/**
* 启动分发:根据 onboarding 状态跳转
* 启动分发:根据 consent 和 onboarding 状态跳转
*/
export default function Index() {
const router = useRouter();
@@ -13,8 +13,17 @@ export default function Index() {
useEffect(() => {
let cancelled = false;
(async () => {
const completed = await getOnboardingCompleted();
// 1. 检查是否同意协议
const consentAccepted = await getConsentAccepted();
if (cancelled) return;
if (!consentAccepted) {
router.replace('/(splash)/splash');
return;
}
// 2. 检查 Onboarding
const completed = await getOnboardingCompleted();
router.replace(completed ? '/(app)/home' : '/(onboarding)/onboarding');
})();
return () => {