fix
This commit is contained in:
@@ -95,13 +95,6 @@ export default function ExploreScreen() {
|
|||||||
|
|
||||||
const oxygenSaturation = useMockData ? (mockData?.oxygenSaturation ?? null) : (healthData?.oxygenSaturation ?? null);
|
const oxygenSaturation = useMockData ? (mockData?.oxygenSaturation ?? null) : (healthData?.oxygenSaturation ?? null);
|
||||||
|
|
||||||
// 调试HRV数据
|
|
||||||
console.log('=== HRV数据调试 ===');
|
|
||||||
console.log('useMockData:', useMockData);
|
|
||||||
console.log('mockData?.hrv:', mockData?.hrv);
|
|
||||||
console.log('healthData?.hrv:', healthData?.hrv);
|
|
||||||
console.log('healthData:', healthData);
|
|
||||||
console.log('==================');
|
|
||||||
|
|
||||||
const fitnessRingsData = useMockData ? {
|
const fitnessRingsData = useMockData ? {
|
||||||
activeCalories: mockData?.activeCalories ?? 0,
|
activeCalories: mockData?.activeCalories ?? 0,
|
||||||
@@ -126,9 +119,6 @@ export default function ExploreScreen() {
|
|||||||
standHoursGoal: 12,
|
standHoursGoal: 12,
|
||||||
});
|
});
|
||||||
|
|
||||||
// HRV更新时间
|
|
||||||
const [hrvUpdateTime, setHrvUpdateTime] = useState<Date>(new Date());
|
|
||||||
|
|
||||||
// 用于触发动画重置的 token(当日期或数据变化时更新)
|
// 用于触发动画重置的 token(当日期或数据变化时更新)
|
||||||
const [animToken, setAnimToken] = useState(0);
|
const [animToken, setAnimToken] = useState(0);
|
||||||
|
|
||||||
@@ -272,7 +262,6 @@ export default function ExploreScreen() {
|
|||||||
const data = await fetchHealthDataForDate(derivedDate);
|
const data = await fetchHealthDataForDate(derivedDate);
|
||||||
|
|
||||||
console.log('设置UI状态:', data);
|
console.log('设置UI状态:', data);
|
||||||
console.log('HRV数据详细信息:', data.hrv, typeof data.hrv);
|
|
||||||
|
|
||||||
// 仅当该请求仍是最新时,才应用结果
|
// 仅当该请求仍是最新时,才应用结果
|
||||||
if (latestRequestKeyRef.current === requestKey) {
|
if (latestRequestKeyRef.current === requestKey) {
|
||||||
@@ -298,8 +287,6 @@ export default function ExploreScreen() {
|
|||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 更新HRV数据时间
|
|
||||||
setHrvUpdateTime(new Date());
|
|
||||||
setAnimToken((t) => t + 1);
|
setAnimToken((t) => t + 1);
|
||||||
|
|
||||||
// 更新缓存时间戳
|
// 更新缓存时间戳
|
||||||
@@ -392,6 +379,10 @@ export default function ExploreScreen() {
|
|||||||
}
|
}
|
||||||
}, [executeLoadAllData, debouncedLoadAllData]);
|
}, [executeLoadAllData, debouncedLoadAllData]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
loadAllData(currentSelectedDate);
|
||||||
|
}, [])
|
||||||
|
|
||||||
// 页面聚焦时的数据加载逻辑
|
// 页面聚焦时的数据加载逻辑
|
||||||
// useFocusEffect(
|
// useFocusEffect(
|
||||||
// React.useCallback(() => {
|
// React.useCallback(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user