import { Ionicons } from '@expo/vector-icons'; import { BlurView } from 'expo-blur'; import { useRouter } from 'expo-router'; import React, { useMemo } from 'react'; import { ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import Animated, { FadeInDown } from 'react-native-reanimated'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { RadarChart } from '@/components/RadarChart'; import { HeaderBar } from '@/components/ui/HeaderBar'; import { Colors } from '@/constants/Colors'; type PoseView = 'front' | 'side' | 'back'; // 斯多特普拉提体态评估维度(示例) const DIMENSIONS = [ { key: 'head_neck', label: '头颈对齐' }, { key: 'shoulder', label: '肩带稳定' }, { key: 'ribs', label: '胸廓控制' }, { key: 'pelvis', label: '骨盆中立' }, { key: 'spine', label: '脊柱排列' }, { key: 'hip_knee', label: '髋膝对线' }, ]; type Issue = { title: string; severity: 'low' | 'medium' | 'high'; description: string; suggestions: string[]; }; type ViewReport = { score: number; // 0-5 issues: Issue[]; }; type ResultData = { radar: number[]; // 与 DIMENSIONS 对应,0-5 overview: string; byView: Record; }; // NOTE: 此处示例数据,后续可由 API 注入 const MOCK_RESULT: ResultData = { radar: [4.2, 3.6, 3.2, 4.6, 3.8, 3.4], overview: '整体体态较为均衡,骨盆与脊柱控制较好;肩带稳定性与胸廓控制仍有提升空间。', byView: { front: { score: 3.8, issues: [ { title: '肩峰略前移,肩胛轻度外旋', severity: 'medium', description: '站立正面观察,右侧肩峰较左侧略有前移,提示肩带稳定性偏弱。', suggestions: ['肩胛稳定训练(如天鹅摆臂分解)', '胸椎伸展与放松', '轻度弹力带外旋激活'], }, ], }, side: { score: 4.1, issues: [ { title: '骨盆接近中立,腰椎轻度前凸', severity: 'low', description: '侧面观察,骨盆位置接近中立位,腰椎存在轻度前凸,需注意腹压与肋骨下沉。', suggestions: ['呼吸配合下的腹横肌激活', '猫牛流动改善胸椎灵活性'], }, ], }, back: { score: 3.5, issues: [ { title: '右侧肩胛轻度上抬', severity: 'medium', description: '背面观察,右肩胛较左侧轻度上抬,肩胛下回旋不足。', suggestions: ['锯前肌激活训练', '低位划船,关注肩胛下沉与后缩'], }, ], }, }, }; export default function AIPostureResultScreen() { const insets = useSafeAreaInsets(); const router = useRouter(); const theme = Colors.light; const categories = useMemo(() => DIMENSIONS.map(d => ({ key: d.key, label: d.label })), []); const ScoreBadge = ({ score }: { score: number }) => ( {score.toFixed(1)} /5 ); const IssueItem = ({ issue }: { issue: Issue }) => ( {issue.title} {issue.description} {!!issue.suggestions?.length && ( {issue.suggestions.map((s, idx) => ( {s} ))} )} ); const ViewCard = ({ title, report }: { title: string; report: ViewReport }) => ( {title} {report.issues.map((iss, idx) => ())} ); return ( router.back()} tone="light" transparent /> {/* 背景装饰 */} {/* 总览与雷达图 */} 总体概览 {MOCK_RESULT.overview} {/* 视图分析 */} {/* 底部操作 */} router.replace('/(tabs)/personal')}> 完成并返回 router.push('/(tabs)/coach')}> 生成训练建议 ); } const styles = StyleSheet.create({ screen: { flex: 1, }, bgBlobA: { position: 'absolute', top: -60, right: -40, width: 200, height: 200, borderRadius: 100, backgroundColor: 'rgba(187,242,70,0.18)', }, bgBlobB: { position: 'absolute', bottom: 100, left: -30, width: 180, height: 180, borderRadius: 90, backgroundColor: 'rgba(89, 198, 255, 0.16)', }, card: { marginTop: 16, marginHorizontal: 16, borderRadius: 16, padding: 14, backgroundColor: 'rgba(255,255,255,0.72)', borderWidth: 1, borderColor: 'rgba(25,33,38,0.08)', }, sectionTitle: { color: '#192126', fontSize: 16, fontWeight: '800', marginBottom: 8, }, overview: { color: '#384046', fontSize: 14, lineHeight: 20, }, radarWrap: { marginTop: 10, alignItems: 'center', }, cardHeader: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 8, }, cardTitle: { color: '#192126', fontSize: 15, fontWeight: '700', }, scoreBadge: { flexDirection: 'row', alignItems: 'flex-end', paddingHorizontal: 10, paddingVertical: 6, borderRadius: 10, backgroundColor: 'rgba(187,242,70,0.16)', }, scoreText: { color: '#192126', fontSize: 18, fontWeight: '800', }, scoreUnit: { color: '#5E6468', fontSize: 12, marginLeft: 4, }, issueItem: { flexDirection: 'row', gap: 10, paddingVertical: 10, }, issueDot: { width: 10, height: 10, borderRadius: 5, marginTop: 6, }, dotHigh: { backgroundColor: '#E24D4D' }, dotMedium: { backgroundColor: '#F0C23C' }, dotLow: { backgroundColor: '#2BCC7F' }, issueTitle: { color: '#192126', fontSize: 14, fontWeight: '700', }, issueDesc: { color: '#5E6468', fontSize: 13, marginTop: 4, }, suggestRow: { flexDirection: 'row', flexWrap: 'wrap', gap: 8, marginTop: 8, }, suggestChip: { paddingHorizontal: 10, paddingVertical: 6, borderRadius: 12, backgroundColor: 'rgba(25,33,38,0.04)', borderWidth: 1, borderColor: 'rgba(25,33,38,0.08)', }, suggestText: { color: '#192126', fontSize: 12, }, actions: { marginTop: 16, paddingHorizontal: 16, flexDirection: 'row', gap: 10, }, primaryBtn: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 8, height: 48, paddingHorizontal: 16, borderRadius: 14, }, primaryBtnText: { color: '#192126', fontSize: 15, fontWeight: '800', }, secondaryBtn: { flex: 1, height: 48, borderRadius: 14, alignItems: 'center', justifyContent: 'center', borderWidth: 1, borderColor: 'transparent', }, secondaryBtnText: { color: '#384046', fontSize: 15, fontWeight: '700', }, });