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

/**
 * 反扫
 * @param {*} data
 * @returns
 */
export function microPay(data) {
  return request({
    method: "post",
    url: "/order/pay/microPay",
    data,
  });
}

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

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

/**
 * 查询订单列表
 * @param {*} data
 * @returns
 */
export function orderList(params) {
  return request({
    method: "get",
    url: `/order/admin/order`,
    params,
  });
}

/**
 * 新增订单
 * @param {*} data
 * @returns
 */
export function createOrder(data) {
  return request({
    method: "post",
    url: "/order/admin/order/createOrder",
    data,
  });
}

/**
 * 历史订单(多次下单使用)
 * @param {*} data
 * @returns
 */
export function historyOrder(params) {
  return request({
    method: "get",
    url: "/order/admin/order/historyOrder",
    params,
  });
}

/**
 * 订单退款
 * @param {*} data
 * @returns
 */
export function refundOrder(data) {
  return request({
    method: "post",
    url: "/order/admin/order/refundOrder",
    data,
  });
}

/**
 * 订单详情
 * @param {*} data
 * @returns
 */
export function getOrderById(params) {
  return request({
    method: "get",
    url: "/order/admin/order/getOrderByIdPrint",
    params,
  });
}

/**
 * 会员充值 - 现金充值
 * @param {*} data
 * @returns
 */
export function cashPayVip(data) {
  return request({
    method: "post",
    url: "/order/pay/cashPayVip",
    data,
  });
}

/**
 * 会员充值 - 反扫
 * @param {*} data
 * @returns
 */
export function microPayVip(data) {
  return request({
    method: "post",
    url: "/order/pay/microPayVip",
    data,
  });
}

/**
 * 会员充值 - 会员退款前置接口
 * @param {*} data
 * @returns
 */
export function refundVipBefore(data) {
  return request({
    method: "post",
    url: "/order/pay/refundVipBefore",
    data,
  });
}

/**
 * 会员充值 - 会员退款
 * @param {*} data
 * @returns
 */
export function refundVip(data) {
  return request({
    method: "post",
    url: "/order/pay/refundVip",
    data,
  });
}

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

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

/**
 * 挂账人 - 会员支付订单
 * @param {*} data
 * @returns
 */
export function vipPay(data) {
  return request({
    method: "post",
    url: "/order/pay/vipPay",
    data,
  });
}

/**
 * 订单打印
 * @param {*} data
 * @returns
 */
export function orderPrint(data) {
  return request({
    method: "post",
    url: "/order/admin/order/print",
    data,
  });
}

/**
 * 查询会员充值支付状态
 * @param {*} data
 * @returns
 */
export function queryPayStatus(params) {
  return request({
    method: "get",
    url: "/order/pay/queryPayStatus",
    params,
  });
}

/**
 * 订单转桌
 * @param {*} data
 * @returns
 */
export function mergeOrder(data) {
  return request({
    method: "post",
    url: "/order/admin/order/mergeOrder",
    data,
  });
}

/**
 * 取消订单
 * @param {*} data
 * @returns
 */
export function cancelOrder(data) {
  return request({
    method: "post",
    url: "/order/admin/order/cancelOrder",
    data,
  });
}

/**
 * 取消某一次 下单
 * @param {*} data
 * @returns
 */
export function rmPlaceOrder(data) {
  return request({
    method: "post",
    url: "/order/admin/order/rmPlaceOrder",
    data,
  });
}
