/*
 * @Descripttion: HJ
 * @Company: 思宏科技
 * @version: v1.0
 * @Author: HJ
 * @Date: 2021-03-29 15:57:16
 * @LastEditors: OBKoro1
 * @LastEditTime: 2021-12-31 14:53:39
 */
const status = {
  1: '等待支付',
  2: '订单已取消',
  3: '待商家接单',
  4: '商家备餐中',
  5: '待骑手接单',
  6: '备餐完成,请取餐',
  7: '订单已完成',
  8: '超时未处理订单',
  9: '已取出自提柜',
  101: '等待分配骑手',
  102: '骑手正在赶往商家',
  201: '骑手取货中',
  202: '骑手配送中',
  301: '骑手配送中',
  302: '订单已完成',
  501: '已取消配送',
  502: '已取消配送',
  601: '退款审核中',
  602: '退款成功',
  603: '退款失败',
  604: '极速退款成功',
  605: '商家直接退款'
}
function orderStatus() {
  return status
}
function orderJournal(key) {
  var map = {}
  map['1'] = '订单已提交'
  map['2'] = '订单已取消'
  map['3'] = '支付成功'
  map['4'] = '商家已接单'
  map['5'] = '商家已接单'
  map['6'] = '商家备餐完成'
  map['7'] = '订单已自提'
  map['8'] = '超时未处理订单'
  map['9'] = '外卖已取出自提柜'
  map['101'] = '等待分配骑手'
  map['102'] = '骑手已接单'
  map['201'] = '骑手已到店'
  map['202'] = '骑手已取货'
  map['301'] = '骑手已取货'
  map['302'] = '订单已送达'
  map['501'] = '已取消配送'
  map['502'] = '已取消配送'
  map['601'] = '退款审核中'
  map['602'] = '退款成功'
  map['603'] = '退款失败'
  map['604'] = '极速退款成功'
  map['605'] = '商家直接退款'
  return map
}
function orderType() {
  var map = {}
  map['1'] = '微信支付'
  map['2'] = '储值支付'
  map[1] = '微信支付'
  map[2] = '储值支付'
  return map
}
function deliveyType() {
  var map = {}
  map['1'] = '自配送'
  map['2'] = '顺丰配送'
  map['3'] = '蜂鸟配送'
  map['4'] = '餐道聚合配送'
  return map
}

export const nurseOrderStatusMap = {
  1: '等待用户支付',
  2: '订单取消',
  3: '待接单',
  4: '待服务',
  5: '等待分配骑手',
  6: '等待提供护理服务',
  7: '服务已完成',
  8: '订单超时未处理',
  9: '外卖已取出取餐柜',
  10: '服务中',
  101: '等待分配骑手',
  102: '分配骑手成功',
  103: '商家取消护理',
  201: '骑手到店开始取货',
  202: '骑手取货成功',
  203: '骑手取货失败，商家取消订单,订单结束',
  204: '骑手取货失败，骑手因自身原因取消订单,订单结束',
  205: '骑手取货失败，骑手因商家原因取消订单,订单结束',
  301: '骑手配送中',
  302: '订单已完成',
  303: '商家取消订单，订单结束',
  304: '骑手无法联系收货人，配送物品开始返还商家',
  305: '骑手配送阶段——收货人拒收，配送物品开始返还商家',
  401: '骑手返回配送货品阶段——货品返还商户成功， 订单结束',
  501: '护理服务被取消, 订单结束',
  502: '因不可抗拒因素（天气，道路管制等原因）取消，订单结束',
  601: '退款审核中',
  602: '退款成功',
  603: '退款失败',
  604: '极速退款成功',
  605: '商家直接退款'
}

// 订单所有操作配置列表
const operationsEnum = [
  {
    icon: 'byn_order_cancel',
    label: '取消订单',
    type: 'cancel',
    show: [1],
    orderType: ['shitang', 'patient', 'nurse']
  },
  {
    icon: 'byn_order_payment',
    label: '立即支付',
    type: 'payment',
    show: [1],
    orderType: ['shitang', 'patient', 'nurse']
  },
  {
    icon: 'byn_order_refund',
    label: '申请退款',
    type: 'refund',
    show: [3, 4, 5, 6, 7, 8, 9, 10, 101, 102, 201, 202, 301, 302, 501, 502],
    unshow: [601, 602, 603, 604, 605],
    orderType: ['shitang', 'patient', 'nurse']
  },
  {
    icon: 'byn_order_call_business',
    label: '致电商家',
    type: 'callMerchant',
    all: true,
    orderType: ['shitang', 'patient', 'nurse']
  },
  {
    icon: 'byn_order_call_NursingWorkers',
    label: '致电取货护工',
    type: 'callDeliveryNurse',
    show: [301],
    orderType: ['shitang', 'patient']
  },
  {
    icon: 'byn_order_call_courier',
    label: '致电骑手',
    type: 'callRider',
    show: [102, 201, 202, 301],
    orderType: ['shitang', 'patient']
  },
  {
    icon: 'byn_order_call_NursingWorkers',
    label: '致电护工',
    type: 'callNurse',
    show: [4, 10, 101, 102, 201, 202, 301, 302, 501, 502],
    orderType: ['nurse']
  },
  {
    icon: 'byn_order_BuyAgain',
    label: '再来一单',
    type: 'againOrder',
    show: [7, 302, 602, 603, 604, 605],
    orderType: ['shitang', 'patient']
  }
]

// 远程探视卡片的枚举
const visitStateEnumeration = {
  TO_BE_CONFIRM: '待确认',
  CONFIRM_DOING: '确认中',
  CONFIRM: '已确认',
  UPDATE_TIME: '更改探视时间（兼容状态记录）',
  TO_BE_START: '待开始',
  DOING: '进行中',
  END: '已结束',
  FAILURE: '已失效',
  CANCEL:'已取消'
}

// 患者与家属关系
const relationEnum = [
  {
    value: 0,
    text: '家庭成员'
  },
  {
    value: 1,
    text: '亲戚'
  },
  {
    value: 2,
    text: '朋友'
  },
  {
    value: 3,
    text: '其他'
  }
]
const relationObj = {
  0: '家庭成员',
  1: '亲戚',
  2: '朋友',
  3: '其他'
}
const relationArr = ['家庭成员', '亲戚', '朋友', '其他']

// 性别
const sexEnum = [
  {
    value: 1,
    text: '男'
  },
  {
    value: 2,
    text: '女'
  }
]
const sexObj = {
  1: '男',
  2: '女'
}

module.exports = {
  status,
  nurseOrderStatusMap,
  operationsEnum,
  orderStatus: orderStatus,
  orderType: orderType,
  deliveyType: deliveyType,
  orderJournal: orderJournal,
  visitStateEnumeration,
  relationEnum,
  relationObj,
  sexEnum,
  sexObj,
  relationArr
}
