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/membershipUser/page`,
      method: "post",
      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/membershipUser/overview`,
      method: "post",
      data
    });
  },
  //获取店铺会员等级列表
  levelList: data => {
    return $http.request({
      url: `/merchant-api/membershipEnable/levelList`,
      method: "post",
      data
    });
  },
  //积分明细分页查询
  pointsChangePage: data => {
    return $http.request({
      url: `/merchant-api/membershipUser/pointsChangePage`,
      method: "post",
      data
    });
  },
  //成长值变化分页查询
  growthValueChangePage: data => {
    return $http.request({
      url: `/merchant-api/membershipUser/growthValueChangePage`,
      method: "post",
      data
    });
  },
  //获取会员优惠券列表
  memberCouponPage: params => {
    return $http.request({
      url: `/merchant-api/coupon/user/page`,
      method: "get",
      params
    });
  },

  // 新增积分商品相关接口
  // 获取积分商品分页信息
  membershipPointsProductPage: data => {
    return $http.request({
      url: `/merchant-api/membershipPointsProduct/page`,
      method: "post",
      data
    });
  },

  // 添加积分商品
  addMembershipPointsProduct: data => {
    return $http.request({
      url: `/merchant-api/membershipPointsProduct/add`,
      method: "post",
      data
    });
  },

  // 删除积分商品
  deleteMembershipPointsProduct: data => {
    return $http.request({
      url: `/merchant-api/membershipPointsProduct/delete`,
      method: "post",
      data
    });
  },

  // 积分商品启用状态切换
  reverseEnableMemberUnitPointsProduct: data => {
    return $http.request({
      url: `/merchant-api/memberUnitPointsProduct/reverseEnable`,
      method: "post",
      data
    });
  },

  // 修改积分商品
  updateMembershipPointsProduct: data => {
    return $http.request({
      url: `/merchant-api/membershipPointsProduct/update`,
      method: "post",
      data
    });
  }
};
