style: 统一患者端页面视觉并补齐入口跳转
- 调整全局颜色基调,提高灰色文字和边框对比度 - 新增企业级页面头部、统计块和卡片通用组件 - 优化用药管理、报告管理、个人信息、通知中心页面布局 - 新增多张页面插画和通用 UI 装饰素材 - 运动计划列表更紧凑,并新增运动计划详情路由 - 补齐医生端协议入口和原始报告查看入口 - 移除设置页未实现的字体大小和清除缓存入口
This commit is contained in:
@@ -4,6 +4,7 @@ import '../../core/app_colors.dart';
|
||||
import '../../core/app_theme.dart';
|
||||
import '../../core/navigation_provider.dart';
|
||||
import '../../providers/auth_provider.dart';
|
||||
import '../../widgets/enterprise_widgets.dart';
|
||||
|
||||
class ProfilePage extends ConsumerWidget {
|
||||
const ProfilePage({super.key});
|
||||
@@ -34,10 +35,25 @@ class ProfilePage extends ConsumerWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_ProfileHero(
|
||||
name: name,
|
||||
phone: phone,
|
||||
avatarUrl: user?.avatarUrl,
|
||||
EnterpriseHeader(
|
||||
title: name,
|
||||
subtitle: phone.isNotEmpty ? phone : '未绑定手机',
|
||||
icon: Icons.person_rounded,
|
||||
color: const Color(0xFF38BDF8),
|
||||
accent: const Color(0xFF8B5CF6),
|
||||
stats: const [
|
||||
EnterpriseStat(
|
||||
label: '账号状态',
|
||||
value: '已登录',
|
||||
icon: Icons.verified_user_rounded,
|
||||
),
|
||||
EnterpriseStat(
|
||||
label: '健康资料',
|
||||
value: '可维护',
|
||||
icon: Icons.folder_shared_rounded,
|
||||
),
|
||||
],
|
||||
trailing: _AvatarBadge(avatarUrl: user?.avatarUrl),
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
_InfoPanel(
|
||||
@@ -46,21 +62,21 @@ class ProfilePage extends ConsumerWidget {
|
||||
icon: Icons.badge_rounded,
|
||||
label: '姓名',
|
||||
value: name,
|
||||
colors: const [Color(0xFF7DD3FC), Color(0xFF2563EB)],
|
||||
colors: const [Color(0xFF7DD3FC), Color(0xFF38BDF8)],
|
||||
),
|
||||
const _SoftDivider(),
|
||||
_InfoRow(
|
||||
icon: Icons.phone_iphone_rounded,
|
||||
label: '手机号',
|
||||
value: phone.isNotEmpty ? phone : '未绑定手机',
|
||||
colors: const [Color(0xFFA78BFA), Color(0xFF7C3AED)],
|
||||
colors: const [Color(0xFFFBCFE8), Color(0xFFF472B6)],
|
||||
),
|
||||
const _SoftDivider(),
|
||||
_InfoRow(
|
||||
icon: Icons.folder_shared_rounded,
|
||||
label: '健康档案',
|
||||
value: '查看和维护基础健康资料',
|
||||
colors: const [Color(0xFF2DD4BF), Color(0xFF0F766E)],
|
||||
colors: const [Color(0xFFC4B5FD), Color(0xFF8B5CF6)],
|
||||
onTap: () => pushRoute(ref, 'healthArchive'),
|
||||
),
|
||||
],
|
||||
@@ -72,7 +88,7 @@ class ProfilePage extends ConsumerWidget {
|
||||
icon: Icons.verified_user_rounded,
|
||||
label: '隐私保护',
|
||||
value: '健康数据仅用于个人健康管理',
|
||||
colors: const [Color(0xFFFBBF24), Color(0xFFEA580C)],
|
||||
colors: const [Color(0xFFFFB4A2), Color(0xFFFB7185)],
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -131,94 +147,33 @@ class ProfilePage extends ConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _ProfileHero extends StatelessWidget {
|
||||
final String name;
|
||||
final String phone;
|
||||
class _AvatarBadge extends StatelessWidget {
|
||||
final String? avatarUrl;
|
||||
const _ProfileHero({
|
||||
required this.name,
|
||||
required this.phone,
|
||||
required this.avatarUrl,
|
||||
});
|
||||
const _AvatarBadge({required this.avatarUrl});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
width: 50,
|
||||
height: 50,
|
||||
padding: const EdgeInsets.all(2),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [Color(0xFFEEF2FF), Color(0xFFF7ECFF), Color(0xFFEFFBF9)],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
border: Border.all(color: Colors.white, width: 1.5),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0xFF6D5DF6).withValues(alpha: 0.10),
|
||||
blurRadius: 24,
|
||||
offset: const Offset(0, 14),
|
||||
),
|
||||
],
|
||||
color: const Color(0xFFF8FAFC),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: AppColors.border, width: 1.1),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 76,
|
||||
height: 76,
|
||||
padding: const EdgeInsets.all(3),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [Color(0xFF38BDF8), Color(0xFFC084FC)],
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
child: avatarUrl != null
|
||||
? Image.network(avatarUrl!, fit: BoxFit.cover)
|
||||
: const ColoredBox(
|
||||
color: Colors.white,
|
||||
child: Icon(
|
||||
Icons.person_rounded,
|
||||
color: Color(0xFF38BDF8),
|
||||
size: 30,
|
||||
),
|
||||
),
|
||||
borderRadius: BorderRadius.circular(28),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
child: avatarUrl != null
|
||||
? Image.network(avatarUrl!, fit: BoxFit.cover)
|
||||
: const ColoredBox(
|
||||
color: Colors.white,
|
||||
child: Icon(
|
||||
Icons.person_rounded,
|
||||
color: Color(0xFF7C3AED),
|
||||
size: 42,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
name,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 7),
|
||||
Text(
|
||||
phone.isNotEmpty ? phone : '未绑定手机',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -233,9 +188,9 @@ class _InfoPanel extends StatelessWidget {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.88),
|
||||
borderRadius: BorderRadius.circular(26),
|
||||
border: Border.all(color: Colors.white, width: 1.4),
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Column(children: children),
|
||||
@@ -261,7 +216,7 @@ class _InfoRow extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: onTap,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 2, vertical: 12),
|
||||
child: Row(
|
||||
@@ -275,7 +230,14 @@ class _InfoRow extends StatelessWidget {
|
||||
end: Alignment.bottomRight,
|
||||
colors: colors,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: colors.last.withValues(alpha: 0.18),
|
||||
blurRadius: 12,
|
||||
offset: const Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Icon(icon, color: Colors.white, size: 22),
|
||||
),
|
||||
@@ -324,6 +286,6 @@ class _SoftDivider extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Divider(height: 1, color: Color(0xFFF1F3F8));
|
||||
return const Divider(height: 1, color: AppColors.divider);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user