fix: 健康档案保存按钮移至右上角 + 5页面补充返回按钮 + API地址修复

- 健康档案: 保存按钮移到AppBar右侧,删除底部按钮和绿色成功SnackBar
- 5个缺失页面补充左上角返回按钮: 健康概览/编辑用药/报告管理/报告详情/报告解读
- api_client.dart: 默认baseUrl改为192.168.1.29 (支持WiFi直连)
This commit is contained in:
MingNian
2026-06-22 15:58:59 +08:00
parent 6ce010e46a
commit 80540e2191
6 changed files with 40 additions and 44 deletions

View File

@@ -1381,14 +1381,6 @@ class _HealthArchivePageState extends ConsumerState<HealthArchivePage> {
'familyHistory': _familyCtrl.text,
});
await ref.read(authProvider.notifier).refreshProfile();
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('保存成功'),
backgroundColor: AppColors.success,
),
);
}
} catch (_) {
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
@@ -1438,6 +1430,21 @@ class _HealthArchivePageState extends ConsumerState<HealthArchivePage> {
icon: const Icon(Icons.arrow_back, color: AppColors.textPrimary),
onPressed: () => popRoute(ref),
),
actions: [
_saving
? const Padding(
padding: EdgeInsets.only(right: 16),
child: SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(strokeWidth: 2),
),
)
: TextButton(
onPressed: _save,
child: const Text('保存', style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600)),
),
],
),
body: ListView(
padding: const EdgeInsets.all(16),
@@ -1525,36 +1532,6 @@ class _HealthArchivePageState extends ConsumerState<HealthArchivePage> {
const SizedBox(height: 12),
_F('家族病史', _familyCtrl, hint: '如: 父亲冠心病'),
]),
const SizedBox(height: 24),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
gradient: AppColors.primaryGradient,
),
padding: const EdgeInsets.all(1.5),
child: SizedBox(
width: double.infinity,
height: 52,
child: ElevatedButton(
onPressed: _saving ? null : _save,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
foregroundColor: AppColors.primary,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(13),
),
elevation: 0,
),
child: Text(
_saving ? '保存中...' : '保存档案',
style: const TextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
),
),
),
),
),
const SizedBox(height: 40),
],
),