import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
function getGameTemplateList(templateType){
  if(!templateType){
    return;
  }
  return [
    {
      path: `/cmh/${ templateType }`,
      name: '猜盲盒',
      component: () => import(`@/components/cmh/theme-${ templateType }/index.vue`),
    },
    {
      path: `/cmh/${ templateType }/rule`,
      component: () => import(`@/components/cmh/theme-${ templateType }/rule.vue`),
      name: '游戏规则'
    },
    {
      path: `/cmh/${ templateType }/my-reward`,
      component: () => import(`@/components/cmh/theme-${ templateType }/my-reward.vue`),
      name: '我的奖品'
    },
    {
      path: `/cmh/${ templateType }/support`,
      component: () => import(`@/components/cmh/theme-${ templateType }/support.vue`),
      name: '助力拆盲盒'
    }
  ]
}
const routes = [
  {
    path:'/',
    component: () => import('@/components/index.vue'),
  },
  ...getGameTemplateList(1),
  ...getGameTemplateList(2),
  ...getGameTemplateList(3),
  ...getGameTemplateList(4),
];




const router = new VueRouter({
  base: '/',
  routes,
});

export default router;
