import Layout from '@/layout'

const memberRouter = {
  path: '/member',
  component: Layout,
  redirect: '/member/member',
  alwaysShow: true, // will always show the root menu
  name: 'MemberSetting', // name必须和后台配置一致，不然匹配不到
  meta: { title: '会员管理', icon: 'component' },
  children: [
    {
      path: 'member',
      component: () => import('@/views/index'),
      redirect: '/member/member/list',
      name: 'MemberManage',
      meta: { title: '超级会员列表', icon: 'documentation' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/member/member/list.vue'),
          name: 'MemberList',
          meta: { title: '超级会员列表', activeMenu: '/member/member' }
        },
        {
          path: 'edit',
          hidden: true,
          component: () => import('@/views/member/member/form.vue'),
          name: 'MemberEdit',
          meta: { title: '赠送会员', activeMenu: '/member/member' }
        },
        {
          path: 'record-list',
          hidden: true,
          component: () => import('@/views/member/member/record-list.vue'),
          name: 'MemberRecord',
          meta: { title: '购买记录', activeMenu: '/member/member/' }
        }
      ]
    },
    {
      path: 'coupon',
      component: () => import('@/views/index'),
      redirect: '/member/coupon/list',
      name: 'MemberManage',
      meta: { title: '超级会员专属优惠券', icon: 'documentation' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/member/coupon/list.vue'),
          name: 'MemberCoupon',
          meta: { title: '超级会员专属优惠券', activeMenu: '/member/coupon' }
        },
        {
          path: 'detail',
          hidden: true,
          component: () => import('@/views/member/coupon/detail.vue'),
          name: 'MemberDetail',
          meta: { title: '超级会员专属优惠券', activeMenu: '/member/coupon/' }
        }
      ]
    },
    {
      path: 'product',
      component: () => import('@/views/index'),
      redirect: '/member/product/list',
      name: 'MemberManage',
      meta: { title: '超级会员优惠商品', icon: 'documentation' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/member/product/list.vue'),
          name: 'MemberProduct',
          meta: { title: '超级会员优惠商品', activeMenu: '/member/product' }
        }
      ]
    },
    {
      path: 'meal',
      component: () => import('@/views/index'),
      redirect: '/member/meal/list',
      name: 'MemberManage',
      meta: { title: '超级会员套餐配置', icon: 'documentation' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/member/meal/index.vue'),
          name: 'MemberMeal',
          meta: { title: '超级会员套餐配置', activeMenu: '/member/meal' }
        }
      ]
    }
  ]
}
export default memberRouter
