import { http } from "/@/utils/http";
import { loadEnv } from "@build/index";
const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
const userAPi = VITE_PROXY_DOMAIN_REAL;
const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
interface ResponseType extends Promise<any> {
  data?: object;
  code?: number;
  msg?: string;
}

//退款单列表
export const httpList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderreturnlist`, {
    data
  });
};

// 资金认领列表已通过审核的数据
export const httpTradeList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}tradeList`, { data });
};

//资金认领详情
export const httpTradeDetail = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}tradeloginfo`, {
    data
  });
};

//新建退款单
export const httpAdd = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderpayreturn`, {
    data
  });
};

//退款单详情
export const httpDetail = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}returnpayinfo`, {
    data
  });
};

//退款单审核
export const httpStatus = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderreturnstatus`, {
    data
  });
};
