fix(mp): 二轮审计修复 — ScrollView嵌套/InputField重建/markdown分组/BLE上限/缓存清理

CRITICAL: ai-report/list PageShell scroll=false 修复双重滚动冲突
HIGH: dialysis/create InputField 提取为独立组件避免 render 销毁重建
MEDIUM: markdownToHtml 连续<li>合并到单个<ul>
MEDIUM: 咨询详情页图片添加 lazyLoad
MEDIUM: BLEManager readings 添加 MAX_LIVE_READINGS=200 上限
MEDIUM: DataBuffer trimToMax 时重建 seenKeys 保持一致性
MEDIUM: auth.ts logout 清理模块级缓存变量
LOW: request.ts safeReLaunch 添加 console.warn + doRefresh 死锁警告注释
This commit is contained in:
iven
2026-05-17 18:54:27 +08:00
parent 66aef532fa
commit fcce2f5c51
9 changed files with 59 additions and 33 deletions

View File

@@ -13,6 +13,23 @@ import './index.scss';
const DIALYSIS_TYPES = ['HD', 'HDF', 'HF'];
function InputField({ label, value, placeholder, type = 'digit', onChange }: {
label: string; value: string; placeholder: string; type?: string; onChange: (v: string) => void;
}) {
return (
<View className='form-row'>
<Text className='form-label'>{label}</Text>
<Input
className='form-input'
type={type as any}
placeholder={placeholder}
value={value}
onInput={(e) => onChange(e.detail.value)}
/>
</View>
);
}
interface FormState {
patient_id: string;
dialysis_date: string;
@@ -159,21 +176,6 @@ export default function DialysisCreate() {
if (loading) return <Loading />;
const InputField = ({ label, field, placeholder, type = 'digit' }: {
label: string; field: keyof FormState; placeholder: string; type?: string;
}) => (
<View className='form-row'>
<Text className='form-label'>{label}</Text>
<Input
className='form-input'
type={type as any}
placeholder={placeholder}
value={form[field]}
onInput={(e) => updateField(field, e.detail.value)}
/>
</View>
);
return (
<PageShell safeBottom={false} className={modeClass}>
<ContentCard className='section'>
@@ -208,30 +210,30 @@ export default function DialysisCreate() {
<Text className='form-value'>{form.dialysis_type}</Text>
</Picker>
</View>
<InputField label='透析时长' field='dialysis_duration' placeholder='分钟' type='number' />
<InputField label='血流速' field='blood_flow_rate' placeholder='ml/min' type='number' />
<InputField label='透析时长' value={form.dialysis_duration} placeholder='分钟' type='number' onChange={(v) => updateField('dialysis_duration', v)} />
<InputField label='血流速' value={form.blood_flow_rate} placeholder='ml/min' type='number' onChange={(v) => updateField('blood_flow_rate', v)} />
</ContentCard>
<ContentCard className='section'>
<Text className='section-title'></Text>
<InputField label='干体重' field='dry_weight' placeholder='kg' />
<InputField label='透前体重' field='pre_weight' placeholder='kg' />
<InputField label='透后体重' field='post_weight' placeholder='kg' />
<InputField label='干体重' value={form.dry_weight} placeholder='kg' onChange={(v) => updateField('dry_weight', v)} />
<InputField label='透前体重' value={form.pre_weight} placeholder='kg' onChange={(v) => updateField('pre_weight', v)} />
<InputField label='透后体重' value={form.post_weight} placeholder='kg' onChange={(v) => updateField('post_weight', v)} />
</ContentCard>
<ContentCard className='section'>
<Text className='section-title'></Text>
<InputField label='透前收缩压' field='pre_bp_systolic' placeholder='mmHg' type='number' />
<InputField label='透前舒张压' field='pre_bp_diastolic' placeholder='mmHg' type='number' />
<InputField label='透后收缩压' field='post_bp_systolic' placeholder='mmHg' type='number' />
<InputField label='透后舒张压' field='post_bp_diastolic' placeholder='mmHg' type='number' />
<InputField label='透前心率' field='pre_heart_rate' placeholder='bpm' type='number' />
<InputField label='透后心率' field='post_heart_rate' placeholder='bpm' type='number' />
<InputField label='透前收缩压' value={form.pre_bp_systolic} placeholder='mmHg' type='number' onChange={(v) => updateField('pre_bp_systolic', v)} />
<InputField label='透前舒张压' value={form.pre_bp_diastolic} placeholder='mmHg' type='number' onChange={(v) => updateField('pre_bp_diastolic', v)} />
<InputField label='透后收缩压' value={form.post_bp_systolic} placeholder='mmHg' type='number' onChange={(v) => updateField('post_bp_systolic', v)} />
<InputField label='透后舒张压' value={form.post_bp_diastolic} placeholder='mmHg' type='number' onChange={(v) => updateField('post_bp_diastolic', v)} />
<InputField label='透前心率' value={form.pre_heart_rate} placeholder='bpm' type='number' onChange={(v) => updateField('pre_heart_rate', v)} />
<InputField label='透后心率' value={form.post_heart_rate} placeholder='bpm' type='number' onChange={(v) => updateField('post_heart_rate', v)} />
</ContentCard>
<ContentCard className='section'>
<Text className='section-title'></Text>
<InputField label='超滤量' field='ultrafiltration_volume' placeholder='ml' type='number' />
<InputField label='超滤量' value={form.ultrafiltration_volume} placeholder='ml' type='number' onChange={(v) => updateField('ultrafiltration_volume', v)} />
<View className='form-row form-row--textarea'>
<Text className='form-label'></Text>
<Textarea