import { ROLE_CODE } from '@/constants/user'

export default [
  {
    iconCode: 'integralMall',
    iconName: '赚积分',
    iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811839725-mall-icon.png',
    tab: '/pages/shop/index',
    default: true,
  },
  {
    iconCode: 'refercustomers',
    iconName: '推荐客户',
    page: ({ city, personType }) => {
      if (personType === ROLE_CODE['CONSULTANT']) return false;

      return `/useless/pages/agent/recommend/index?type=index&cityId=${(city || {}).id}`
    },
    iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811691300-recommend-icon.png',
    default: true,
  },
  {
    iconCode: 'buyingEncyclopedia',
    iconName: '购房须知',
    iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811865979-encyclopedia-icon.png',
    page: '/pages/policy/index?from=mine',
    default: true,
  },
  {
    iconCode: 'findRoom',
    iconName: '选好房',
    page: '/pages/project/map/index',
    iconUrl: 'https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1580811880140-map-icon.png',
    default: true,
  },
  {
    iconCode: 'Highlyrecommented',
    iconName: '重点推荐',
    page: '/pages/project/highlyRecommented',
  },
  {
    iconCode: 'MortgageCalculator',
    iconName: '算房贷',
    page: '/pages/toolKit/index',
  },
  {
    iconCode: 'PropertyListing',
    iconName: '楼盘列表',
    page: '/pages/project/list/index',
  },
  {
    iconCode: 'EventInformation',
    iconName: '活动资讯',
    tab: '/pages/activity/activity',
  },
  {
    iconCode: 'Popularactivities',
    iconName: '参加活动',
    tab: '/pages/activity/activity',
  },
  {
    iconCode: 'LatestInformation',
    iconName: '最新资讯',
    tab: '/pages/activity/activity',
  },
  {
    iconCode: 'Myclient',
    iconName: '我的客户',
    page: '/useless/pages/agent/client/index',
  },
  {
    iconCode: 'MyActivities',
    iconName: '我的活动',
    page: '/pages/activity/myActivity?from=mine',
  },
  {
    iconCode: 'Myhelp',
    iconName: '我的助力',
    page: '/pages/activity/assistancePage',
  },
  {
    iconCode: 'Mygroup',
    iconName: '我的拼团',
    page: '/pages/activity/assemblePage',
  },
  {
    iconCode: 'MyFavorites',
    iconName: '我的收藏',
    page: '/pages/person/favorite/index',
  },
  {
    iconCode: 'MyInformation',
    iconName: '我的资料',
    page: '/useless/pages/person/profile/index',
  },
  {
    iconCode: 'Mymessage',
    iconName: '我的消息',
    page: '/pages/im/list/index',
  },
  {
    iconCode: 'Exchangerecords',
    iconName: '兑换记录',
    page: '/useless/pages/shop/record/index',
  },
  {
    iconCode: 'Feedback',
    iconName: '意见反馈',
    page: '/useless/pages/person/feedback/index',
  },
  {
    iconCode: 'NewsDetail',
    iconName: '资讯详情',
    page: '/pages/news/detail/index',
  },
  {
    iconCode: 'BuildingDetail',
    iconName: '项目详情',
    page: '/pages/project/detail/index',
  },
  {
    iconCode: 'ActivityDetail',
    iconName: '报名活动详情',
    page: '/pages/activity/detail/index',
  },
  {
    iconCode: 'LiveDetail',
    iconName: '直播活动详情',
    page: '/onlineSelling/pages/live/index',
  },
  {
    iconCode: 'AssistanceDetail',
    iconName: '助力活动详情',
    page: '/pages/activity/detail/assistance',
  },
  {
    iconCode: 'AssembleDetail',
    iconName: '拼团活动详情',
    page: '/pages/activity/detail/assemble',
  },
  {
    iconCode: 'HouseListDetail',
    iconName: '房源列表详情',
    page: '/onlineSelling/pages/houseList/index',
  },
  {
    iconCode: 'H5Detail',
    iconName: 'H5活动详情',
    page: '/pages/project/h5Page',
  },
  {
    iconCode: 'H5WebView',
    iconName: 'H5',
    page: ({ navIcon }) => {
      return `/pages/project/panorama/index?url=${encodeURIComponent(navIcon.params)}`
    },
  },
]

