import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  {
    path: '',
    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
  },
  {
    path: 'appointment',
    loadChildren: () => import('./appointment/appointment.module').then(m => m.AppointmentPageModule)
  },
  {
    path: 'consultation',
    loadChildren: () => import('./consultation/consultation.module').then(m => m.ConsultationPageModule)
  },
  {
    path: 'details',
    loadChildren: () => import('./details/details.module').then(m => m.DetailsPageModule)
  },
  {
    path: 'edit-profile',
    loadChildren: () => import('./edit-profile/edit-profile.module').then(m => m.EditProfilePageModule)
  },
  {
    path: 'health-record',
    loadChildren: () => import('./health-record/health-record.module').then(m => m.HealthRecordPageModule)
  },
  {
    path: 'annual-checkup/:index', // 添加 :index 参数
    loadChildren: () => import('./annual-checkup/annual-checkup.module').then(m => m.AnnualCheckupPageModule)
  },
  {
    path: 'eye-exam/:index', // 添加 :index 参数
    loadChildren: () => import('./eye-exam/eye-exam.module').then(m => m.EyeExamPageModule)
  },
  {
    path: 'faq',
    loadChildren: () => import('./faq/faq.module').then( m => m.FaqPageModule)
  },
  {
    path: 'feedback',
    loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule)
  },
  {
    path: 'invite-friends',
    loadChildren: () => import('./invite-friends/invite-friends.module').then( m => m.InviteFriendsPageModule)
  },
  {
    path: 'manage-family',
    loadChildren: () => import('./manage-family/manage-family.module').then( m => m.ManageFamilyPageModule)
  },
  {
    path: 'case',
    loadChildren: () => import('./case/case.module').then( m => m.CasePageModule)
  },
  {
    path: 'case-detail/:id', // 使用 :id 参数来标识具体的病例
    loadChildren: () => import('./case-detail/case-detail.module').then( m => m.CaseDetailPageModule)
  },
  {
    path: 'health-news',
    loadChildren: () => import('./health-news/health-news.module').then( m => m.HealthNewsPageModule)
  },
  {
    path: 'news-detail',
    loadChildren: () => import('./news-detail/news-detail.module').then( m => m.NewsDetailPageModule)
  },
  {
    path: 'medicine-purchase',
    loadChildren: () => import('./medicine-purchase/medicine-purchase.module').then( m => m.MedicinePurchasePageModule)
  },
  {
    path: 'medicine-detail/:id', // 添加 :id 参数以匹配具体药品ID
    loadChildren: () => import('./medicine-detail/medicine-detail.module').then( m => m.MedicineDetailPageModule)
  },
  {
    path: 'expert-lectures',
    loadChildren: () => import('./expert-lectures/expert-lectures.module').then( m => m.ExpertLecturesPageModule)
  },
  {
    path: 'health-community',
    loadChildren: () => import('./health-community/health-community.module').then( m => m.HealthCommunityPageModule)
  },
  {
    path: 'new-post',
    loadChildren: () => import('./new-post/new-post.module').then( m => m.NewPostPageModule)
  },
  {
    path: 'orders',
    loadChildren: () => import('./orders/orders.module').then( m => m.OrdersPageModule)
  },
  {
    path: 'promotions',
    loadChildren: () => import('./promotions/promotions.module').then( m => m.PromotionsPageModule)
  },
  {
    path: 'medical-services',
    loadChildren: () => import('./medical-services/medical-services.module').then( m => m.MedicalServicesPageModule)
  },
  {
    path: 'points-and-coupons',
    loadChildren: () => import('./points-and-coupons/points-and-coupons.module').then( m => m.PointsAndCouponsPageModule)
  }



];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {}