/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许，不可做商业用途！
*
* 版权所有，侵权必究！
*/
import request from '@/utils/request'

/**
 * 提现
 */

// 检查提现金额
export function checkDrawCashAmount (amount) {
  return request({
    url: '/mall4cloud_admin/s/supplier_withdraw_cash/check_draw_cash_amount',
    method: 'get',
    params: {
      amount
    }
  })
}

// 获取验证码
export function sendWithdrawCode () {
  return request({
    url: '/mall4cloud_biz/s/sms/send_withdraw_code',
    method: 'put'
  })
}

// 提现
export function shopWithdrawCash (data) {
  return request({
    url: '/mall4cloud_admin/s/supplier_withdraw_cash/apply',
    method: 'post',
    data
  })
}

export function page (pageParam) {
  return request({
    url: '/mall4cloud_admin/mp/supplier_wallet/page',
    method: 'get',
    params: pageParam
  })
}
// get_shop_wallet
export function shopWallet () {
  return request({
    url: '/mall4cloud_admin/mp/supplier_wallet/get_supplier_wallet',
    method: 'get'
  })
}
// 获取银行卡列表
export function getBankCardList () {
  return request({
    url: '/mall4cloud_admin/s/apply_supplier/supplier_bank_card/list_by_supplierId',
    method: 'get'
  })
}

// 添加银行卡
export function addBankCard (data) {
  return request({
    url: '/mall4cloud_admin/s/apply_supplier/supplier_bank_card',
    method: 'post',
    data
  })
}

// 设置默认银行卡 set_primary
export function setPrimary (supplierBankCardId) {
  return request({
    url: '/mall4cloud_admin/s/apply_supplier/supplier_bank_card/set_primary',
    method: 'put',
    params: {
      supplierBankCardId
    }
  })
}

// get_order_detail 订单详情列表
export function orderDetaiList (orderId, refundId) {
  return request({
    url: '/mall4cloud_order/mp/order_item/get_order_detail',
    method: 'get',
    params: {
      orderId,
      refundId
    }
  })
}

// 获取提现记录信息
export function withdrawCashList (params) {
  return request({
    url: '/mall4cloud_admin/mp/supplier_withdraw_cash/page',
    method: 'get',
    params
  })
}

// 获取银行信息详情
export function withdrawCashBankInfo (cashId) {
  return request({
    url: '/mall4cloud_admin/mp/supplier_withdraw_cash/info',
    method: 'get',
    params: {
      cashId
    }
  })
}

// 提交通联申请提现（通联支付）
export function withdrawCashApply (data) {
  return request({
    url: '/mall4cloud_admin/s/supplier_withdraw_cash/allinpay_apply',
    method: 'post',
    data
  })
}

// 重新发送提现验证码（通联支付）
export function withdrawCashSendCode (data) {
  return request({
    url: '/mall4cloud_admin/s/supplier_withdraw_cash/resend_pay_sms',
    method: 'post',
    data
  })
}

// 提现确认支付（通联支付）
export function withdrawCashConfirmPay (data) {
  return request({
    url: '/mall4cloud_admin/s/supplier_withdraw_cash/confirm_withdraw_pay',
    method: 'post',
    data
  })
}
