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

const defaultPath = 'scrm.api.coupon.'

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

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

//优惠券列表-集团-导出
const couponGroupExportApi = params => {
  params.method = 'scrm.api.coupon.gh.group.list.export'
  return http({
    url: 'rop-scrm-coupon/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

//优惠券列表-门店-导出
const couponStoreExportApi = params => {
  params.method = 'scrm.api.coupon.gh.store.list.export'
  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 getPackageListApi = params => {
  params.method = 'scrm.api.equity.package.gh.list.with.page'
  return http({
    url: 'rop-scrm-equity/router',
    method: 'GET',
    data: params,
    sign: 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 verificationExportApi = params => {
  params.method = `${defaultPath}verification.code.export.list`
  return http({
    url: 'rop-scrm-coupon/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

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

//导出领取记录列表
const exportReceiveRecordApi = params => {
  params.method = `${defaultPath}exportReceiveRecordByCouponId`
  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 { getCouponListApi, couponExportApi, couponGroupExportApi, couponStoreExportApi, getPackageListApi, getVerificationListApi, verificationExportApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi, getListReceiveRecordApi, exportReceiveRecordApi }