import { PlanCard } from '@/components/PlanCard'; import { SearchBox } from '@/components/SearchBox'; import { ThemedText } from '@/components/ThemedText'; import { ThemedView } from '@/components/ThemedView'; import { Colors } from '@/constants/Colors'; import { useColorScheme } from '@/hooks/useColorScheme'; // Removed WorkoutCard import since we no longer use the horizontal carousel import { useAuthGuard } from '@/hooks/useAuthGuard'; import { getChineseGreeting } from '@/utils/date'; import { useRouter } from 'expo-router'; import React from 'react'; import { Pressable, SafeAreaView, ScrollView, StyleSheet, View } from 'react-native'; // 移除旧的“热门活动”滑动数据,改为固定的“热点功能”卡片 export default function HomeScreen() { const router = useRouter(); const { pushIfAuthedElseLogin } = useAuthGuard(); const theme = (useColorScheme() ?? 'light') as 'light' | 'dark'; const colorTokens = Colors[theme]; return ( {/* Header Section */} {getChineseGreeting()} 🔥 新学员,欢迎你 {/* Search Box */} {/* Hot Features Section */} 热点功能 router.push('/ai-posture-assessment')} > AI体态评估 3分钟获取体态报告 开始评估 router.push('/ai-coach-chat?name=Sarah' as any)} > 在线教练 认证教练 · 1对1即时解答 立即咨询 {/* Today Plan Section */} 为你推荐 pushIfAuthedElseLogin('/challenge')}> pushIfAuthedElseLogin('/training-plan')}> pushIfAuthedElseLogin('/checkin')}> {/* Add some spacing at the bottom */} ); } const styles = StyleSheet.create({ safeArea: { flex: 1, backgroundColor: '#F7F8FA', }, container: { flex: 1, backgroundColor: '#F7F8FA', }, header: { paddingHorizontal: 24, paddingTop: 16, paddingBottom: 8, }, greeting: { fontSize: 16, color: '#8A8A8E', fontWeight: '400', marginBottom: 6, }, userName: { fontSize: 30, fontWeight: 'bold', color: '#1A1A1A', lineHeight: 36, }, sectionContainer: { marginTop: 24, }, sectionTitle: { fontSize: 24, fontWeight: 'bold', color: '#1A1A1A', paddingHorizontal: 24, marginBottom: 18, }, featureGrid: { paddingHorizontal: 24, flexDirection: 'row', justifyContent: 'space-between', }, featureCard: { width: '48%', borderRadius: 16, padding: 16, backgroundColor: '#FFFFFF', // iOS shadow shadowColor: '#000', shadowOpacity: 0.08, shadowRadius: 12, shadowOffset: { width: 0, height: 6 }, // Android shadow elevation: 4, }, featureCardPrimary: { backgroundColor: '#EEF2FF', // 柔和的靛蓝背景 }, featureCardSecondary: { backgroundColor: '#F0FDFA', // 柔和的青绿背景 }, featureIcon: { fontSize: 28, marginBottom: 8, }, featureTitle: { fontSize: 18, fontWeight: '700', color: '#0F172A', marginBottom: 6, }, featureSubtitle: { fontSize: 12, color: '#6B7280', lineHeight: 16, marginBottom: 12, }, featureCta: { alignSelf: 'flex-start', backgroundColor: '#0F172A', paddingHorizontal: 10, paddingVertical: 6, borderRadius: 999, }, featureCtaText: { color: '#FFFFFF', fontSize: 12, fontWeight: '600', }, planList: { paddingHorizontal: 24, }, // 移除旧的滑动样式 bottomSpacing: { height: 120, }, });