couponManage.js 2.26 KB
import { http } from '@/main'

const defaultPath = 'scrm.api.coupon.'

//优惠券列表
const getMerchantListApi = params => {
  params.method = `${defaultPath}list.merchant`
  return http({
    url: 'rop-scrm-coupon/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

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

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

//核销记录列表
const getVerificationListApi = params => {
  params.method = `${defaultPath}verification.code.verification.list`
  return http({
    url: 'rop-scrm-coupon/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

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

//优惠券核销
const codeVerificationApi = params => {
  params.method = `${defaultPath}verification.code.verification`
  return http({
    url: 'rop-scrm-coupon/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

//创建优惠券
const createCouponApi = params => {
  params.method = `${defaultPath}create`
  return http({
    url: 'rop-scrm-coupon/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

//修改优惠券
const updateCouponApi = params => {
  params.method = `${defaultPath}update`
  return http({
    url: 'rop-scrm-coupon/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

//获取
const getAllGoodsApi = params => {
  params.method = `scrm.api.shopmall.goods.page.curMerchant`
  return http({
    url: 'rop-scrm-shopmall/router',
    method: 'GET',
    data: params,
    sign: true
  })
}


export default { getMerchantListApi, getVerificationListApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi }