import request from "@/utils/request";
import { Account_BaseUrl, Market_BaseUrl } from "@/api/config";
const baseURL = Account_BaseUrl + "/admin/points";
const Api = {
  // 002-获取订单可用积分及抵扣金额（支付页面使用）
  // calcOrderUsablePoints(params: any) {
  //   return request<any>({
  //     url: `${baseURL}/memberPoints/calcUsablePoints`,
  //     method: "get",
  //     params
  //   });
  // },
  calcOrderUsablePoints(params: any) {
    return request<any>({
      url: `${Market_BaseUrl}/admin/points/userPoints`,
      method: "get",
      params
    });
  },
  // 004-根据抵扣金额计算所需积分
  calcMoneyUsablePoints(params: any) {
    return request<any>({
      url: `${baseURL}/memberPoints/calcUsedPoints`,
      method: "get",
      params
    });
  },
  // 003-根据积分计算可抵扣金额
  calcPointsToMoney(params: any) {
    return request<any>({
      url: `${baseURL}/memberPoints/calcDeductionAmount`,
      method: "get",
      params
    });
  },
};

export default Api;
