const paymentType = (window as any).paymentType
import { RouteRecordRaw } from 'vue-router'

// 需要登录的路由
export const router: RouteRecordRaw[] = [
  {
    path: '/lessonCourseware',
    name: 'lessonCourseware',
    component: () => import('@/views/lessonCourseware/index'),
    meta: {
      title: '选择课件'
    }
  },
  {
    path: '/courseList',
    name: 'courseList',
    component: () => import('@/views/courseList/index'),
    meta: {
      title: '课程列表'
    }
  },
  {
    path: '/coursewarePlay',
    name: 'coursewarePlay',
    component: () => import('@/views/coursewarePlay/index'),
    meta: {
      title: '课程播放'
    }
  },
  {
    path: '/exerciseAfterClass',
    name: 'exerciseAfterClass',
    component: () => import('@/views/exercise-after-class/index'),
    meta: {
      title: '观看视频'
    }
  },
  {
    path: '/accompany',
    name: 'accompany',
    component: () => import('@/views/accompany/index'),
    meta: {
      title: '云教练'
    },
    children: [
      {
        path: '',
        name: 'category',
        component: () => import('@/views/accompany/category')
      },
      {
        path: 'musicList',
        name: 'music-list',
        component: () => import('@/views/accompany/music-list')
      },
    ]
  },
  {
    path: '/information-detail',
    name: 'information-detail',
    component: () => import('@/views/information/information-detail'),
    meta: {
      title: '资讯详情'
    }
  },
  {
    path: '/notice-detail',
    name: 'notice-detail',
    component: () => import('@/views/information/notice-detail'),
    meta: {
      title: '公告详情'
    }
  },
  {
    path: '/help-center',
    name: 'help-center',
    component: () => import('@/views/information/help-center'),
    meta: {
      title: '帮助中心'
    }
  },
  {
    path: '/unit-test',
    name: 'unit-test',
    component: () => import('@/views/unit-test'),
    meta: {
      title: '单元测验'
    }
  },
  {
    path: '/unit-detail',
    name: 'unit-detail',
    component: () => import('@/views/unit-test/unit-detail'),
    meta: {
      title: '测验详情'
    }
  }
]

// 不需要登录的路由
export const rootRouter = [
  {
    path: '/payCenter',
    name: 'payCenter',
    component: () => import('@/views/adapay/pay-center'),
    meta: {
      title: '支付'
    }
  },
  {
    path: '/payDefine',
    name: 'payDefine',
    component: () => import('@/views/adapay/pay-define'),
    meta: {
      title: '支付'
    }
  },
  {
    path: '/payResult',
    name: 'payResult',
    component: () => import('@/views/adapay/pay-result'),
    meta: {
      title: '支付'
    }
  },
  {
    path: '/preview-protocol',
    name: 'preview-protocol',
    component: () => import('@/views/preview-protocol/index'),
    meta: {
      title: '管乐团用户注册协议'
    }
  },
  {
    path: '/privacyProtocol',
    name: 'privacyProtocol',
    component: () => import('@/views/preview-protocol/privacy'),
    meta: {
      title: '管乐团隐私政策'
    }
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/404'),
    meta: {
      title: '404 Not Fund',
      platform: paymentType
    }
  }
]
