import Auth from '@/student/layout/auth'
import { router, rootRouter } from './routes-common'

type metaType = {
  isRegister: boolean
}

export default [
  {
    path: '/',
    component: Auth,
    children: [
      ...router,
      {
        path: '/login',
        name: 'login',
        component: () => import('@/student/layout/login'),
        meta: {
          isRegister: false
        } as metaType
      },
      {
        path: '/home',
        name: 'home',
        component: () => import('@/student/home/index')
      },
      {
        path: '/practiceClass',
        name: 'practiceClass',
        component: () => import('@/student/practice-class/index'),
        meta: {
          title: '陪练课'
        }
      },
      {
        path: '/videoClass',
        name: 'videoClass',
        component: () => import('@/student/video-class/index'),
        meta: {
          title: '视频课'
        }
      },
      {
        path: '/videoDetail',
        name: 'videoDetail',
        component: () => import('@/student/video-class/video-detail'),
        meta: {
          title: '视频课'
        }
      },
      {
        path: '/videoClassDetail',
        name: 'videoClassDetail',
        component: () => import('@/student/video-class/video-class-detail'),
        meta: {
          title: '视频课详情'
        }
      },
      {
        path: '/liveClass',
        name: 'liveClass',
        component: () => import('@/student/live-class/index'),
        meta: {
          title: '直播课'
        }
      },
      {
        path: '/liveDetail',
        name: 'liveDetail',
        component: () => import('@/student/live-class/live-detail'),
        meta: {
          title: '直播课详情'
        }
      },
      {
        path: '/memberCenter',
        name: 'memberCenter',
        component: () => import('@/student/member-center/index'),
        meta: {
          title: '会员中心'
        }
      },
      {
        path: '/memberRecord',
        name: 'memberRecord',
        component: () => import('@/student/member-center/member-record'),
        meta: {
          title: '训练统计'
        }
      },
      {
        path: '/tradeRecord',
        name: 'tradeRecord',
        component: () => import('@/student/trade/index'),
        meta: {
          title: '交易记录'
        }
      },
      {
        path: '/teacherHome',
        name: 'teacherHome',
        component: () => import('@/student/teacher-dependent/teacher-home'),
        meta: {
          title: '老师主页'
        }
      },
      {
        path: '/teacherElegant',
        name: 'teacherElegant',
        component: () => import('@/student/teacher-dependent/teacher-elegant'),
        meta: {
          title: '老师风采'
        }
      },
      {
        path: '/music-songbook',
        component: () => import('@/student/music/search/header'),
        meta: {
          title: '乐谱顶部'
        },
        children: [
          {
            path: '/music-songbook/search',
            name: 'musicSearch',
            component: () => import('@/student/music/search'),
            meta: {
              title: '搜索结果'
            }
          },
          {
            path: '',
            name: 'musicSongbook',
            component: () => import('@/student/music/songbook'),
            meta: {
              title: '乐谱库'
            }
          }
        ]
      },
      // {
      //   path: '/music-songbook',
      //   component: () => import('@/student/music/songbook'),
      //   meta: {
      //     title: '乐谱库'
      //   }
      // },
      {
        path: '/music-album',
        component: () => import('@/student/music/album/index'),
        meta: {
          title: '专辑'
        }
      },
      {
        path: '/music-album-detail/:id',
        component: () => import('@/student/music/album-detail'),
        meta: {
          title: '专辑详情'
        }
      },
      {
        path: '/music-list',
        component: () => import('@/student/music/list'),
        meta: {
          title: '曲谱列表'
        }
      },
      {
        path: '/music-search',
        component: () => import('@/student/music/search'),
        meta: {
          title: '搜索结果'
        }
      },
      {
        path: '/music-personal',
        component: () => import('@/student/music/personal'),
        meta: {
          title: '我的乐谱'
        }
      },
      {
        path: '/music-upload',
        component: () => import('@/teacher/music/upload'),
        meta: {
          title: '上传曲谱'
        }
      },
      {
        path: '/teacherFollow',
        component: () => import('@/student/teacher-dependent/teacher-follow'),
        meta: {
          title: '我的关注'
        }
      }
    ]
  },
  ...rootRouter,
  {
    path: '/inviteTeacher',
    name: 'inviteTeacher',
    component: () => import('@/student/invite-teacher/index'),
    meta: {
      title: '邀请学员'
    }
  },
  {
    path: '/inviteSuccess',
    name: 'inviteSuccess',
    component: () => import('@/student/invite-teacher/invite-success'),
    meta: {
      title: '注册成功'
    }
  },
  {
    path: '/transfer',
    component: () => import('@/student/down-load/transfer'),
    meta: {
      title: '酷乐秀学院'
    }
  },
  {
    path: '/download',
    component: () => import('@/student/down-load/download')
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/404'),
    meta: {
      title: '404 Not Fund',
      platform: 'STUDENT'
    }
  }
]
