feat: 医生端完整实现 + 双角色登录 + 健康日历 + 饮食记录重做 + 配色系统重构
后端: - User表加Role字段 + DoctorProfile表 + 废弃旧Doctor数据 - JWT加Role claim + 注册/登录拆分(/api/auth/register + /api/auth/login) - 医生端点全量加JWT鉴权+Role校验(15个端点) - 日历端点改造(用药/运动/随访按日期+星期匹配) - 饮食记录PUT端点 + 健康记录DELETE端点 - 用户Profile端点返回Role 前端: - 登录页重做(角色选择卡片 用户紫/医生蓝 + 审核码6666 + 注册返登录) - App路由分流(userRole→患者端/医生端) - 医生端: 工作台Dashboard + 患者管理(搜索分页) + 问诊/报告/随访CRUD - 报告审核: AI预分析+指标表格+严重程度4级+模板多选+评语 - 随访编辑: 患者选择器+日期时间+打通患者端 - 健康日历: 可点击日历+当日安排列表+用药/运动/随访颜色标记 - 饮食记录: 热量趋势7/30天+日历(一周)+当日胶囊详情+侧滑编辑删除 - 健康档案: 日期选择器+手术可添加多条+白底渐变保存按钮 - 配色系统: 清理25个未使用色+新增doctorBlue/drawerGradient/pageGrey - 患者端侧边栏: 新渐变+白底按钮+紫色汉堡图标 - AI对话: 用户气泡白底黑字+药管家改蓝色 - App启动闪屏: 防登录页闪烁 文档: color_design_system.md(20页面完整配色设计+图标底色对照表)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'navigation_provider.dart';
|
||||
import '../pages/auth/login_page.dart';
|
||||
import '../pages/home/home_page.dart';
|
||||
@@ -17,60 +18,55 @@ import '../pages/diet/diet_capture_page.dart';
|
||||
import '../pages/device/device_scan_page.dart';
|
||||
import '../pages/device/device_management_page.dart';
|
||||
import '../pages/remaining_pages.dart';
|
||||
import '../pages/doctor/doctor_home_page.dart';
|
||||
import '../pages/doctor/doctor_patient_detail_page.dart';
|
||||
import '../pages/doctor/doctor_report_detail_page.dart';
|
||||
import '../pages/doctor/doctor_followup_edit_page.dart';
|
||||
import '../pages/doctor/doctor_settings_page.dart';
|
||||
import '../pages/doctor/doctor_profile_page.dart';
|
||||
import '../providers/auth_provider.dart' show userRoleProvider;
|
||||
|
||||
/// 根据路由信息返回对应页面
|
||||
Widget buildPage(RouteInfo route) {
|
||||
Widget buildPage(RouteInfo route, WidgetRef ref) {
|
||||
final params = route.params;
|
||||
switch (route.name) {
|
||||
case 'login':
|
||||
return const LoginPage();
|
||||
case 'login': return const LoginPage();
|
||||
case 'home':
|
||||
return const HomePage();
|
||||
case 'trend':
|
||||
return TrendPage(metricType: params['type']?.isNotEmpty == true ? params['type'] : null);
|
||||
case 'calendar':
|
||||
return const HealthCalendarPage();
|
||||
case 'medications':
|
||||
return const MedicationListPage();
|
||||
case 'medCheckIn':
|
||||
return MedicationCheckInPage(medId: params['id']);
|
||||
case 'medicationEdit':
|
||||
return const MedicationEditPage();
|
||||
case 'reports':
|
||||
return const ReportListPage();
|
||||
case 'aiAnalysis':
|
||||
return AiAnalysisPage(id: params['id']!);
|
||||
case 'consultation':
|
||||
return DoctorChatPage(id: params['id']!);
|
||||
case 'exercisePlan':
|
||||
return const ExercisePlanPage();
|
||||
case 'exerciseCreate':
|
||||
return const ExercisePlanCreatePage();
|
||||
case 'dietRecords':
|
||||
return const DietRecordListPage();
|
||||
case 'dietCapture':
|
||||
return const DietCapturePage();
|
||||
case 'profile':
|
||||
return const ProfilePage();
|
||||
case 'devices':
|
||||
return const DeviceManagementPage();
|
||||
case 'deviceScan':
|
||||
return const DeviceScanPage();
|
||||
case 'healthArchive':
|
||||
return const HealthArchivePage();
|
||||
case 'followups':
|
||||
return const FollowUpListPage();
|
||||
case 'settings':
|
||||
return const SettingsPage();
|
||||
case 'notificationPrefs':
|
||||
return const NotificationPrefsPage();
|
||||
case 'staticText':
|
||||
return StaticTextPage(type: params['type']!);
|
||||
case 'servicePackageDetail':
|
||||
return ServicePackageDetailPage(packageId: params['id']!);
|
||||
case 'dietDetail':
|
||||
return DietRecordDetailPage(id: params['id']!);
|
||||
default:
|
||||
return const LoginPage();
|
||||
final role = ref.watch(userRoleProvider);
|
||||
return role == 'Doctor' ? const DoctorHomePage() : const HomePage();
|
||||
case 'doctorHome': return const DoctorHomePage();
|
||||
case 'trend': return TrendPage(metricType: params['type']?.isNotEmpty == true ? params['type'] : null);
|
||||
case 'calendar': return const HealthCalendarPage();
|
||||
case 'medications': return const MedicationListPage();
|
||||
case 'medCheckIn': return MedicationCheckInPage(medId: params['id']);
|
||||
case 'medicationEdit': return const MedicationEditPage();
|
||||
case 'reports': return const ReportListPage();
|
||||
case 'aiAnalysis': return AiAnalysisPage(id: params['id']!);
|
||||
case 'consultation': return DoctorChatPage(id: params['id']!);
|
||||
case 'exercisePlan': return const ExercisePlanPage();
|
||||
case 'exerciseCreate': return const ExercisePlanCreatePage();
|
||||
case 'dietRecords': return const DietRecordListPage();
|
||||
case 'dietCapture': return const DietCapturePage();
|
||||
case 'profile': return const ProfilePage();
|
||||
case 'doctorProfile': return const DoctorProfileEditPage();
|
||||
case 'doctorSettings': return const DoctorSettingsPage();
|
||||
case 'doctorPatientDetail': return DoctorPatientDetailPage(id: params['id']!);
|
||||
case 'doctorChat': return DoctorChatPage(id: params['id']!);
|
||||
case 'doctorReportDetail': return DoctorReportDetailPage(id: params['id']!);
|
||||
case 'doctorFollowUpEdit': return DoctorFollowUpEditPage(id: params['id']!);
|
||||
case 'devices': return const DeviceManagementPage();
|
||||
case 'deviceScan': return const DeviceScanPage();
|
||||
case 'healthArchive': return const HealthArchivePage();
|
||||
case 'followups': return const FollowUpListPage();
|
||||
case 'settings': return const SettingsPage();
|
||||
case 'notificationPrefs': return const NotificationPrefsPage();
|
||||
case 'staticText': return StaticTextPage(type: params['type']!);
|
||||
case 'servicePackageDetail': return ServicePackageDetailPage(packageId: params['id']!);
|
||||
case 'dietDetail': return DietRecordDetailPage(id: params['id']!);
|
||||
default: return const LoginPage();
|
||||
}
|
||||
}
|
||||
|
||||
// ── 医生端次级页面 Stubs(逐步实现)──
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user