import $http from "@/utils/httpRequest.js";

export const marketing = {
  // 会员等级列表
  marketingLevelPage: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitMemberLevel/list`,
      method: "post",
      data,
    });
  },
  addMarketingLevel: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitMemberLevel/saveAll`,
      method: "post",
      data: data,
    });
  },
  //会员开通情况
  getEffective: (data) => {
    return $http.request({
      url: `/merchant-api/memberPackageUnitStatus/getEffective`,
      method: "post",
      data,
    });
  },
  //有效套餐
  memberPackageList: (data) => {
    return $http.request({
      url: `/merchant-api/memberPackage/list`,
      method: "post",
      data,
    });
  },
  //下单
  placeOrder: (data) => {
    return $http.request({
      url: `/merchant-api/memberPackageUnitOrder/placeOrder`,
      method: "post",
      data,
    });
  },
  //会员用户
  marketingUserPage: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitUser/page`,
      method: "get",
      params: data,
    });
  },
  memberUnitUserDetail: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitUser/detail`,
      method: "post",
      data,
    });
  },
  changeMemberPoints: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitUser/changeMemberPoints`,
      method: "post",
      data,
    });
  },
  changeGrowthValue: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitUser/changeGrowthValue`,
      method: "post",
      data,
    });
  },
  //积分列表
  integralList: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitMemberTask/list`,
      method: "post",
      data,
    });
  },
  reverseEnable: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitMemberTask/reverseEnable`,
      method: "post",
      data,
    });
  },
  integralTop: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitMemberTask/top`,
      method: "post",
      data,
    });
  },
  settingTaskDetail: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitMemberTask/settingTaskDetail`,
      method: "post",
      data,
    });
  },
  //  会员积分商品
  PointsProductPage: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitPointsProduct/page`,
      method: "get",
      params: data,
    });
  },
  //批量新增会员积分商品
  batchAddPointsProduct: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitPointsProduct/batchAdd`,
      method: "post",
      data,
    });
  },
  //  会员积分商品详情
  PointsProductDetail: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitPointsProduct/detail`,
      method: "post",
      data,
    });
  },
  //  会员积分商品修改
  updatePointsProductSave: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitPointsProduct/update`,
      method: "post",
      data,
    });
  },
  //  会员积分商品删除
  deletePointsProduct: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitPointsProduct/delete`,
      method: "post",
      data,
    });
  },
  //  会员积分商品上下架
  reverseEnablePointsProduct: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitPointsProduct/reverseEnable`,
      method: "post",
      data,
    });
  },
  //概况
  overview: (data) => {
    return $http.request({
      url: `/merchant-api/memberUnitUser/overview`,
      method: "get",
      params: data,
    });
  },
};
