feat: AI 意图路由/草稿存储 + Prompts 模块化 + UI 视觉统一 + AI 同意门 + 资源更新
后端: - 新增 ai_intent_router 意图路由 - 新增 AiEntryDraft 草稿存储 + EF 迁移 - 新增 Prompts 模块化(global/modules/rag/router) - AI Agent handlers 扩展 前端: - 新增 AI 同意门 (ai_consent_gate/provider/details_page) - HealthMetricVisuals 视觉统一 - 设备扫描/管理页面优化 - agent 插图替换 + 趋势指标图标 配置: - DeepSeek 模型改 deepseek-v4-flash - .gitignore 加 artifacts/audit - build.gradle.kts 签名配置调整
This commit is contained in:
@@ -8,9 +8,11 @@ import 'core/app_theme.dart';
|
||||
import 'core/elder_mode_scope.dart';
|
||||
import 'core/navigation_provider.dart';
|
||||
import 'pages/splash_page.dart';
|
||||
import 'providers/ai_consent_provider.dart';
|
||||
import 'providers/auth_provider.dart';
|
||||
import 'providers/data_providers.dart';
|
||||
import 'providers/elder_mode_provider.dart';
|
||||
import 'widgets/ai_consent_gate.dart';
|
||||
|
||||
/// 健康管家 App 根组件
|
||||
class HealthApp extends ConsumerWidget {
|
||||
@@ -51,7 +53,7 @@ class HealthApp extends ConsumerWidget {
|
||||
child: GestureDetector(
|
||||
behavior: HitTestBehavior.translucent,
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: _BootGate(child: child!),
|
||||
child: AiConsentGate(child: _BootGate(child: child!)),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -71,6 +73,15 @@ final appReadyProvider = Provider<bool>((ref) {
|
||||
if (currentRoute == 'login') return false; // 等根导航切到已登录首页后再撤 Splash
|
||||
final role = auth.user?.role ?? 'User';
|
||||
if (role != 'User') return true; // 医生/管理员首页不依赖今日健康卡
|
||||
final consent = ref.watch(aiConsentProvider);
|
||||
if (consent.userId == auth.user?.id &&
|
||||
!consent.isLoading &&
|
||||
!consent.granted) {
|
||||
return true;
|
||||
}
|
||||
if (currentRoute == 'aiConsentDetails' || currentRoute == 'staticText') {
|
||||
return true;
|
||||
}
|
||||
if (!ref.watch(elderModeProvider).isLoaded) return false;
|
||||
// 普通用户:等今日健康卡片数据(成功或失败都算就绪,避免卡死)
|
||||
final health = ref.watch(latestHealthProvider);
|
||||
|
||||
Reference in New Issue
Block a user