feat: 添加睡眠阶段时间轴组件,优化睡眠数据可视化

This commit is contained in:
richarjiang
2025-09-10 19:03:34 +08:00
parent 98176ee988
commit 6fbdbafa3e
4 changed files with 343 additions and 11 deletions

View File

@@ -22,6 +22,7 @@ import {
import { InfoModal, type SleepDetailData } from '@/components/sleep/InfoModal';
import { SleepStagesInfoModal } from '@/components/sleep/SleepStagesInfoModal';
import { SleepStageTimeline } from '@/components/sleep/SleepStageTimeline';
import { HeaderBar } from '@/components/ui/HeaderBar';
import { Colors } from '@/constants/Colors';
import { useColorScheme } from '@/hooks/useColorScheme';
@@ -309,6 +310,14 @@ export default function SleepDetailScreen() {
onInfoPress={() => setSleepStagesModal({ visible: true })}
/>
{/* 苹果健康风格的睡眠阶段时间轴图表 */}
<SleepStageTimeline
sleepSamples={displayData.rawSleepSamples}
bedtime={displayData.bedtime}
wakeupTime={displayData.wakeupTime}
onInfoPress={() => setSleepStagesModal({ visible: true })}
/>
{/* 睡眠阶段统计 - 2x2网格布局 */}
<View style={styles.stagesGridContainer}>
{/* 使用真实数据或默认数据确保包含所有4个阶段 */}