feat: 添加睡眠详情页面,集成睡眠数据获取功能,优化健康数据权限管理,更新相关组件以支持睡眠统计和展示
This commit is contained in:
@@ -8,7 +8,7 @@ interface StressMeterProps {
|
||||
value: number | null;
|
||||
updateTime?: Date;
|
||||
style?: any;
|
||||
hrvValue: number;
|
||||
hrvValue: number | null;
|
||||
}
|
||||
|
||||
export function StressMeter({ value, updateTime, style, hrvValue }: StressMeterProps) {
|
||||
@@ -50,6 +50,13 @@ export function StressMeter({ value, updateTime, style, hrvValue }: StressMeterP
|
||||
// 使用传入的 hrvValue 进行转换
|
||||
const stressIndex = convertHrvToStressIndex(hrvValue);
|
||||
|
||||
// 调试信息
|
||||
console.log('StressMeter 调试:', {
|
||||
hrvValue,
|
||||
stressIndex,
|
||||
progressPercentage: stressIndex !== null ? Math.max(0, Math.min(100, stressIndex)) : 0
|
||||
});
|
||||
|
||||
// 计算进度条位置(0-100%)
|
||||
// 压力指数越高,进度条越满(红色区域越多)
|
||||
const progressPercentage = stressIndex !== null ? Math.max(0, Math.min(100, stressIndex)) : 0;
|
||||
|
||||
Reference in New Issue
Block a user