// 订单状态
export const statusMap = {
  101: '未付款',
  102: '用户取消',
  103: '系统取消',
  104: '已取消(管理员)',
  201: '已付款',
  202: '申请退款',
  203: '已退款',
  // 207: '已取消(美团)',
  301: '服务中',
  401: '服务已完成',
  402: '服务已完成(系统)'
}
export const statusModifyMap = {
  202: '申请退款',
  203: '已退款',
  301: '服务中',
  401: '服务已完成',
  402: '服务已完成(系统)'
}

export const defaultUseStatusOptions = [
  {
    label: '未使用',
    value: 0
  },
  {
    label: '已使用',
    value: 1
  },
  {
    label: '已过期',
    value: 2
  },
  {
    label: '已下架',
    value: 3
  },
  {
    label: '已占有预售',
    value: 4
  }
]


export const defaultDyUseStatusOptions = [
  {
    label: '已领取',
    value: 10
  },
  {
    label: '已核销',
    value: 11
  },
  {
    label: '已过期',
    value: 12
  },
  {
    label: '已下架',
    value: 13
  }
]
// 工单状态
export const statusDesc = {
  0: '创建',
  1: '处理中',
  2: '已完成',
  3: '作废'
}
// 工单子状态
export const substatusDesc = {
  101: '待处理',
  102: '升级',
  103: '驳回',
  104: '重新打开',
  106: '等待客户上传图片',
  107: '客户已上传图片',
  201: '完成',
  0: '创建'
}

// 服务工单状态
export const bookStatusMap = {
  0: '未预约',
  1: '待履约',
  2: '服务中',
  3: '服务已提供',
  4: '服务已完成',
  5: '取消',
  6: '退款',
  7: '匹配中',
  8: '待联系'
}
// 权益单状态
export const hmBenefitStatusMap = {
  1: '待支付',
  2: '待履约',
  4: '已取消',
  5: '已关闭',
  7: '服务已提供',
  8: '待派单',
  9: '服务已完成'
}

// 表sys_station{ id: 1, city: '上海', name: '仓库站(总仓)' },
export const stations = [
  { id: 28, city: '上海', name: '上海品类浦西站' },
  { id: 40, city: '深圳', name: '深圳宝安服务站' },
  { id: 69, city: '上海', name: '上海静安嘉定长宁站' },
  { id: 70, city: '上海', name: '上海杨浦虹口站' },
  { id: 72, city: '上海', name: '上海徐汇黄浦站' },
  { id: 73, city: '上海', name: '上海闵行松江站' },
  { id: 75, city: '上海', name: '上海浦东北站' },
  { id: 76, city: '上海', name: '上海浦东南站' },
  { id: 79, city: '北京', name: '北京朝阳东城站' },
  { id: 81, city: '深圳', name: '深圳南山服务站' },
  { id: 82, city: '深圳', name: '深圳罗湖服务站' },
  { id: 95, city: '北京', name: '北京海淀西城站' },
  { id: 97, city: '深圳', name: '深圳福田服务站' },
  { id: 98, city: '深圳', name: '深圳桃源服务站' },
  { id: 99, city: '北京', name: '北京品类站' },
  { id: 100, city: '北京', name: '北京丰台站' },
  { id: 101, city: '深圳', name: '深圳沙井服务站' },
  { id: 102, city: '深圳', name: '深圳福永服务站' },
  { id: 103, city: '深圳', name: '深圳龙华服务站' },
  { id: 104, city: '深圳', name: '深圳龙岗服务站' },
  { id: 105, city: '北京', name: '北京大兴东南站' },
  { id: 106, city: '深圳', name: '深圳锦荟服务站' },
  { id: 112, city: '深圳', name: '深圳品类站' },
  { id: 115, city: '深圳', name: '深圳聚福服务站' },
  { id: 117, city: '南京', name: '南京建邺站' },
  { id: 118, city: '南京', name: '南京秦淮站' },
  { id: 119, city: '南京', name: '南京江宁站' },
  { id: 120, city: '南京', name: '南京北大站' },
  { id: 121, city: '南京', name: '南京品类站' },
  { id: 123, city: '南京', name: '南京栖霞站' },
  { id: 124, city: '南京', name: '南京浦口站' },
  { id: 125, city: '苏州', name: '苏州园区站' },
  { id: 126, city: '苏州', name: '苏州品类站' },
  { id: 127, city: '无锡', name: '无锡经开站' },
  { id: 128, city: '无锡', name: '无锡品类站' },
  { id: 131, city: '上海', name: '短期出单（保姆/钟点）' },
  { id: 132, city: '上海', name: '上海品类浦东站' },
  { id: 133, city: '上海', name: '上海丘比特小程序站' },
  { id: 134, city: '北京', name: '顺义门店' },
  { id: 135, city: '杭州', name: '杭州西溪风情站' },
  { id: 136, city: '深圳', name: '测算-宝安中洲华府' },
  { id: 137, city: '上海', name: '上海品类收纳站' },
  { id: 138, city: '上海', name: '上海黄浦站' },
  { id: 161, city: '青岛', name: '青岛服务站' },
  { id: 165, city: '青岛', name: '青岛品类站' },
  { id: 167, city: '成都', name: '成都成华站' },
  { id: 168, city: '成都', name: '成都东站' },
  { id: 169, city: '广州', name: '广州天河站' },
  { id: 167, city: '成都', name: '成都南站' },
  { id: 167, city: '成都', name: '成都西站' },
]

