import { request } from "@/utils/request";
interface logonParam {
    code:string,
    orderSn:string,
}
export const getOrder = (orderSn) => {
  return request({
    url: "/service/pay/order/info",
    method: "get",
    data:{
        orderSn
    },
    config: {
      timeout: 10000,
      headers: {
        "Content-Type": "application/json;charset=UTF-8",
      },
    },
  });
};

export const openPay = (data) => {
    return request({
      url: "/service/pay/openPay",
      method: "post",
      data,
      config: {
        timeout: 10000,
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };

  export const wxLogin = (data:logonParam) => {
    return request({
      url: "/service/pay/wxLogin",
      method: "get",
      data,
      config: {
        timeout: 10000,
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };
  
export const getOrderInfo = (orderSn:string) => {
    return request({
      url: `/service/pay/order/info/${orderSn}`,
      method: "get",
      config: {
        timeout: 10000,
        loading: true,//隐藏进度条
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };

export const queryOrderStatus = (data) => {
    return request({
      url: `/ucenter/user/order/queryOrderStatus`,
      method: "post",
      data,
      config: {
        timeout: 10000,
        loading: true,//隐藏进度条
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };