prize.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import request from '@/config/axios'
  2. // 根据商品id获取抽奖活动
  3. export const getPrizeByGoodsId = async (spuId) => {
  4. return await request.get({
  5. url: `/app-api/promotion/luck-lottery/get/by-spu-id`,
  6. params: { spuId }
  7. })
  8. }
  9. // 根据活动id获取奖品
  10. export const getPrizeByLotteryId = async (lotteryId) => {
  11. return await request.get({
  12. url: `/app-api/promotion/luck-prize/get`,
  13. params: { lotteryId }
  14. })
  15. }
  16. // 根据活动id获取用户抽奖次数
  17. export const getNumByLotteryId = async (lotteryId) => {
  18. return await request.get({
  19. url: `/app-api/promotion/luck-lottery/get/user-num`,
  20. params: { lotteryId }
  21. })
  22. }
  23. // 领取奖品
  24. export const luckyLotteryRecordReceive = async (data) => {
  25. return await request.post({
  26. url: `/app-api/promotion/luck-lottery-record/receive`,
  27. data
  28. })
  29. }
  30. // 根据商品id活动对应的奖品区域信息
  31. export const getPrizeAreaByGoodsId = async (params) => {
  32. return await request.get({
  33. url: '/app-api/promotion/luck-prize/get/extend/area',
  34. params
  35. })
  36. }
  37. // 抽奖记录分页
  38. export const getLuckLotteryRecordPage = async (params) => {
  39. return await request.get({
  40. url: '/app-api/promotion/luck-lottery-record/page',
  41. params
  42. })
  43. }
  44. // 根据订单id获取中奖记录
  45. export const getLuckLotteryRecordByOrderId = async (orderId) => {
  46. return await request.get({
  47. url: '/app-api/promotion/luck-lottery-record/get/by-order-id',
  48. params: { orderId }
  49. })
  50. }