feat: 二级页面色彩刷新 + 用药/通知/设备重构 + 后端健康档案/通知管线增强 + 大量测试
## 后端 - 健康档案: 新增手术状态字段 + EF 迁移; HealthArchiveService 新增查询方法 - 健康记录: HealthRecordService 新增批量/统计方法; 契约扩展 - 用药: 新增 MedicationScheduleStatus 枚举; MedicationService 排班逻辑调整 - 通知: EfUserNotificationPipeline 重构; 新增 EfReminderCatchUpService; 通知管线支持更多场景 - 用户: UserService 账号删除逻辑; 新增 local_account_file_cleanup; EfUserRepository 扩展 - AI: medication_agent_handler 微调; prompt_manager 优化; AiConversationService 上下文处理 - Endpoint: doctor/medication/exercise/health/notification/user 等多接口调整 - BackgroundService: health_record_reminder_service 重构, 提醒补漏逻辑 - 测试: 新增 account_deletion/doctor_endpoint/medication_schedule/medication_update/prompt_manager 测试 ## 前端 - UI 系统: app_theme 大幅重构; app_colors/app_design_tokens/app_module_visuals 调整; 二级页面色彩刷新 - 主页: home_page 背景渐变 + 消息列表提取 _HomeMessages + 通知检查逻辑; chat_messages_view 全面重构 - 用药: medication_list/edit/checkin 三页重构, 新增 medication_ui_logic 抽取 - 通知: notification_prefs_page 重构, 新增 notification_prefs_logic; notification_center 优化 - 设备: device_management 重构, 新增 device_sync_ui_logic; device_scan 优化 - 趋势图: trend_page 大幅重构 - 登录: login_page 重构 - 个人资料: 新增 profile_edit_page; profile_page 优化 - 运动: 新增 exercise/ 目录 + care_plan_ui_logic - 其他: remaining_pages/report_pages/health_drawer/admin/doctor 等多页面调整 - 组件: common_widgets/app_empty_state/app_error_state/app_future_view/app_toast/ai_content 优化 - Provider: chat_provider/consultation_provider/data_providers/auth_provider 调整 - AndroidManifest: 移除多余权限 - 测试: 新增 ai_content/care_plan/home_message/login_flow/medication_checkin/medication_ui/notification_prefs/profile_device/secondary_page/swipe_delete 等大量测试 ## 文档 - 新增 ui-design-system.md 设计系统文档 - 新增 secondary-page-color-refresh 计划 + specs 目录
This commit is contained in:
@@ -9,6 +9,8 @@ import '../../core/app_design_tokens.dart';
|
||||
import '../../core/app_theme.dart';
|
||||
import '../../providers/auth_provider.dart';
|
||||
import '../../widgets/app_toast.dart';
|
||||
import '../../widgets/common_widgets.dart';
|
||||
import '../../widgets/app_empty_state.dart';
|
||||
import 'diet_nutrition_widgets.dart';
|
||||
import 'diet_record_logic.dart';
|
||||
|
||||
@@ -321,10 +323,9 @@ class DietNotifier extends Notifier<DietState> {
|
||||
}
|
||||
}
|
||||
|
||||
// ─────────── 饮食主题色(暖橙系,不再用紫色)───────────
|
||||
// 饮食主题色
|
||||
const _dietAccent = DietPalette.primary;
|
||||
const _dietKcalText = DietPalette.calorie;
|
||||
const _dietGradient = DietPalette.gradient;
|
||||
|
||||
class DietCapturePage extends ConsumerStatefulWidget {
|
||||
const DietCapturePage({super.key});
|
||||
@@ -352,7 +353,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
final state = ref.watch(dietProvider);
|
||||
return GradientScaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white.withValues(alpha: 0.9),
|
||||
backgroundColor: Colors.white,
|
||||
title: const Text(
|
||||
'饮食分析',
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600),
|
||||
@@ -425,7 +426,6 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: AppRadius.xlBorder,
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -480,7 +480,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
);
|
||||
}
|
||||
|
||||
// ─────────── 分析中 ───────────
|
||||
// 分析中
|
||||
Widget _buildAnalyzing(DietState state) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 40),
|
||||
@@ -503,7 +503,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
state.errorMessage!,
|
||||
style: const TextStyle(fontSize: 14, color: AppColors.error),
|
||||
style: const TextStyle(fontSize: 14, color: AppColors.errorText),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
@@ -513,43 +513,15 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
}
|
||||
|
||||
Widget _buildNoFoodHint() {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(vertical: 36, horizontal: 18),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
border: Border.all(color: AppColors.borderLight),
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.image_not_supported_outlined,
|
||||
size: 44,
|
||||
color: AppColors.textHint,
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
const Text(
|
||||
'未识别到食物',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
const Text(
|
||||
'请重新拍摄或选择含有食物的清晰照片',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 13, color: AppColors.textSecondary),
|
||||
),
|
||||
],
|
||||
),
|
||||
return AppEmptyState(
|
||||
icon: Icons.image_not_supported_outlined,
|
||||
iconColor: _dietAccent,
|
||||
title: '未识别到食物',
|
||||
subtitle: '请重新拍摄或选择含有食物的清晰照片',
|
||||
);
|
||||
}
|
||||
|
||||
// ─────────── 食物列表 ───────────
|
||||
// 食物列表
|
||||
Widget _buildFoodList(WidgetRef ref) {
|
||||
final state = ref.watch(dietProvider);
|
||||
return Container(
|
||||
@@ -557,7 +529,6 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: AppRadius.xlBorder,
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -618,8 +589,9 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
height: 26,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
gradient: food.selected ? _dietGradient : null,
|
||||
color: food.selected ? null : DietPalette.primarySoft,
|
||||
color: food.selected
|
||||
? AppColors.primary
|
||||
: AppColors.primarySoft,
|
||||
borderRadius: AppRadius.smBorder,
|
||||
border: Border.all(
|
||||
color: food.selected
|
||||
@@ -751,7 +723,7 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
return c;
|
||||
}
|
||||
|
||||
// ─────────── AI 点评 ───────────
|
||||
// AI 点评
|
||||
Widget _buildAiCommentary(String? text) {
|
||||
final hasText = text != null && text.trim().isNotEmpty;
|
||||
return Container(
|
||||
@@ -759,7 +731,6 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: AppRadius.xlBorder,
|
||||
boxShadow: AppColors.cardShadowLight,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -770,8 +741,8 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
width: 4,
|
||||
height: 18,
|
||||
decoration: BoxDecoration(
|
||||
gradient: _dietGradient,
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
color: _dietAccent,
|
||||
borderRadius: AppRadius.pillBorder,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 9),
|
||||
@@ -816,31 +787,9 @@ class _DietCapturePageState extends ConsumerState<DietCapturePage> {
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 10, 16, 12),
|
||||
child: GestureDetector(
|
||||
onTap: _saveDietRecord,
|
||||
child: Container(
|
||||
height: 50,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
gradient: _dietGradient,
|
||||
borderRadius: AppRadius.mdBorder,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: _dietAccent.withValues(alpha: 0.24),
|
||||
blurRadius: 14,
|
||||
offset: const Offset(0, 7),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Text(
|
||||
'保存记录',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w900,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: AppGradientOutlineButton(
|
||||
label: '保存记录',
|
||||
onPressed: _saveDietRecord,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user