import request from "@/utils/request.js";

/**
 * 查询分类信息
 * @param {*} params
 * @returns
 */
export function queryPayType(params) {
  return request({
    method: "get",
    url: "pay/queryPayType",
    params,
  });
}

/**
 * 付款
 * @param {*} data
 * @returns
 */
export function payOrder(api, data) {
  return request({
    method: "post",
    url: api,
    data,
  });
}

/**
 * 扫码支付
 * @param {*} data
 * @returns
 */
export function scanpay(data) {
  return request({
    method: "post",
    url: "pay/scanpay",
    data,
  });
}

/**
 * 储值卡付款
 * @param {*} data
 * @returns
 */
export function accountPay(data) {
  return request({
    method: "post",
    url: "pay/accountPay",
    data,
  });
}

/**
 * 现金付款
 * @param {*} data
 * @returns
 */
export function cashPay(data) {
  return request({
    method: "post",
    url: "pay/cashPay",
    data,
  });
}

/**
 * 查询订单支付状态
 * @param {*} params
 * @returns
 */
export function queryOrder(params) {
  return request({
    method: "get",
    url: "pay/queryOrder",
    params,
  });
}

/**
 * 打印
 * @param {*} params
 * @returns
 */
export function print(params) {
  return request({
    method: "get",
    url: "cloudPrinter/print",
    params,
  });
}

/**
 * 快捷收款
 * @param {*} params
 * @returns
 */
export function quickPay(params) {
  return request({
    method: "get",
    url: "pay/quickPay",
    params,
  });
}

/**
 * 查询快捷收银订单
 * @param {*} params
 * @returns
 */
export function queryQuickPayStatus(params) {
  return request({
    method: "get",
    url: "pay/queryQuickPayStatus",
    params,
  });
}

/**
 * 获取会员支付状态查询
 * @param {*} params
 * @returns
 */
export function queryScanPay(params) {
  return request({
    method: "get",
    url: "member/queryScanPay",
    params,
  });
}

/**
 * 会员余额支付
 * @param {*} data
 * @returns
 */
export function vipPay(data) {
  return request({
    method: "post",
    url: "/pay/vipPay",
    data,
  });
}

/**
 * 挂账人-分页
 * @param {*} params
 * @returns
 */
export function buyerPage(params) {
  return request({
    method: "get",
    url: "/credit/buyer/page",
    params,
  });
}

/**
 * 挂账支付
 * @param {*} data
 * @returns
 */
export function payCreditPay(data) {
  return request({
    method: "post",
    url: "/pay/creditPay",
    data,
  });
}
