update pay ui

This commit is contained in:
2025-12-10 16:50:13 +08:00
parent 7f5085ba8e
commit beb349ac2f

View File

@@ -22,11 +22,13 @@ export const useHotspotData = (selectedDate) => {
// 获取日期字符串用于比较
const dateStr = selectedDate ? selectedDate.toISOString().split('T')[0] : 'today';
// 如果正在请求中,或者日期未变化且不是强制刷新,跳过
// 如果正在请求中,跳过(除非是强制刷新
if (fetchingRef.current && !forceRefetch) {
return;
}
if (lastDateRef.current === dateStr && data && !forceRefetch) {
// 如果日期未变化且已有数据,跳过(除非是强制刷新)
if (lastDateRef.current === dateStr && !forceRefetch) {
return;
}
@@ -54,7 +56,7 @@ export const useHotspotData = (selectedDate) => {
setLoading(false);
fetchingRef.current = false;
}
}, [selectedDate, data]);
}, [selectedDate]); // 移除 data 依赖,避免循环更新
useEffect(() => {
fetchData();