import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { authGuard } from 'src/modules/user/auth.guard';

const routes: Routes = [
  {
    path:'',
    // redirectTo:"tabs/tab1",
    // pathMatch:'full',
    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule),
  },
  {

    path: 'user',
    loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
  },
  {
    path:"feiwu",
    children:[
      {
        path: 'book',
        loadChildren: () => import('../modules/feiwu/book/book.module').then( m => m.BookPageModule)
      },
       {
        path: 'fiml',
         loadChildren: () => import('../modules/feiwu/fiml/fiml.module').then( m => m.FimlPageModule)
       },
     
      {
        path: 'music',
        loadChildren: () => import('../modules/feiwu/music/music.module').then( m => m.MusicPageModule)
      },
      {
        path: 'game',
        loadChildren: () => import('../modules/feiwu/game/game.module').then( m => m.GamePageModule)
      },
      {
        path: 'outdoor',
        loadChildren: () => import('../modules/feiwu/outdoor/outdoor.module').then( m => m.OutdoorPageModule)
      },
      {
        path: 'film-detail/:id',
        loadChildren: () => import('../modules/feiwu/film-detail/film-detail.module').then( m => m.FilmDetailPageModule)
      },
      {
        path: 'book-detail/:id',
        loadChildren: () => import('../modules/feiwu/book-detail/book-detail.module').then( m => m.BookDetailPageModule)
      },

      {
        path: 'music-detail/:id',
        loadChildren: () => import('../modules/feiwu/music-detail/music-detail.module').then( m => m.MusicDetailPageModule)
      },
      {
        path: 'game-detail/:id',
        loadChildren: () => import('../modules/feiwu/game-detail/game-detail.module').then( m => m.GameDetailPageModule)
      },
      {
        path: 'outdoor-detail/:id',
        loadChildren: () => import('../modules/feiwu/outdoor-detail/outdoor-detail.module').then( m => m.OutdoorDetailPageModule)
      },
    ]  

  },
  {
    path: 'dongt',
    canActivate:[authGuard],
    loadChildren: () => import('../modules/dongt/dongt.module').then( m => m.DongtPageModule)
  },
  {
    path: 'favorites',
    canActivate:[authGuard],
    loadChildren: () => import('../modules/favorites/favorites.module').then( m => m.FavoritesPageModule)
  },
  {
    path: 'album',
    canActivate:[authGuard],
    loadChildren: () => import('../modules/album/album.module').then( m => m.AlbumPageModule)
  },
  
  
 
];
@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }),
    
 
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {}
