feat: 全面UI改造 — 报告/饮食/运动/用药/侧边栏/对话流/胶囊

- 报告模块:重写AI解读页,统一白色卡片+三栏布局(指标→解读→医生审核);加删除功能+后端删接口;VLM自动识别报告类型生成中文标题;去五颜六色
- 饮食分析:全面重设计,暖橙主题配色,图片自适应,餐次emoji选择器,去紫色
- 运动确认卡片:修复duration_minutes JSON类型转换,支持中文数字识别(三十分钟/半小时→30);主区域只显示运动名,字段行改为横向排列
- 流式输出:简化为最基础逐字追加,去buffer+Timer+淡入动画
- 欢迎卡片:每智能体独立渐变色(青/橙/蓝/紫/绿/粉),加卡片入场滑入+淡入动画(600ms)
- 确认卡片:头部去紫色背景改浅灰白,字段行去图标改纯信息横排,编辑框去双重边框
- 用药管理:胶囊改TabBar,添加按钮改右下FAB;打卡按钮改对号圆圈形式;药丸图标白底
- 侧边栏:加VIP服务/保险栏+图标,标题字体放大;服务包去查看更多+去VIP金色标签
- 胶囊:首页智能体胶囊白底深色字; side胶囊加阴影
- 对话流:reverse=false,今日健康出现在顶部; 对话页input bar匹配主页面样式
- 其他:个人资料去紫色+去多余入口;设置页白底图标;蓝牙页加返回按钮;报告管理改名
- 后端:加DELETE /api/reports/{id}; 修复manage_exercise数据类型转换;AI提示优化中文数字
This commit is contained in:
MingNian
2026-06-10 23:46:45 +08:00
parent 63d2092c24
commit f6dd14be3b
28 changed files with 1153 additions and 1578 deletions

View File