// 优惠券类型
export const defaultCouponTypeOptions = [
  {
    label: '通用领券',
    value: 0
  },
  {
    label: '注册赠券',
    value: 1
  },
  {
    label: '兑换码',
    value: 2
  },
  // {
  //   label: '助力活动推荐3人',
  //   value: 3
  // },
  {
    label: '会员系统派发券',
    value: 4
  }
]

// object对象转数组
export function ObjectToArray(obj) {
  const objArray = Object.keys(obj).map(key => {
    return { value: key, label: obj[key] }
  })
  return objArray
}

// 队列转对象
export function ArrayToObject(array) {
  let jsonStr = '{'
  let index = 0
  array.forEach(item => {
    if (index === 0) {
      jsonStr = jsonStr + '"' + item.label + '":"' + item.value + '"'
    } else {
      jsonStr = jsonStr + ',"' + item.label + '":"' + item.value + '"'
    }

    index = index + 1
  })

  jsonStr = jsonStr + '}'

  return JSON.parse(jsonStr)
}
// 订单取消原因
export const cancelReasonList = [
  { id: 8, reason: "约不到想要的服务时间" },
  { id: 24, reason: "保洁师无法上门取消(非请假、解约原因)" },
  { id: 13, reason: "保洁师请假取消" },
  { id: 14, reason: "保洁师解约取消" },
  { id: 19, reason: "客户临时有事，暂时不预约" },
  { id: 20, reason: "客户先屯着后面预约" },
  { id: 10, reason: "用户改期取消" },
  { id: 11, reason: "用户改派取消" },
  { id: 15, reason: "修改订单地址取消" },
  { id: 9, reason: "活动/优惠未享受" },
  { id: 12, reason: "无法联系到客户" },
  // { id: 16, reason: "退还权益取消" },
  //{ id: 17, reason: "用户退款取消" },
  { id: 18, reason: "团单不适用无法服务" },
];

// 订单取消原因--用来列表回显 取消原因会不选择多
export const cancelReasonMapList = {
  8: "约不到想要的服务时间",
  9: "活动/优惠未享受",
  10: "用户改期取消",
  11: "用户改派取消",
  12: "无法联系到客户",
  13: "保洁师请假取消",
  14: "保洁师解约取消",
  15: "修改订单地址取消",
  16: "退还权益取消",
  17: "用户退款取消",
  18: "团单不适用无法服务",
  19: "客户临时有事，暂时不预约",
  20: "客户先屯着后面预约",
  21: "【商家原因】保洁师无法上门服务",
  22: "客户计划有变不需要了",
  23: "客户其他",
  24: "保洁师无法上门取消(非请假、解约原因)",
};
