import { ROLE_CODE } from '@constants/user'

const icons = {
  homepage: require('@assets/mine/homepage.png'),
  recommend: require('@assets/mine/recommend.png'),
  development: require('@assets/mine/development.png'),
  activities: require('@assets/mine/activities.png'),
  regiment: require('@assets/mine/regiment.png'),
  help: require('@assets/mine/help.png'),
  collection: require('@assets/mine/collection.png'),
  exchange: require('@assets/mine/exchange.png'),
  profile: require('@assets/mine/profile.png'),
  calculator: require('@assets/mine/calculator.png'),
  encyclopedia: require('@assets/mine/encyclopedia.png'),
  feedback: require('@assets/mine/feedback.png'),
  client: require('@assets/mine/client.png'),
  consultant: require('@assets/mine/consultant.png'),
}

const DRIFT = ROLE_CODE['DRIFT']
const CUSTOMER = ROLE_CODE['CUSTOMER']
const CONSULTANT = ROLE_CODE['CONSULTANT']
const ESTATE_AGENT = ROLE_CODE['ESTATE_AGENT']
const CHANNEL_AGENT = ROLE_CODE['CHANNEL_AGENT']

const menus = [
  [
    // {
    //   name: '我的主页',
    //   url: '/pages/agent/index',
    //   icon: icons.homepage,
    //   extends: undefined,
    //   userTypes: [ESTATE_AGENT, CHANNEL_AGENT],
    // },
    {
      name: '我的主页',
      url: ({ id }) => `/pages/card/index?id=${id}`,
      icon: icons.homepage,
      extends: undefined,
      userTypes: [CONSULTANT],
      style: '',
    },
    {
      name: '盘客工具',
      url: '/pages/person/customerAnalysis/index',
      icon: icons.homepage,
      extends: undefined,
      userTypes: [CONSULTANT, CUSTOMER],
      style: '',
    },
    // {
    //   name: '成为经纪人',
    //   url: '/pages/agent/become/index',
    //   icon: icons.development,
    //   extends: undefined,
    //   userTypes: [CUSTOMER],
    // },
    {
      name: '推荐客户',
      url: '/pages/agent/client/index',
      icon: icons.recommend,
      extends: undefined,
      userTypes: [CUSTOMER, ESTATE_AGENT, CHANNEL_AGENT],
      style: '',
    },
    // {
    //   name: '发展经纪人',
    //   url: '/pages/agent/invitation/index',
    //   icon: icons.development,
    //   extends: undefined,
    //   userTypes: [ESTATE_AGENT, CHANNEL_AGENT],
    // },
  ],
  [
    {
      name: '我的客户',
      url: '/pages/person/myGuest/index',
      icon: icons.client,
      extends: undefined,
      userTypes: [CONSULTANT],
    },
    {
      name: '我的活动',
      url: '/pages/activity/myActivity?from=mine',
      icon: icons.activities,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
    {
      name: '我的拼团',
      url: '/pages/activity/assemblePage',
      icon: icons.regiment,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
    {
      name: '我的助力',
      url: '/pages/activity/assistancePage',
      icon: icons.help,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
  ],
  [
    {
      name: '我的收藏',
      url: '/pages/person/favorite/index',
      icon: icons.collection,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
    {
      name: '我的资料',
      url: '/pages/person/profile/index',
      icon: icons.profile,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
    {
      name: '兑换记录',
      url: '/pages/shop/record/index',
      icon: icons.exchange,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
    {
      name: '房贷计算器',
      url: '/pages/toolKit/index',
      icon: icons.calculator,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
    {
      name: '购房百科',
      url: '/pages/policy/index?from=mine',
      icon: icons.encyclopedia,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
    {
      name: '意见反馈',
      url: '/pages/person/feedback/index',
      icon: icons.feedback,
      extends: undefined,
      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
    },
  ],
  [
    {
      name: '成为专业经纪人',
      url: '/pages/agent/become/index',
      icon: icons.development,
      extends: undefined,
      userTypes: [CUSTOMER, ESTATE_AGENT],
      style: { color: '#888888' },
    },
    {
      name: '成为置业顾问',
      url: '',
      icon: icons.consultant,
      extends: undefined,
      style: { color: '#888888' },
      userTypes: [CUSTOMER, ESTATE_AGENT],
    },

  ]
]

export { icons, menus }