import Vue from 'vue'
import Router from 'vue-router'
import login from '@/containers/login/login'
// import Register from '@/containers/register/registation'
import Register from '@/containers/register/register.vue'
import NewInfo from '@/containers/post/info.vue'
import Reset from '@/containers/reset/reset'
import main from '@/containers/main/main'
import center from '@/containers/center/center'

import Play from '@/containers/center/play/index.vue'

import Index from '@/containers/main/index/index'
import Profile from '@/containers/main/profile/profile'

import Apply from '@/containers/main/apply/apply'
import PostList from '@/containers/main/post/list'
import PostInfo from '@/containers/main/post/info'
import HelpList from '@/containers/main/help/list'
import AboutMe from '@/containers/main/about/aboutMe'

import Verify from '@/containers/main/verify/index'

import CenterHome from '@/containers/center/home/index'
import CenterSetting from '@/containers/center/setting/index'
import CenterTrain from '@/containers/center/class/train/index'
import CenterOffline from '@/containers/center/class/offline/index'

import CenterStudyArchives from '@/containers/center/studyArchives/index'
import CenterMyNotes from '@/containers/center/myNotes/index'
import CenterMyOrder from '@/containers/center/myOrder/index'
import CenterMessage from '@/containers/center/message/index'
import CenterSign from '@/containers/center/sign/index'
import PublicApply from '@/containers/apply/index'
import PublicSign from '@/containers/sign/index'
import PublicWeixin from '@/containers/weixin/index'

import CenterMarket from '@/containers/center/market/index'
import CenterTrainMarket from '@/containers/center/market/trainIndex'
import CenterExam from '@/containers/center/exam/index'
import CenterExamTest from '@/containers/center/exam/indexTest'
import CenterExamScore from '@/containers/center/exam/score'
import CenterExamDownload from '@/containers/center/exam/download'

import CenterUserSeat from '@/containers/center/userSeat/index'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      name: 'login',
      meta:{
        keepAlive: true,
      },
      component: login,
    },
    {
      path: '/register',
      name: 'register',
      component: Register,
    },
    {
      path: '/sign',
      name: 'sign',
      component: PublicSign,
    },
    {
      path: '/apply',
      name: 'apply',
      component: PublicApply,
    },
    {
      path: '/weixin',
      name: 'weixin',
      component: PublicWeixin,
    },
    {
      path: '/news',
      name: 'news',
      component: NewInfo,
    },
    {
      path: '/reset',
      name: 'reset',
      component: Reset,
    },


    {
      path: '/main',
      name: 'main',
      component: main,
      children: [{
          path: 'index',
          component: Index,
        },

        {
          path: 'about',
          component: AboutMe,
        },
        {
          path: 'profile',
          component: Profile,
        },
        {
          path: 'apply',
          component: Apply,
        },
        {
          path: 'postlist/:type',
          component: PostList,
        },
        {
          path: 'post/:postId',
          component: PostInfo,
        },
        {
          path: 'help',
          component: HelpList,
        },
        {
          path: 'verify',
          component: Verify,
        }
      ]
    },

    {
      path: '/center',
      name: 'center',
      component: center,
      children: [{
          path: 'home',
          component: CenterHome,
        },
        {
          path: 'class/train',
          component: CenterTrain,
        },
        {
          path: 'class/offline',
          component: CenterOffline,
        },
        {
          path: 'play/:courseId',
          name: 'play',
          component: Play,
        },
        {
          path: 'studyArchives',
          component: CenterStudyArchives,
        },
        {
          path: 'myOrder',
          component: CenterMyOrder,
        },
        {
          path: 'myNotes',
          component: CenterMyNotes,
        },
        {
          path: 'message',
          component: CenterMessage,
        },
        {
          path: 'examTest/:courseId',
          component: CenterExam,
        },
        {
          path: 'exam/:courseId',
          component: CenterExamTest,
        },
        {
          path: 'market',
          component: CenterMarket,
        },
        {
          path: 'trainMarket',
          component: CenterTrainMarket,
        },
        {
          path: 'sign',
          component: CenterSign,
        },
        {
          path: 'setting',
          component: CenterSetting,
        },
        {
          path: 'examSeat',
          component: CenterUserSeat,
        },
        {
          path: 'examScore',
          component: CenterExamScore,
        },
        {
          path: 'examDownload',
          component: CenterExamDownload,
        }
      ],
    }
  ]
})
