import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/login/index.vue'

const routes = [

  // {
  //   path: '/home',
  //   name: '首页',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import('../views/home/index')
  // },
  {
    path: '/',
    name: '首页',
    component: () => import('../views/layout/index'),
    redirect: '/home',
    children:[
      {
        path: '/home',
        name: '首页',
        component: () => import('../views/home/index'),

      },
      {
        path: '/welcome',
        name: 'welcome',
        component: () => import('../views/welcome/index')
      },

      {
        path: '/busines',
        name: '商家',
        component: () => import('../views/business/index'),

      },
      {
        path: '/businesVerify',
        name: '审核商家',
        component: () => import('../views/business/verify/index.vue'),
      },
      {
        path: '/product',
        name: '商品管理',
        component: () => import('../views/product/index')
      },
      {
        path: '/productCategory',
        name: '商品分类',
        component: () => import('../views/category/index')
      },
      {
        path: '/businessProduct',
        name: '商家商品',
        component: () => import('../views/businessProduct/index')
      },
      {
        path: '/message',
        name: '消息通知',
        component: () => import('../views/message/index')
      },
      {
        path: '/user',
        name: '用户',
        component: () => import('../views/user/index')
      },
      {
        path: '/permission',
        name: '用户权限',
        component: () => import('../views/permission/index')
      },
      {
        path: '/employee',
        name: '美甲师',
        component: () => import('../views/employee/index')
      },
      {
        path: '/employeeVerify',
        name: '审核美甲师',
        component: () => import('../views/employee/verify/index.vue'),
      },
      {
        path: '/modifyPassword',
        name: '修改密码',
        component: () => import('../views/modifyPassword/index')
      },
      {
        path: '/order',
        name: '订单',
        component: () => import('../views/order/index')
      },
      {
        path: '/orderReservation',
        name: '上门预约',
        component: () => import('../views/order/reservation/index.vue')
      },
      {
        path: '/personal',
        name: '个人中心',
        component: () => import('../views/personalCenter/index')
      },
      {
        path: '/business',
        name: '商家',
        component: () => import('../views/business/index')
      },
      {
        path: '/rating',
        name: '评价列表',
        component: () => import('../views/rating/index')
      },
      {
        path: '/profile',
        name: '详情',
        component: () => import('../views/profile/index')
      },

    ]
  },
  {
    path: '/login',
    name: 'login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import( '../views/login/index.vue')
  },
  {
    path: '/test',
    name: 'test',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import( '../views/test/index.vue')
  }

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
