import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import PointsRank from '../views/PointsRank.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/home',
  },
  {
    path: '/home',
    component: HomeView,
    redirect:'/home/index',
    children: [
      {
        path: '/home/index',
        component: () => import('@/views/HomeView/Index.vue'),
        meta: {
          index: 1
        }
      },
      {
        path: '/home/index/msgDetail',
        component: () => import('@/views/HomeView/MsgDetail.vue')
      },
      {
        path: '/home/signIn',
        component: () => import('@/views/HomeView/SignIn.vue')
      },
      {
        path: '/home/myMedal',
        component: () => import('@/views/HomeView/MyMedal.vue')
      },
      {
        path: '/home/commend',
        component: () => import('@/views/HomeView/Commend.vue')
      },
      {
        path: '/home/commend/commendDetail',
        component: () => import('@/views/HomeView/CommendDetail.vue')
      },
      {
        path: '/home/douYinYeZhanZan',
        component: () => import('@/views/HomeView/DouYinYeZhanZan.vue')
      },
      {
        path: '/home/earnPoints',
        component: () => import('@/views/HomeView/EarnPoints.vue')
      },
      {
        path: '/home/citeList',
        component: () => import('@/views/HomeView/CiteList.vue')
      },
      {
        path: '/home/pointsMall',
        component: () => import('@/views/HomeView/PointsMall.vue')
      },
      {
        path: '/home/pointsMall/redeem',
        component: () => import('@/views/HomeView/RedeemView.vue')
      },
      // {
      //   path: '/home/myCenter/goodsDetail',
      //   component: () => import('@/views/HomeView/GoodsDetail.vue')
      // },
      {
        path: '/home/pointsMall/goodDetail',
        component: () => import('@/views/HomeView/GoodDetail.vue')
      },
      {
        path: '/home/welfareList',
        component: () => import('@/views/HomeView/WelfareList.vue')
      },
      {
        path: '/home/myCenter',
        component: () => import('@/views/HomeView/MyCenter.vue')
      },
      {
        path: '/home/festiveEvents',
        component: () => import('@/views/HomeView/FestiveEvents.vue')
      },
      {
        path: '/home/festiveEvents/game',
        component: () => import('@/views/HomeView/Game.vue')
      },
      {
        path: '/home/festiveEvents/yuanXiaoQianDao',
        component: () => import('@/views/HomeView/AnswerGame/YuanXiaoQianDao.vue')
      },
      {
        path: '/home/festiveEvents/yuanDanQianDao',
        component: () => import('@/views/HomeView/AnswerGame/YuanDanQianDao.vue')
      },
      {
        path: '/home/festiveEvents/siQingRiQianDao',
        component: () => import('@/views/HomeView/AnswerGame/SiQingRiQianDao.vue')
      },
      {
        path: '/home/festiveEvents/shuangShiYiQianDao',
        component: () => import('@/views/HomeView/AnswerGame/ShuangShiYIQianDao.vue')
      },
      {
        path: '/home/festiveEvents/guoQingQianDao',
        component: () => import('@/views/HomeView/AnswerGame/GuoQingQianDao.vue')
      },
      {
        path: '/home/festiveEvents/zhongQiuQianDao',
        component: () => import('@/views/HomeView/AnswerGame/ZhongQiuQianDao.vue')
      },
      {
        path: '/home/festiveEvents/kaijiangSpecial',
        component: () => import('@/views/HomeView/AnswerGame/KaijiangSpecial.vue')
      },
      {
        path: '/home/festiveEvents/weekKaijiang',
        component: () => import('@/views/HomeView/AnswerGame/WeekKaijiang.vue')
      },
      {
        path: '/home/festiveEvents/answerGame',
        component: () => import('@/views/HomeView/AnswerGame/AnswerGame.vue')
      },
      {
        path: '/home/festiveEvents/qiXiGame',
        component: () => import('@/views/HomeView/AnswerGame/QiXiAnswerGame.vue')
      },
      {
        path: '/home/festiveEvents/lanternFestival',
        component: () => import('@/views/HomeView/AnswerGame/LanternFestival.vue')
      },
      {
        path: '/home/festiveEvents/wuYiDaTi',
        component: () => import('@/views/HomeView/AnswerGame/WuYiDaTi.vue')
      },
      {
        path: '/home/festiveEvents/drawCarouselGame',
        component: () => import('@/views/HomeView/DrawCarouselGame/DrawCarouselGame.vue')
      },
      {
        path: '/home/postInteract',
        component: () => import('@/views/HomeView/postInteract/list.vue')
      },
      {
        path: '/home/postInteract/detail',
        component: () => import('@/views/HomeView/postInteract/detail.vue')
      },
    ]
  },
  {
    path: '/noticeCenter',
    component: () => import('../views/NoticeCenter.vue'),
    meta: {
      index: 2
    }
  },
  {
    path: '/myCenter',
    component: () => import('@/views/HomeView/MyCenter.vue'),
    meta: {
      index: 3
    }
  },
  {
    path: '/myCenter/goodsDetail',
    component: () => import('@/views/HomeView/GoodsDetail.vue')
  },
  {
    path: '/ipay',
    component: () => import('../views/Ipay.vue'),
  },
  {
    path: '/pointsRank',
    component: PointsRank,
    redirect:'/pointsRank/present',
    children: [
      {
        path: '/pointsRank/present',
        component: () => import('@/views/PointsRank/Present.vue')
      },
      {
        path: '/pointsRank/history',
        component: () => import('@/views/PointsRank/History.vue')
      },
    ]
  }
]

const router = new VueRouter({
  // mode: 'history',
  linkActiveClass:'route-active',
  routes,
})

export default router
