feat: UI 系统中心化 + 趋势图重构 + 法律文档 H5 上线
- UI 系统: 新增 design_tokens / module_visuals / app_buttons / app_status_badge / app_toast / ai_content 六个共享模块; 28 个页面接入, SnackBar 全部替换为 AppToast - 趋势图: 直线折线 + 渐变填充 + 阴影; 去网格线; X 轴日+月份分隔; Y 轴整数刻度最多 4 个; 点击数据点/录入记录显示上方浮层, 选中点变实心 - 法律文档 H5: 后端 wwwroot 托管隐私政策/服务协议/关于/个人信息收集清单/第三方 SDK 清单 + 索引页; Program.cs 启用 UseDefaultFiles + UseStaticFiles - 其他: auth_provider 登录流程调整; api_client IP 适配; 主页智能体栏间距优化
This commit is contained in:
@@ -28,6 +28,18 @@ import '../pages/doctor/doctor_profile_page.dart';
|
||||
import '../pages/admin/admin_home_page.dart';
|
||||
import '../pages/admin/admin_add_doctor_page.dart';
|
||||
import '../providers/auth_provider.dart' show userRoleProvider;
|
||||
import '../widgets/app_error_state.dart';
|
||||
|
||||
Widget _missingParamPage() {
|
||||
return const Scaffold(
|
||||
body: AppErrorState(title: '页面参数错误', subtitle: '缺少打开页面所需的信息,请返回后重试'),
|
||||
);
|
||||
}
|
||||
|
||||
String? _requiredParam(Map<String, String> params, String key) {
|
||||
final value = params[key]?.trim();
|
||||
return value == null || value.isEmpty ? null : value;
|
||||
}
|
||||
|
||||
/// 根据路由信息返回对应页面
|
||||
Widget buildPage(RouteInfo route, WidgetRef ref) {
|
||||
@@ -59,7 +71,8 @@ Widget buildPage(RouteInfo route, WidgetRef ref) {
|
||||
case 'reports':
|
||||
return const ReportListPage();
|
||||
case 'aiAnalysis':
|
||||
return AiAnalysisPage(id: params['id']!);
|
||||
final id = _requiredParam(params, 'id');
|
||||
return id == null ? _missingParamPage() : AiAnalysisPage(id: id);
|
||||
case 'reportOriginal':
|
||||
return ReportOriginalPage(
|
||||
url: params['url'] ?? '',
|
||||
@@ -82,13 +95,17 @@ Widget buildPage(RouteInfo route, WidgetRef ref) {
|
||||
case 'doctorSettings':
|
||||
return const DoctorSettingsPage();
|
||||
case 'doctorPatientDetail':
|
||||
return DoctorPatientDetailPage(id: params['id']!);
|
||||
final id = _requiredParam(params, 'id');
|
||||
return id == null ? _missingParamPage() : DoctorPatientDetailPage(id: id);
|
||||
case 'doctorChat':
|
||||
return DoctorChatPage(id: params['id']!);
|
||||
final id = _requiredParam(params, 'id');
|
||||
return id == null ? _missingParamPage() : DoctorChatPage(id: id);
|
||||
case 'doctorReportDetail':
|
||||
return DoctorReportDetailPage(id: params['id']!);
|
||||
final id = _requiredParam(params, 'id');
|
||||
return id == null ? _missingParamPage() : DoctorReportDetailPage(id: id);
|
||||
case 'doctorFollowUpEdit':
|
||||
return DoctorFollowUpEditPage(id: params['id']!);
|
||||
final id = _requiredParam(params, 'id');
|
||||
return id == null ? _missingParamPage() : DoctorFollowUpEditPage(id: id);
|
||||
case 'devices':
|
||||
return const DeviceManagementPage();
|
||||
case 'deviceScan':
|
||||
@@ -106,9 +123,11 @@ Widget buildPage(RouteInfo route, WidgetRef ref) {
|
||||
case 'conversationHistory':
|
||||
return const ConversationHistoryPage();
|
||||
case 'staticText':
|
||||
return StaticTextPage(type: params['type']!);
|
||||
final type = _requiredParam(params, 'type');
|
||||
return type == null ? _missingParamPage() : StaticTextPage(type: type);
|
||||
case 'dietDetail':
|
||||
return DietRecordDetailPage(id: params['id']!);
|
||||
final id = _requiredParam(params, 'id');
|
||||
return id == null ? _missingParamPage() : DietRecordDetailPage(id: id);
|
||||
default:
|
||||
return const LoginPage();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user