import request from "@/utils/request";

//获取网点列表
export function getNodeList(query) {
  return request({
    url: "/ecw/node/list-all-simple",
    method: "get",
    params: query,
  });
}

//获取积分列表
export function getGiftList(data) {
  return request({
    url: "/ecw/reward/page",
    method: "post",
    params: {
      page: data.page,
      rows: data.rows,
    },
    data: data,
  });
}

//新增礼品
export function addRewards(data) {
  return request({
    url: "/ecw/reward/create",
    method: "post",
    data: data,
  });
}

//删除礼品
export function deleteRewards(data) {
  return request({
    url: "/ecw/reward/delete?id=" + data.id,
    method: "delete",
  });
}

//礼品延期
export function delayRewards(data) {
  return request({
    url: "/ecw/reward/delay",
    method: "post",
    data: data,
  });
}
//编辑礼品
export function editRewards(data) {
  return request({
    url: "/ecw/reward/update",
    method: "post",
    data: data,
  });
}

//礼品状态变更
export function changeRewardsStatus(data) {
  return request({
    url: "/ecw/reward/status",
    method: "post",
    data: data,
  });
}

//复制礼品
export function copyRewardsAPI(id) {
  return request({
    url: "/ecw/reward/copy/" + id,
    method: "post",
  });
}

//获取单个礼品详情
export function getRewardsDetails(data) {
  return request({
    url: "/ecw/reward/get",
    method: "get",
    params: data,
  });
}

//获取国家列表
export function getTradeCountryList() {
  return request({
    url: "/ecw/region/getTradeCountryList",
    method: "get",
  });
}

//获取城市列表
export function getCityList(query) {
  return request({
    url: "/ecw/region/getCityListByParent",
    method: "get",
    params: query,
  });
}

//获取会员积分列表
export function getMemberList(data) {
  return request({
    url: "/member/user-score/page",
    method: "post",
    data,
  });
}

//批量兑换礼品
export function bulkConversion(data) {
  return request({
    url: "/reward/redeem/batch",
    method: "post",
    data,
  });
}

//获取仓库列表下拉框
export function getWarehouseList(data) {
  return request({
    url: "/ecw/warehouse/list-all-simple",
    method: "post",
    data,
  });
}
