From 7bdbf18a3be99c32259ef0336e57cc7e26681ef3 Mon Sep 17 00:00:00 2001 From: 15945162479 <15945162479@qq.com> Date: Sat, 13 Dec 2025 14:46:19 +0800 Subject: [PATCH] Add File --- src/family/pages/MedicationPlan.tsx | 333 ++++++++++++++++++++++++++++ 1 file changed, 333 insertions(+) create mode 100644 src/family/pages/MedicationPlan.tsx diff --git a/src/family/pages/MedicationPlan.tsx b/src/family/pages/MedicationPlan.tsx new file mode 100644 index 0000000..9ec91d5 --- /dev/null +++ b/src/family/pages/MedicationPlan.tsx @@ -0,0 +1,333 @@ +import React, { useState } from 'react'; +import { Plus, Edit2, Trash2, X, Clock, AlertCircle } from 'lucide-react'; + +interface Medication { + id: string; + name: string; + dosage: string; + route: string; + times: string[]; + withFood: boolean; + gracePeriod: number; + active: boolean; +} + +/** + * 家属端用药计划界面 + * 管理老人的用药提醒 + */ +export const MedicationPlan: React.FC = () => { + const [showForm, setShowForm] = useState(false); + const [editingMed, setEditingMed] = useState(null); + + // 模拟数据 + const medications: Medication[] = [ + { + id: '1', + name: '氯沙坦', + dosage: '50mg', + route: '口服', + times: ['08:00', '20:00'], + withFood: true, + gracePeriod: 30, + active: true, + }, + { + id: '2', + name: '二甲双胍', + dosage: '500mg', + route: '口服', + times: ['08:00', '12:00', '18:00'], + withFood: true, + gracePeriod: 30, + active: true, + }, + { + id: '3', + name: '阿司匹林', + dosage: '100mg', + route: '口服', + times: ['21:00'], + withFood: false, + gracePeriod: 60, + active: true, + }, + ]; + + const handleEdit = (med: Medication) => { + setEditingMed(med); + setShowForm(true); + }; + + const handleDelete = (medId: string) => { + if (confirm('确定要删除这个用药计划吗?')) { + console.log('Delete medication:', medId); + } + }; + + return ( +
+ {/* 顶部导航 */} +
+
+
+

用药计划

+ +
+
+
+ + {/* 主要内容区 */} +
+ {/* 用药列表 */} +
+ + + + + + + + + + + + + {medications.map((med) => ( + + + + + + + + + ))} + +
+ 药品名称 + + 剂量/用法 + + 服用时间 + + 要求 + + 状态 + + 操作 +
+
{med.name}
+
+
+ {med.dosage} · {med.route} +
+
+
+ {med.times.map((time, index) => ( + + + {time} + + ))} +
+
+
+ {med.withFood && ( +
随餐服用
+ )} +
+ 宽限 {med.gracePeriod} 分钟 +
+
+
+ + {med.active ? '启用中' : '已暂停'} + + +
+ + +
+
+
+ + {/* 提示信息 */} +
+
+ +
+

用药安全提示

+
    +
  • 请确保用药时间不冲突
  • +
  • 超过宽限期未确认服药将自动发送通知给您
  • +
  • 本系统不提供医疗建议,如需调整用药请咨询医生
  • +
+
+
+
+
+ + {/* 编辑/添加表单抽屉 */} + {showForm && ( +
+
+
+

+ {editingMed ? '编辑用药' : '添加用药'} +

+ +
+ +
+ {/* 药品名称 */} +
+ + +
+ + {/* 剂量 */} +
+ + +
+ + {/* 给药途径 */} +
+ + +
+ + {/* 服用时间 */} +
+ +
+ {(editingMed?.times || ['08:00']).map((time, index) => ( +
+ + +
+ ))} + +
+
+ + {/* 随餐服用 */} +
+ +
+ + {/* 宽限期 */} +
+ + +

+ 超过宽限期未确认服药将发送通知 +

+
+ + {/* 操作按钮 */} +
+ + +
+
+
+
+ )} +
+ ); +};