feat(auth): 为未登录用户添加登录引导界面
为目标页面、营养记录、食物添加等功能添加登录状态检查和引导界面,确保用户在未登录状态下能够获得清晰的登录提示和指引。 - 在目标页面添加精美的未登录引导界面,包含渐变背景和登录按钮 - 为食物记录相关组件添加登录状态检查,未登录时自动跳转登录页面 - 重构血氧饱和度卡片为独立数据获取,移除对外部数据依赖 - 移除个人页面的实验性SwiftUI组件,统一使用原生TouchableOpacity - 清理统计页面和营养记录页面的冗余代码和未使用变量
This commit is contained in:
@@ -216,8 +216,6 @@ export type TodayHealthData = {
|
||||
exerciseMinutesGoal: number;
|
||||
standHours: number;
|
||||
standHoursGoal: number;
|
||||
// 新增血氧饱和度和心率数据
|
||||
oxygenSaturation: number | null;
|
||||
heartRate: number | null;
|
||||
};
|
||||
|
||||
@@ -529,7 +527,7 @@ async function fetchActivitySummary(options: HealthDataOptions): Promise<HealthA
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchOxygenSaturation(options: HealthDataOptions): Promise<number | null> {
|
||||
export async function fetchOxygenSaturation(options: HealthDataOptions): Promise<number | null> {
|
||||
try {
|
||||
const result = await HealthKitManager.getOxygenSaturationSamples(options);
|
||||
|
||||
@@ -618,7 +616,6 @@ function getDefaultHealthData(): TodayHealthData {
|
||||
exerciseMinutesGoal: 30,
|
||||
standHours: 0,
|
||||
standHoursGoal: 12,
|
||||
oxygenSaturation: null,
|
||||
heartRate: null,
|
||||
};
|
||||
}
|
||||
@@ -636,14 +633,12 @@ export async function fetchHealthDataForDate(date: Date): Promise<TodayHealthDat
|
||||
basalEnergyBurned,
|
||||
hrv,
|
||||
activitySummary,
|
||||
oxygenSaturation,
|
||||
heartRate
|
||||
] = await Promise.all([
|
||||
fetchActiveEnergyBurned(options),
|
||||
fetchBasalEnergyBurned(options),
|
||||
fetchHeartRateVariability(options),
|
||||
fetchActivitySummary(options),
|
||||
fetchOxygenSaturation(options),
|
||||
fetchHeartRate(options)
|
||||
]);
|
||||
|
||||
@@ -657,7 +652,6 @@ export async function fetchHealthDataForDate(date: Date): Promise<TodayHealthDat
|
||||
exerciseMinutesGoal: Math.round(activitySummary?.appleExerciseTimeGoal || 30),
|
||||
standHours: Math.round(activitySummary?.appleStandHours || 0),
|
||||
standHoursGoal: Math.round(activitySummary?.appleStandHoursGoal || 12),
|
||||
oxygenSaturation,
|
||||
heartRate
|
||||
};
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user