import request from "@/utils/request";

// 查询积分商城入口介绍信息
export const getShopBrief = (query) => {
  return request({
    url: "/app/integral/getShopBrief",
    method: "get",
    params: query,
  });
};

// 查询当前用户积分+商城分类信息
export const initShop = (query) => {
  return request({
    url: "/app/integral/initShop",
    method: "get",
    params: query,
  });
};

// 查询商品列表
export const queryShop = (query) => {
  return request({
    url: "/app/integral/shop/query",
    method: "get",
    params: query,
  });
};

// 查询商品详情接口
export const queryShopInfo = (query) => {
  return request({
    url: "/app/integral/shop/info",
    method: "get",
    params: query,
  });
};

// 我的兑换礼品列表
export const queryShopMyOrder = (query) => {
  return request({
    url: "/app/integral/shop/order/query",
    method: "get",
    params: query,
  });
};

// 兑换商品接口
export const dh = (data) => {
  return request({
    url: "/app/integral/shop/dh",
    method: "post",
    data: data,
    ignoreError: true
  });
};

// 取消订单接口
export const doQX = (data) => {
  return request({
    url: "/app/integral/shop/order/doQX",
    method: "post",
    data: data,
  });
};

// 我的积分记录
export const queryIntegralRecord = (query) => {
  return request({
    url: "/app/integral/queryIntegralRecord",
    method: "get",
    params: query,
  });
};

// 查询收货地址列表
export const queryAddrList = (query) => {
  return request({
    url: "/app/integral/shop/addrList",
    method: "get",
    params: query,
  });
};

// 新增收货地址
export const saveAddr = (data) => {
  return request({
    url: "/app/integral/shop/saveAddr",
    method: "post",
    data: data,
  });
};

// 删除地址接口
export const delAddr = (data) => {
  return request({
    url: "/app/integral/shop/delAddr",
    method: "post",
    data: data,
  });
};