import request from '@/utils/request'
import { URL } from '@/config'

/**
 * @name 商家申请入驻信息分页列表
 * @api api_url + '/admin/shop/merch/list'
 * @param { id }
 * @returns
 */

export function getPrinterList(params) {
  return request({
    url: URL.shop.merch.merchList,
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
  })
}

/**
 * @name 商家申请入驻信息详情
 * @api api_url + '/admin/shop/merch/detail'
 * @param { id }
 * @returns
 */

export function getMerchDetail(params) {
  return request({
    url: URL.shop.merch.merchDetail,
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
  })
}

/**
 * @name 审批商家申请入驻
 * @api api_url + '/admin/shop/merch/approval'
 * @param { id , approvalStatus , approvalRemark}
 * @returns
 */

export function getMerchApproval(params) {
  return request({
    url: URL.shop.merch.merchApproval,
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
  })
}

/**
 * @name 发起合同签署
 * @api api_url + '/admin/shop/esign/sign-flow/create-by-file'
 * @param { id , approvalStatus , approvalRemark}
 * @returns
 */

export function getCreateByFile(params) {
  return request({
    url: URL.shop.merch.createByFile,
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
  })
}

/**
 * @name 查看商家签署合同
 * @api api_url + '/admin/shop/esign/signed/contract/file'
 * @param { mchMobile }
 * @returns
 */

export function getCheckContractFile(params) {
  return request({
    url: URL.shop.merch.checkContractFile,
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
  })
}

/**
 * @name 创建店铺(补偿机制)
 * @api api_url + '/admin/shop/esign/signed/contract/file'
 * @param { mchMobile }
 * @returns
 */

export function createShop(params) {
  return request({
    url: URL.shop.merch.createShop,
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
  })
}

/**
 * @name 创建分账(补偿机制)
 * @api api_url + '/admin/shop/esign/signed/contract/file'
 * @param { mchMobile }
 * @returns
 */

export function createSubAccount(params) {
  return request({
    url: URL.shop.merch.createSubAccount,
    method: 'post',
    headers: {
      'Content-Type': 'application/json',
    },
    data: params,
  })
}
