feat(个人中心): 优化会员横幅组件,支持深色模式与国际化;新增医疗记录卡片组件,完善健康档案功能
This commit is contained in:
@@ -131,10 +131,13 @@ export function HealthHistoryTab() {
|
||||
const [isDatePickerVisible, setDatePickerVisibility] = useState(false);
|
||||
const [currentEditingId, setCurrentEditingId] = useState<string | null>(null);
|
||||
|
||||
// 初始化时从服务端获取健康史数据
|
||||
// 初始化时从服务端获取健康史数据(如果父组件未加载)
|
||||
useEffect(() => {
|
||||
dispatch(fetchHealthHistory());
|
||||
}, [dispatch]);
|
||||
// 只在数据为空时才主动拉取,避免重复请求
|
||||
if (!historyData || Object.keys(historyData).length === 0) {
|
||||
dispatch(fetchHealthHistory());
|
||||
}
|
||||
}, [dispatch, historyData]);
|
||||
|
||||
const historyItems = [
|
||||
{ title: t('health.tabs.healthProfile.history.allergy'), key: 'allergy' },
|
||||
|
||||
Reference in New Issue
Block a user