import { Colors } from '@/constants/Colors'; import { useColorScheme } from '@/hooks/useColorScheme'; import { LinearGradient } from 'expo-linear-gradient'; import React from 'react'; import { Modal, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; interface StressAnalysisModalProps { visible: boolean; onClose: () => void; hrvValue: number; updateTime: Date; } export function StressAnalysisModal({ visible, onClose, hrvValue, updateTime }: StressAnalysisModalProps) { const colorScheme = useColorScheme(); const colors = Colors[colorScheme ?? 'light']; // 模拟30天HRV数据 const hrvData = { goodEvents: { percentage: 26, count: 53, range: '>80毫秒' }, energetic: { percentage: 47, count: 97, range: '43-80毫秒' }, stressed: { percentage: 27, count: 56, range: '<43毫秒' }, }; return ( {/* 标题 */} 压力情况分析 {/* 最近30天HRV情况 */} 最近30天HRV情况 {/* 彩色横条图 */} 好事发生 活力满满 鸭梨山大 {/* 数据统计卡片 */} {/* 好事发生 & 活力满满 */} 好事发生 {hrvData.goodEvents.percentage}% ❤️ {hrvData.goodEvents.range} {hrvData.goodEvents.count}次 活力满满 {hrvData.energetic.percentage}% ❤️ {hrvData.energetic.range} {hrvData.energetic.count}次 {/* 鸭梨山大 */} 鸭梨山大 {hrvData.stressed.percentage}% ❤️ {hrvData.stressed.range} {hrvData.stressed.count}次 {/* 底部继续按钮 */} 继续 ); } const styles = StyleSheet.create({ modalContainer: { flex: 1, }, content: { flex: 1, paddingHorizontal: 20, }, title: { fontSize: 24, fontWeight: '800', color: '#111827', textAlign: 'center', marginTop: 20, marginBottom: 32, }, sectionTitle: { fontSize: 22, fontWeight: '800', color: '#111827', marginBottom: 20, }, chartContainer: { marginBottom: 32, }, colorBar: { height: 16, borderRadius: 8, overflow: 'hidden', marginBottom: 16, }, gradientBar: { flex: 1, }, legend: { flexDirection: 'row', justifyContent: 'space-around', }, legendItem: { flexDirection: 'row', alignItems: 'center', }, legendDot: { width: 12, height: 12, borderRadius: 6, marginRight: 6, }, legendText: { fontSize: 14, fontWeight: '600', color: '#374151', }, statsCard: { backgroundColor: '#FFFFFF', borderRadius: 16, padding: 20, marginBottom: 32, shadowColor: '#000', shadowOffset: { width: 0, height: 2, }, shadowOpacity: 0.05, shadowRadius: 8, elevation: 2, }, statsRow: { flexDirection: 'row', gap: 20, marginBottom: 24, }, statItem: { flex: 1, }, statTitle: { fontSize: 16, fontWeight: '700', marginBottom: 8, }, statPercentage: { fontSize: 36, fontWeight: '800', color: '#111827', marginBottom: 4, }, statDetails: { marginBottom: 4, }, statRange: { fontSize: 14, fontWeight: '600', color: '#DC2626', backgroundColor: '#FEE2E2', paddingHorizontal: 8, paddingVertical: 3, borderRadius: 10, alignSelf: 'flex-start', }, statCount: { fontSize: 16, fontWeight: '600', color: '#6B7280', }, bottomContainer: { paddingHorizontal: 20, paddingBottom: 34, }, continueButton: { borderRadius: 25, overflow: 'hidden', marginBottom: 8, }, buttonGradient: { paddingVertical: 18, alignItems: 'center', justifyContent: 'center', }, buttonBackground: { backgroundColor: Colors.light.accentGreen, // 应用主色调 paddingVertical: 18, alignItems: 'center', justifyContent: 'center', }, buttonText: { fontSize: 18, fontWeight: '700', color: '#192126', // 主色调上的文字颜色 }, homeIndicator: { width: 134, height: 5, backgroundColor: '#000', borderRadius: 3, alignSelf: 'center', }, });