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 httpAdd = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderpayadd`, { data });
};

// 列表
export const httpList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}orderpaylist`, { data });
};
//详情
export const httpInfo = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}tradeinfo`, { data });
};

//上传execl
export const httpUpload = (data: any): any => {
  return http.request("post", `${yewuApi}importTrade`, { data });
};

//资金认领订单列表明细
export const httpOrderList = (data: any): any => {
  return http.request("post", `${yewuApi}tradeQuery`, { data });
};

//资金认领付款新建
export const httpPayAdd = (data: any): any => {
  return http.request("post", `${yewuApi}orderpayadd`, { data });
};

//销售订单列表
export const httpSaleList = (data: any): any => {
  return http.request("post", `${yewuApi}orderlist`, { data });
};

export const httpWithdraw = (data: any): any => {
  return http.request("post", `${yewuApi}orderpaystatus`, {
    data: {
      status: "5",
      ...data
    }
  });
};
//上传execl
export const httpCapitalUpload = (data: any): any => {
  return http.request("post", `${yewuApi}importTradeByBatchOrderCode`, {
    data
  });
};
