import { request } from "@/utils/request";
export const getUserInfo = () => {
  return request({
    url: "/ucenter/user/getUserInfo",
    method: "post",
    config: {
      timeout: 10000,
      headers: {
        "Content-Type": "application/json;charset=UTF-8",
      },
    },
  });
};

export const getUserOrder = (data: any) => {
    return request({
      url: "/ucenter/user/order/list",
      method: "post",
      data,
      config: {
        timeout: 10000,
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };

  export const incrementOrderList = (data: any) => {
    return request({
      url: "/ucenter/user/virtualOrder/incrementOrderList",
      method: "post",
      data,
      config: {
        timeout: 10000,
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };
  
  export const getDownOrderList = (data: any) => {
    return request({
      url: "/ucenter/user/virtualOrder/downloadOrderList",
      method: "post",
      data,
      config: {
        timeout: 10000,
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };

  export const getInvoiceList = (data: any) => {
    return request({
      url: "/ucenter/user/invoice/list",
      method: "post",
      data,
      config: {
        timeout: 10000,
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };
    
  export const getChargeList = (data: any) => {
    return request({
      url: "/ucenter/user/virtualOrder/chargeList",
      method: "post",
      data,
      config: {
        timeout: 10000,
        headers: {
            "Content-Type": "application/json;charset=UTF-8",
        },
      },
    });
  };

export const getCartList = (data: any) => {
    return request({
      url: "/ucenter/user/cart/list",
      method: "post",
      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",
        },
      },
    });
  };