refactor: 重构蓝牙设备页与新增设备页的扫描-连接-录入流程

- 通用 BLE 健康设备识别(血压计/血糖仪/体重秤/血氧仪 标准 service UUID)
- 蓝牙设备页静默自动同步:仅匹配已绑定的设备名+类型,收到数据后变绿
- 新增设备页:扫描所有支持类型设备 → 选连接 → 绑定 + 同步首次数据
- 修复 read 缓存导致的重复录入循环(删除主动 read,依赖 indicate 推送)
- 修复 isConnected 缓存状态导致连接异常(强制先 disconnect 再 connect)
- 录入弹窗:血压心率同等级展示、3 秒自动关闭/手动确认
- 顺手更新本机开发 IP 与清理过时设计文档
This commit is contained in:
MingNian
2026-06-28 22:53:35 +08:00
parent a748c316f2
commit 4507083f3f
20 changed files with 1936 additions and 4428 deletions

View File

@@ -342,6 +342,12 @@ class _NavigationSection extends StatelessWidget {
route: 'exercisePlan',
colors: const [Color(0xFFA5F3FC), Color(0xFF67E8F9)],
),
_NavItem(
icon: Icons.bluetooth_connected_rounded,
title: '蓝牙设备',
route: 'devices',
colors: const [Color(0xFF60A5FA), Color(0xFFC4B5FD)],
),
];
return _Panel(
@@ -383,6 +389,7 @@ class _NavTile extends StatelessWidget {
'calendar' => '健康日历',
'followups' => '复查随访',
'exercisePlan' => '运动计划',
'devices' => '蓝牙设备',
_ => item.title,
};
@@ -394,6 +401,7 @@ class _NavTile extends StatelessWidget {
'calendar' => const [Color(0xFFC4B5FD), Color(0xFF8B5CF6)],
'followups' => const [Color(0xFFF472B6), Color(0xFFDB2777)],
'exercisePlan' => const [Color(0xFF7DD3FC), Color(0xFF60A5FA)],
'devices' => const [Color(0xFF60A5FA), Color(0xFFC4B5FD)],
_ => item.colors,
};