fix(miniprogram): 深度审查修复多个功能问题
Some checks failed
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled

- settings: 清除缓存不再错误读取明文 token,改由 auth store restore 恢复
- appointment: 移除多余的 detail_cache Storage 写入
- reports: 未选择就诊人时显示引导提示而非空白
- health/input: 血压录入验证舒张压必填
- followups: tab 切换时不再清空列表导致闪烁
This commit is contained in:
iven
2026-04-24 18:36:56 +08:00
parent 81cc84e4b2
commit a63043f447
5 changed files with 32 additions and 26 deletions

View File

@@ -51,13 +51,25 @@ export default function HealthInput() {
const currentIndicator = INDICATORS[indicatorIdx].value;
if (currentIndicator === 'blood_pressure') {
if (!systolic || !diastolic) {
Taro.showToast({ title: '请填写收缩压和舒张压', icon: 'none' });
return;
}
} else {
if (!value) {
Taro.showToast({ title: '请输入数值', icon: 'none' });
return;
}
}
const input = currentIndicator === 'blood_pressure'
? { indicator_type: 'blood_pressure' as const, value: parseFloat(systolic), extra: { systolic: parseFloat(systolic), diastolic: parseFloat(diastolic) } }
: { indicator_type: currentIndicator as any, value: parseFloat(value) };
const result = vitalSignSchema.safeParse(input);
if (!result.success) {
Taro.showToast({ title: result.error.errors[0].message, icon: 'none' });
Taro.showToast({ title: result.error.issues[0].message, icon: 'none' });
return;
}
@@ -77,7 +89,7 @@ export default function HealthInput() {
});
clearCache();
Taro.showToast({ title: '录入成功', icon: 'success' });
trackEvent('health_data_input', { type: indicatorType });
trackEvent('health_data_input', { type: currentIndicator });
setTimeout(() => Taro.navigateBack(), 1000);
} catch (e: unknown) {
const msg = e instanceof Error ? e.message : '录入失败';