feat: 更新统计页面,优化HRV数据展示和逻辑

- 移除模拟HRV数据,改为从健康数据中获取实际HRV值
- 新增HRV更新时间显示,提升用户信息获取体验
- 优化日期推导逻辑,确保数据加载一致性
- 更新BMI卡片和营养雷达图组件,支持紧凑模式展示
- 移除不再使用的图片资源,简化项目结构
This commit is contained in:
2025-08-19 22:04:39 +08:00
parent 63b1c52909
commit 7d7d233bbb
10 changed files with 445 additions and 234 deletions

View File

@@ -1,3 +1,4 @@
import dayjs from 'dayjs';
import type { HealthKitPermissions } from 'react-native-health';
import AppleHealthKit from 'react-native-health';
@@ -45,10 +46,8 @@ export async function ensureHealthPermissions(): Promise<boolean> {
export async function fetchHealthDataForDate(date: Date): Promise<TodayHealthData> {
console.log('开始获取指定日期健康数据...', date);
const start = new Date(date);
start.setHours(0, 0, 0, 0);
const end = new Date(date);
end.setHours(23, 59, 59, 999);
const start = dayjs(date).startOf('day').toDate();
const end = dayjs(date).endOf('day').toDate();
const options = {
startDate: start.toISOString(),