mobile.routes.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { Routes } from '@angular/router';
  2. /**
  3. * 移动端路由树(ADR-004:双端双套)
  4. *
  5. * ⚠️ 会话详情与数字生命详情在 **shell 外**(全屏路由)——
  6. * 若放进 shell 子路由并用 `**` 兜底,会吞掉全屏路由
  7. * (存量为此踩过坑,此处刻意规避)。
  8. */
  9. export const mobileRoutes: Routes = [
  10. // ---- 全屏路由(不带底部 TabBar)----
  11. {
  12. path: 'chat/:id',
  13. loadComponent: () => import('./pages/chat/chat').then((m) => m.MbChatPage),
  14. },
  15. {
  16. path: 'agent/:id',
  17. loadComponent: () => import('./pages/agent/agent').then((m) => m.MbAgentPage),
  18. },
  19. {
  20. path: 'tasks/:id',
  21. loadComponent: () => import('./pages/tasks/task-detail').then((m) => m.MbTaskDetailPage),
  22. },
  23. {
  24. path: 'tasks',
  25. loadComponent: () => import('./pages/tasks/tasks').then((m) => m.MbTasksPage),
  26. },
  27. // ---- 带 TabBar 的常规页面 ----
  28. {
  29. path: '',
  30. loadComponent: () => import('./shell/mobile-shell').then((m) => m.MobileShellComponent),
  31. children: [
  32. { path: '', pathMatch: 'full', redirectTo: 'home' },
  33. {
  34. path: 'home',
  35. loadComponent: () => import('./pages/home/home').then((m) => m.MbHomePage),
  36. },
  37. {
  38. path: 'messages',
  39. loadComponent: () => import('./pages/messages/messages').then((m) => m.MbMessagesPage),
  40. },
  41. {
  42. path: 'contacts',
  43. loadComponent: () => import('./pages/contacts/contacts').then((m) => m.MbContactsPage),
  44. },
  45. {
  46. path: 'projects',
  47. loadComponent: () => import('./pages/projects/projects').then((m) => m.MbProjectsPage),
  48. },
  49. {
  50. path: 'projects/:id',
  51. loadComponent: () => import('./pages/projects/projects').then((m) => m.MbProjectsPage),
  52. },
  53. {
  54. path: 'events',
  55. loadComponent: () => import('./pages/events/events').then((m) => m.MbEventsPage),
  56. },
  57. {
  58. path: 'workbench',
  59. loadComponent: () => import('./pages/workbench/workbench').then((m) => m.MbWorkbenchPage),
  60. },
  61. {
  62. path: 'deliverables',
  63. loadComponent: () =>
  64. import('./pages/deliverables/deliverables').then((m) => m.MbDeliverablesPage),
  65. },
  66. {
  67. path: 'mine',
  68. loadComponent: () => import('./pages/mine/mine').then((m) => m.MbMinePage),
  69. },
  70. // 🔴 此处**不能**使用 `**` 兜底:会吞掉 shell 外的全屏路由
  71. { path: '**', redirectTo: 'home' },
  72. ],
  73. },
  74. ];