import { listClass } from '@/constant/global'

const arrToMap = arr =>
  arr.reduce((res, cur) => {
    res[cur.value] = cur.label
    return res
  }, {})

export const kinsfolkRefList = [
  { value: "1", label: '父母' },
  { value: "2", label: '配偶' },
  { value: "3", label: '子女' },
  { value: "4", label: '祖父母' },
]

export const bankTypeList = [
  { value: "1", label: '父母' },
  { value: "2", label: '配偶' },
  { value: "3", label: '子女' },
  { value: "4", label: '祖父母' },
]

// 启用状态
export const enableStatusList = [
  { value: 0, label: '禁用', listClass: listClass.danger },
  { value: 1, label: '启用', listClass: listClass.primary }
]
// 启用状态
export const onlineStatusList = [
  { value: 0, label: '下线', listClass: listClass.danger },
  { value: 1, label: '上线', listClass: listClass.primary },
  { value: 2, label: '服务中', listClass: listClass.warning }
]

export const yesOrNoList = [
  { value: 0, label: '否', listClass: listClass.primary },
  { value: 1, label: '是', listClass: listClass.primary }
]

export const booleanList = [
  { value: false, label: '否', listClass: listClass.warning },
  { value: true, label: '是', listClass: listClass.primary }
]

export const appraiseList = [
  { value: false, label: '待评价', listClass: listClass.warning },
  { value: true, label: '已评价', listClass: listClass.success }
]

export const genderList = [
  { value: -1, label: '未知', listClass: listClass.warning },
  { value: 0, label: '男', listClass: listClass.primary },
  { value: 1, label: '女', listClass: listClass.danger }
]

export const stopStatusList = [
  { value: 1, label: '封禁', listClass: listClass.danger },
  { value: 0, label: '正常', listClass: listClass.primary }
]

export const deleteFlagList = [
  { value: 1, label: '删除' },
  { value: 0, label: '正常' }
]

export const talentInfoTypeList = [
  { value: 1, label: '图片' },
  { value: 2, label: '视频' },
  { value: 3, label: '语音' }
]

export const auditStatusList = [
  { value: 0, label: '待审核' , listClass: listClass.danger },
  { value: 1, label: '通过' , listClass: listClass.primary },
  { value: -1, label: '不通过' , listClass: listClass.warning }
]

export const payTypeList = [
  { value: 1, label: '支付宝' , listClass: listClass.primary},
  { value: 2, label: '微信' , listClass: listClass.success},
  { value: 3, label: 'IOS支付', listClass: listClass.danger }
]

export const payStatusList = [
  { value: 0, label: '待支付', listClass: listClass.warning },
  { value: 1, label: '已支付', listClass: listClass.primary },
  { value: 2, label: '已退款', listClass: listClass.danger }
  // {value:3,label:'退款审核中'},
]

export const orderServiceStatusList = [
  { value: 0, label: '待支付', listClass: listClass.warning },
  { value: 1, label: '待接单', listClass: listClass.danger },
  { value: 2, label: '待消费', listClass: listClass.danger },
  { value: 90, label: '待评价', listClass: listClass.success },
  { value: 99, label: '已完成', listClass: listClass.success },
  { value: -1, label: '已取消', listClass: listClass.info },
  { value: -2, label: '已退款', listClass: listClass.info }
]

export const applyStatusList = [
  { value: 0, label: '待处理', listClass: listClass.warning },
  { value: 1, label: '已处理', listClass: listClass.success },
  { value: -1, label: '不予处理', listClass: listClass.info },
]

export const goodStatusList = [
  { value: 1, label: '好评' },
  { value: 2, label: '中评' },
  { value: 3, label: '差评' }
]

export const appTypeList = [
  { value: 'TBS', label: '泰巴士' }
]

/* export const Enums = {
  ...enableStatusList,
  ...onlineStatusList,
  ...yesOrNoList,
  ...booleanList,
  ...appraiseList,
  ...stopStatusList,
  ...genderList,
  ...deleteFlagList,
  ...talentInfoTypeList,
  ...auditStatusList,
  ...payTypeList,
  ...payStatusList,
  ...orderServiceStatusList,
  ...goodStatusList,
  ...appTypeList,
} */

export const enableStatusMap = arrToMap(enableStatusList)
export const yesOrNoMap = arrToMap(yesOrNoList)
export const booleanMap = arrToMap(booleanList)
export const genderMap = arrToMap(genderList)
export const talentInfoTypeMap = arrToMap(talentInfoTypeList)
export const orderServiceStatusMap = arrToMap(orderServiceStatusList)
export const goodStatusMap = arrToMap(goodStatusList)
