index.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import request from '@/sheep/request';
  2. const PrizeApi = {
  3. // 根据活动id获取奖品
  4. getPrizeByLotteryId: (lotteryId) => {
  5. return request({
  6. url: '/promotion/luck-prize/get',
  7. method: 'GET',
  8. params: { lotteryId },
  9. });
  10. },
  11. // 根据商品id获取抽奖活动
  12. getPrizeByGoodsId: (spuId) => {
  13. return request({
  14. url: '/promotion/luck-lottery/get/by-spu-id',
  15. method: 'GET',
  16. params: { spuId },
  17. });
  18. },
  19. // 据活动id获取用户抽奖次数
  20. getNumByLotteryId: (lotteryId) => {
  21. return request({
  22. url: '/promotion/luck-lottery/get/user-num',
  23. method: 'GET',
  24. params: { lotteryId },
  25. });
  26. },
  27. // 抽奖记录分页
  28. getLuckLotteryRecordPage: (params) => {
  29. return request({
  30. url: '/promotion/luck-lottery-record/page',
  31. method: 'GET',
  32. params
  33. })
  34. },
  35. // 奖品领取
  36. luckyLotteryRecordReceive: (data) => {
  37. return request({
  38. url: '/promotion/luck-lottery-record/receive',
  39. method: 'POST',
  40. data
  41. })
  42. },
  43. // 放弃领取
  44. luckyLotteryRecordGiveUp: (id) => {
  45. return request({
  46. url: '/promotion/luck-lottery-record/give-up?id=' + id,
  47. method: 'POST'
  48. })
  49. }
  50. };
  51. export default PrizeApi;