import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'root',
      redirect: '/indexPage',
    },
    {
      path: '/indexPage',
      name: 'indexPage',
      tabBar: true,
      component: () => import('@/views/indexPage/index.vue'),
      children: [
        {
          path: '/indexPage/news',
          name: 'news',
          component: () => import('@/views/indexPage/news.vue'),
        },
        {
          path: '/indexPage/activity',
          name: 'activity',
          component: () => import('@/views/indexPage/activity.vue'),
        },
        {
          path: '/indexPage/visitPreview',
          name: 'visitPreview',
          component: () => import('@/views/indexPage/visitPreview.vue'),
        },
        {
          path: '/indexPage/activePreview',
          name: 'activePreview',
          component: () => import('@/views/indexPage/activePreview.vue'),
        },
        {
          path: '/indexPage/startPreview',
          name: 'startPreview',
          component: () => import('@/views/indexPage/startPreview.vue'),
        },
        {
          path: '/indexPage/activePage',
          name: 'activePage',
          component: () => import('@/views/indexPage/components/activePage.vue'),
        },
        {
          path: '/indexPage/map',
          name: 'map',
          component: () => import('@/views/user/map.vue'),
        },
      ],
    },
    {
      path: '/exhibition',
      name: 'exhibition',
      component: () => import('@/views/exhibition/index.vue'),
    },
    {
      path: '/collection',
      name: 'collection',
      component: () => import('@/views/collection/index.vue'),
    },
    {
      path: '/user',
      name: 'user',
      component: () => import('@/views/user/index.vue'),
    },
    {
      path: '/userList',
      name: 'userList',
      component: () => import('@/views/user/userList.vue'),
    },
    {
      path: '/allDetailsShow',
      name: 'allDetailsShow',
      component: () => import('@/views/exhibition/allDetailsShow.vue'),
    },
    {
      path: '/collectDetail',
      name: 'collectDetail',
      component: () => import('@/views/collection/collectDetail.vue'),
    },
  ],
})

export default router
