feat(medications): 增强药品详情页面的编辑功能

- 添加剂量、剂型和服药频率的交互式选择器
- 实现提醒时间的动态编辑和添加功能
- 引入玻璃效果优化删除按钮的视觉体验
- 重构常量配置,提取药物相关常量到独立文件
- 创建可复用的InfoCard组件支持玻璃效果
This commit is contained in:
richarjiang
2025-11-11 11:31:06 +08:00
parent 50525f82a1
commit 7ea558847d
4 changed files with 922 additions and 107 deletions

View File

@@ -2,6 +2,7 @@ import { ThemedText } from '@/components/ThemedText';
import { HeaderBar } from '@/components/ui/HeaderBar';
import { IconSymbol } from '@/components/ui/IconSymbol';
import { Colors } from '@/constants/Colors';
import { DOSAGE_UNITS, FORM_OPTIONS } from '@/constants/Medication';
import { useAppDispatch } from '@/hooks/redux';
import { useAuthGuard } from '@/hooks/useAuthGuard';
import { useColorScheme } from '@/hooks/useColorScheme';
@@ -62,17 +63,6 @@ interface AddMedicationFormData {
note: string;
}
const FORM_OPTIONS: Array<{ id: MedicationForm; label: string; icon: keyof typeof MaterialCommunityIcons.glyphMap }> = [
{ id: 'capsule', label: '胶囊', icon: 'pill' },
{ id: 'pill', label: '药片', icon: 'tablet' },
{ id: 'injection', label: '注射', icon: 'needle' },
{ id: 'spray', label: '喷雾', icon: 'spray' },
{ id: 'drop', label: '滴剂', icon: 'eyedropper' },
{ id: 'syrup', label: '糖浆', icon: 'bottle-tonic' },
{ id: 'other', label: '其他', icon: 'dots-horizontal' },
];
const DOSAGE_UNITS = ['片', '粒', '毫升', '滴', '喷', '勺'];
const TIMES_PER_DAY_OPTIONS = Array.from({ length: 10 }, (_, index) => index + 1);
const STEP_TITLES = ['药品名称', '剂型与剂量', '服药频率', '服药时间', '备注'];
const STEP_DESCRIPTIONS = [