import Vue from 'vue'
import Router from 'vue-router'

import login from './login/index' // 登录
import salesRecord from './salesRecord/index' // 销售记录
import salesGiveOutDetail from './salesGiveOutDetail/index' // 销售发放详情
import cardAndCouponNum from './cardAndCouponNum/index' // 卡券数量信息
import customerSearch from './customerSearch/index' // 客户搜索
import getRecord from './getRecord/index' // 发放详情
import history from './history/index' // 备注历史记录

Vue.use(Router)

const router = new Router({
  routes: [{ // 登录
    path: '/login',
    name: 'login',
    component: login,
    children: []
  }, { // 销售记录
    path: '/salesRecord',
    name: 'salesRecord',
    component: salesRecord,
    children: []
  }, { // 销售发放详情
    path: '/salesGiveOutDetail',
    name: 'salesGiveOutDetail',
    component: salesGiveOutDetail,
    children: []
  }, { // 卡券数量信息
    path: '/cardAndCouponNum',
    name: 'cardAndCouponNum',
    component: cardAndCouponNum,
    children: []
  }, { // 客户搜索
    path: '/customerSearch',
    name: 'customerSearch',
    component: customerSearch,
    children: []
  }, { // 发放详情
    path: '/getRecord',
    name: 'getRecord',
    component: getRecord,
    children: []
  }, { // 备注历史记录
    path: '/history',
    name: 'history',
    component: history,
    children: []
  }],
})

router.beforeEach((to, from, next) => {
  next()
})

export default router
