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: '超级会员列表' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/member/member/list.vue'),
          name: 'MemberList',
          meta: { title: '会员列表', activeMenu: '/finance/member' }
        },
        {
          path: 'record-list',
          hidden: true,
          component: () => import('@/views/member/member/record-list.vue'),
          name: 'MemberRecordList',
          meta: { title: '购买记录', activeMenu: '/member/member' }
        }
      ]
    },
    {
      path: 'coupon',
      component: () => import('@/views/index'),
      redirect: '/member/coupon/list',
      name: 'MemberCoupon',
      meta: { title: '超级会员专属优惠券' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/member/coupon/list.vue'),
          name: 'MemberCouponList',
          meta: { title: '优惠券列表', activeMenu: '/member/coupon' }
        },
        {
          path: 'edit',
          hidden: true,
          component: () => import('@/views/member/coupon/edit.vue'),
          name: 'MemberEdit',
          meta: { title: '编辑优惠券', activeMenu: '/member/coupon' }
        }
      ]
    },
    {
      path: 'product',
      component: () => import('@/views/index'),
      redirect: '/member/product/list',
      name: 'MemberProduct',
      meta: { title: '超级会员优惠商品' },
      children: [
        {
          path: 'list',
          hidden: true,
          component: () => import('@/views/member/product/list.vue'),
          name: 'MemberProductList',
          meta: { title: '优惠商品', activeMenu: '/member/product' }
        }
      ]
    },
    {
      path: 'meal',
      component: () => import('@/views/index'),
      redirect: '/member/meal/list',
      name: 'MemberMeal',
      meta: { title: '超级会员套餐配置' },
      children: [
        {
          path: 'edit',
          hidden: true,
          component: () => import('@/views/member/meal/form.vue'),
          name: 'MemberMealEdit',
          meta: { title: '套餐配置', activeMenu: '/member/meal' }
        }
      ]
    }
  ]
}
export default memberRouter
