import Layout from '@/layout/index.vue'
import { FieldName, SmUserType } from '@/utils/constants'

/**
 * 商户中心路由
 */
export const agentRouter = [
  {
    path: '/user',
    component: Layout,
    hidden: false,
    alwaysShow: true,
    meta: {
      title: '推广管理',
      icon: 'user'
    },
    children: [
      {
        path: 'agent',
        component: () => import('@/views/mch/user/index.vue'),
        hidden: false,
        name: "MchUser",
        meta: {
          noCache: false,
          title: `${FieldName.AGENT}列表`,
          icon: 'user',
          userType: SmUserType.AGENT
        }
      },
      {
        path: 'biz',
        component: () => import('@/views/mch/user/index.vue'),
        hidden: false,
        name: "MchUser",
        meta: {
          noCache: false,
          title: `${FieldName.BIZ}列表`,
          icon: 'user',
          userType: SmUserType.BIZ
        }
      },
      {
        path: 'investor',
        component: () => import('@/views/mch/user/index.vue'),
        hidden: false,
        name: "MchUser",
        meta: {
          noCache: false,
          title: `${FieldName.INVESTOR}列表`,
          icon: 'user',
          userType: SmUserType.INVESTOR
        }
      },
      {
        path: 'storeInvestor',
        component: () => import('@/views/mch/storeInvestor/index.vue'),
        hidden: false,
        name: "StoreInvestor",
        meta: {
          noCache: false,
          title: `合作场所列表`,
          icon: 'store'
        }
      },
      {
        path: 'shareCode',
        component: () => import('@/views/mch/shareCode/index.vue'),
        hidden: false,
        name: "MchShareCode",
        meta: {
          noCache: false,
          title: `推广码`,
          icon: 'qrcode'
        }
      },
      {
        path: ':userId',
        component: () => import('@/views/mch/user/detail.vue'),
        hidden: true,
        name: "User/:userId",
        meta: {
          noCache: false,
          title: `用户详情`,
          icon: 'user'
        }
      },
    ]
  },
  {
    path: '/business',
    component: Layout,
    hidden: false,
    alwaysShow: true,
    meta: {
      title: '经营管理',
      icon: 'store'
    },
    children: [
      {
        path: 'suit',
        component: () => import('@/views/mch/suit/index.vue'),
        hidden: false,
        name: "MchSuit",
        meta: {
          noCache: false,
          title: '收费模板',
          icon: 'suit',
        }
      },
    ]
  },
  {
    path: '/device',
    component: Layout,
    hidden: false,
    alwaysShow: true,
    meta: {
      title: '设备管理',
      icon: 'monitor',
    },
    children: [
      {
        path: '',
        component: () => import('@/views/mch/device'),
        hidden: false,
        name: "MyDevice",
        meta: {
          noCache: false,
          title: '我的设备',
          icon: 'monitor',
        }
      },
      {
        path: ':deviceId',
        component: () => import('@/views/mch/device/detail.vue'),
        hidden: true,
        name: "MyDeviceDetail",
        meta: {
          noCache: false,
          title: '设备详情',
        }
      },
    ]
  },
  {
    path: '/bill',
    component: Layout,
    hidden: false,
    alwaysShow: true,
    meta: {
      title: '订单管理',
      icon: 'shopping'
    },
    children: [
      {
        path: 'recharge',
        component: () => import('../views/mch/recharge'),
        hidden: false,
        name: "MchRecharge",
        meta: {
          noCache: false,
          title: '订单列表',
          icon: 'shopping'
        }
      },
      {
        path: 'recharge/:billId',
        component: () => import('@/views/mch/recharge/detail.vue'),
        hidden: true,
        name: "MchRechargeDetail",
        meta: {
          noCache: false,
          title: '订单详情',
        }
      },
    ]
  },
  {
    path: '/money',
    component: Layout,
    hidden: false,
    alwaysShow: true,
    meta: {
      title: '财务管理',
      icon: 'money'
    },
    children: [
      {
        path: 'withdraw',
        component: () => import('@/views/mch/withdraw/index.vue'),
        hidden: false,
        name: "MchWithdraw",
        meta: {
          noCache: false,
          title: '提现记录',
          icon: 'withdraw'
        }
      },
      {
        path: 'recordBalance',
        component: () => import('@/views/mch/recordBalance/index.vue'),
        hidden: false,
        name: "MchRecordBalance",
        meta: {
          noCache: false,
          title: '财务记录',
          icon: 'money',
        }
      },
    ]
  },
]
