goodsCouponApi.js 1.95 KB
import { other_http } from '@/main'
const url = 'rop-scrm-coupon/router'
const defaultPath = 'scrm.api.coupon.'

/**商品分页查询*/
const getCouponsList = params => {
  params.method = `${defaultPath}equity.list.merchant`
  return other_http({
    url,
    data: params
  })
}

const createCoupons = params => {
  params.method = `${defaultPath}equity.batch.create`
  return other_http({
    url,
    data: params
  })
}

const getExportApi = params => {
  params.method = `${defaultPath}equity.list.merchant.export`
  return other_http({
    url,
    data: params,
    sign: true
  })
}

//领取记录列表
const getListReceiveRecordApi = params => {
  params.method = `${defaultPath}listReceiveRecordByCouponId`
  return other_http({
    url,
    method: 'GET',
    data: params,
    sign: true
  })
}

//查看优惠券
const getCouponDetailApi = params => {
  params.method = `${defaultPath}detail`
  return other_http({
    url,
    method: 'GET',
    data: params,
    sign: true
  })
}

//删除
const deleteCouponApi = params => {
  params.method = `${defaultPath}delete`
  return other_http({
    url,
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

// 优惠券-作废
const couponUserCancelApi = params => {
  params.method = `${defaultPath}user.cancel`
  return other_http({
    url,
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const detailExportApi = params => {
  params.method = `${defaultPath}equity.exportReceiveRecord`
  return other_http({
    url,
    data: params,
    sign: true
  })
}

//生效/失效
const effectiveCouponApi = params => {
  params.method = `${defaultPath}effective`
  return other_http({
    url,
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

export default {
  getCouponsList,
  createCoupons,
  getExportApi,
  getListReceiveRecordApi,
  getCouponDetailApi,
  deleteCouponApi,
  couponUserCancelApi,
  detailExportApi,
  effectiveCouponApi
}