@@ -14,17 +14,10 @@ class ProfilePage extends ConsumerWidget {
final name = user?.name?.isNotEmpty == true ? user!.name! : '未设置昵称';
final phone = user?.phone ?? '';
return Scaffold(
backgroundColor: AppColors.background,
return GradientScaffold(
appBar: AppBar(
backgroundColor: AppColors.cardBackground,
title: const Text('个人信息'),
actions: [
TextButton(
onPressed: () => pushRoute(ref, 'healthArchive'),
child: const Text('编辑档案', style: TextStyle(fontSize: 15, color: AppColors.primary)),
),
],
),
body: SafeArea(
child: SingleChildScrollView(
@@ -34,35 +27,14 @@ class ProfilePage extends ConsumerWidget {
// 头像区
Center(
child: Stack(children: [
Container(
padding: const EdgeInsets.all(3),
decoration: BoxDecoration(
gradient: AppColors.gPurplePink,
shape: BoxShape.circle,
),
child: CircleAvatar(
radius: 50,
backgroundColor: AppColors.cardBackground,
backgroundImage: user?.avatarUrl != null ? NetworkImage(user!.avatarUrl!) : null,
child: user?.avatarUrl == null
? const Icon(Icons.person, size: 48, color: AppColors.primary)
: null,
),
),
Positioned(
right: 0, bottom: 0,
child: Container(
width: 34, height: 34,
decoration: BoxDecoration(
gradient: AppColors.gPurplePink,
shape: BoxShape.circle,
border: Border.all(color: AppColors.cardBackground, width: 3),
),
child: const Icon(Icons.camera_alt, size: 17, color: AppColors.textOnGradient),
),
),
]),
child: CircleAvatar(
radius: 50,
backgroundColor: AppColors.cardInner,
backgroundImage: user?.avatarUrl != null ? NetworkImage(user!.avatarUrl!) : null,
child: user?.avatarUrl == null
? const Icon(Icons.person, size: 48, color: AppColors.textHint)
: null,
),
),
const SizedBox(height: 20),
Text(name, style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: AppColors.textPrimary)),
@@ -70,13 +42,13 @@ class ProfilePage extends ConsumerWidget {
Container(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 6),
decoration: BoxDecoration(
color: AppColors.primaryLight,
borderRadius: BorderRadius.circular(AppTheme.rPill),
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Row(mainAxisSize: MainAxisSize.min, children: [
const Icon(Icons.phone_android, size: 16, color: AppColors.primary),
const Icon(Icons.phone_android, size: 16, color: AppColors.textSecondary),
const SizedBox(width: 6),
Text(phone.isNotEmpty ? phone : '未绑定手机', style: const TextStyle(fontSize: 14, color: AppColors.primary)),
Text(phone.isNotEmpty ? phone : '未绑定手机', style: const TextStyle(fontSize: 14, color: AppColors.textSecondary)),
]),
),
@@ -100,20 +72,23 @@ class ProfilePage extends ConsumerWidget {
]),
),
const SizedBox(height: 24),
const SizedBox(height: 40),
// 快捷入口
Row(children: [
Expanded(child: _actionCard(Icons.folder_outlined, '健康档案', () => pushRoute(ref, 'healthArchive'))),
const SizedBox(width: 12),
Expanded(child: _actionCard(Icons.bluetooth_rounded, '蓝牙设备', () => pushRoute(ref, 'devices'))),
]),
const SizedBox(height: 12),
Row(children: [
Expanded(child: _actionCard(Icons.settings_outlined, '设置', () => pushRoute(ref, 'settings'))),
const SizedBox(width: 12),
Expanded(child: _actionCard(Icons.logout, '退出登录', () => _logout(context, ref), isDestructive: true)),
]),
// 退出登录
SizedBox(
width: 200,
child: OutlinedButton.icon(
onPressed: () => _logout(context, ref),
icon: const Icon(Icons.logout, size: 18),
label: const Text('退出登录', style: TextStyle(fontSize: 16)),
style: OutlinedButton.styleFrom(
foregroundColor: AppColors.error,
side: const BorderSide(color: AppColors.error),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
padding: const EdgeInsets.symmetric(vertical: 12),
),
),
),
const SizedBox(height: 40),
]),
@@ -129,10 +104,10 @@ class ProfilePage extends ConsumerWidget {
Container(
width: 40, height: 40,
decoration: BoxDecoration(
color: AppColors.primaryLight,
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
child: Icon(icon, size: 22, color: AppColors.primary),
child: Icon(icon, size: 22, color: AppColors.textSecondary),
),
const SizedBox(width: 14),
Expanded(
@@ -147,26 +122,6 @@ class ProfilePage extends ConsumerWidget {
);
}
Widget _actionCard(IconData icon, String label, VoidCallback onTap, {bool isDestructive = false}) {
final c = isDestructive ? AppColors.error : AppColors.primary;
return GestureDetector(
onTap: onTap,
child: Container(
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 16),
decoration: BoxDecoration(
color: AppColors.cardBackground,
borderRadius: BorderRadius.circular(AppTheme.rMd),
boxShadow: [AppTheme.shadowLight],
),
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Icon(icon, size: 20, color: c),
const SizedBox(width: 8),
Text(label, style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600, color: isDestructive ? c : AppColors.textPrimary)),
]),
),
);
}
Future<void> _logout(BuildContext context, WidgetRef ref) async {
final ok = await showDialog<bool>(
context: context,

View File

@@ -12,14 +12,13 @@ class ServicePackageDetailPage extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final package = servicePackages.where((p) => p.id == packageId).firstOrNull;
if (package == null) {
return Scaffold(
return GradientScaffold(
appBar: AppBar(title: const Text('服务包详情')),
body: const Center(child: Text('未找到该服务包')),
);
}
return Scaffold(
backgroundColor: AppTheme.bg,
return GradientScaffold(
appBar: AppBar(
title: Text(package.title, style: const TextStyle(fontSize: 19)),
centerTitle: true,