import obj from '#/utils/obj'

// 是否
export const is_yes = 1
export const is_no = 0
export const is_options = [
  {
    label: '是',
    value: is_yes,
  },
  {
    label: '否',
    value: is_no,
  },
]
export const is_map = obj.options2map(is_options)

// 性别
export const sex_male = 1
export const sex_female = 2
export const sex_options = [
  {
    label: '男',
    value: sex_male,
  },
  {
    label: '女',
    value: sex_female,
  },
]
export const sex_map = obj.options2map(sex_options)

// 平台
export const platform_xxl = '1966113040587837442'
export const platform_xzxd = '1966358228128296962'
export const platform_qzdyai = '1966391196339204098'
export const platform_options = [
  {
    label: '灵犀学',
    value: platform_xxl,
  },
  {
    label: '小志学到',
    value: platform_xzxd,
  },
  {
    label: '勤智德艺AI',
    value: platform_qzdyai,
  },
]
export const platform_map = obj.options2map(platform_options)

// 订单状态
export const order_status_unpaid = 0
export const order_status_paid = 1
export const order_status_close = 2
export const order_status_exception = 3
export const order_status_options = [
  {
    label: '已付款',
    value: order_status_paid,
  },
  {
    label: '未付款',
    value: order_status_unpaid,
  },
  {
    label: '已关闭',
    value: order_status_close,
  },
  {
    label: '异常',
    value: order_status_exception,
  },
]
export const order_status_map = obj.options2map(order_status_options)

// 订单类型
export const order_type_member_renewal = 0
export const order_type_school_coin_recharge = 2
export const order_type_service_provider_coin_recharge = 3
export const order_type_parent_coin_recharge = 4
export const order_type_coin_product_payment = 5
export const order_type_learn_amount_recharge = 6
export const order_type_member_activation = 7
export const order_type_promotion_partner_order = 8
export const order_type_options = [
  {
    label: '会员续费',
    value: order_type_member_renewal,
  },
  {
    label: '学校乐贝充值',
    value: order_type_school_coin_recharge,
  },
  {
    label: '服务商乐贝充值',
    value: order_type_service_provider_coin_recharge,
  },
  {
    label: '家长乐贝充值',
    value: order_type_parent_coin_recharge,
  },
  {
    label: '乐贝商品订单支付',
    value: order_type_coin_product_payment,
  },
  {
    label: '乐学金充值',
    value: order_type_learn_amount_recharge,
  },
  {
    label: '会员激活',
    value: order_type_member_activation,
  },
  {
    label: '推广合作伙伴订单',
    value: order_type_promotion_partner_order,
  },
]
export const order_type_map = obj.options2map(order_type_options)

export enum LearnAmountType {
  /** 直接分润 */
  DIRECT_PROFIT = 6,
  /** 间接分润 */
  INDIRECT_PROFIT = 7,
  /** 间接推广费用 */
  INDIRECT_PROMOTION_FEE = 5,
  /** 线下充值 */
  OFFLINE_RECHARGE = 0,
  /** 线下提现 */
  OFFLINE_WITHDRAW = 2,
  /** 线上充值 */
  ONLINE_RECHARGE = 1,
  /** 线上提现 */
  ONLINE_WITHDRAW = 3,
  /** 推广费用 */
  PROMOTION_FEE = 4,
}
export const learn_amount_type_map = {
  [LearnAmountType.OFFLINE_RECHARGE]: '线下充值',
  [LearnAmountType.ONLINE_RECHARGE]: '线上充值',
  [LearnAmountType.OFFLINE_WITHDRAW]: '线下提现',
  [LearnAmountType.ONLINE_WITHDRAW]: '线上提现',
  [LearnAmountType.PROMOTION_FEE]: '推广费用',
  [LearnAmountType.INDIRECT_PROMOTION_FEE]: '间接推广费用',
  [LearnAmountType.DIRECT_PROFIT]: '直接分润',
  [LearnAmountType.INDIRECT_PROFIT]: '间接分润',
} as any
export const learn_amount_type_options = obj.map2options(learn_amount_type_map)
