index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. // 根据商品id活动对应的奖品区域信息
  28. getPrizeAreaByGoodsId: (params) => {
  29. return request({
  30. url: '/promotion/luck-prize/get/extend/area',
  31. method: 'GET',
  32. params,
  33. });
  34. },
  35. // 创建用户期望奖品记录
  36. luckTargetCreate: (data) => {
  37. return request({
  38. url: '/promotion/luck-lottery/user-target/create',
  39. method: 'POST',
  40. data,
  41. });
  42. },
  43. // 根据订单id获取中奖记录
  44. getLuckLotteryRecordByOrderId: (orderId) => {
  45. return request({
  46. url: '/promotion/luck-lottery-record/get/by-order-id',
  47. method: 'GET',
  48. params: { orderId },
  49. });
  50. },
  51. // 根据订单id组获取中奖记录
  52. getLuckLotteryRecordByOrderIds: (orderIds) => {
  53. return request({
  54. url: '/promotion/luck-lottery-record/get/by-order-ids',
  55. method: 'GET',
  56. params: { orderIds },
  57. });
  58. },
  59. };
  60. export default PrizeApi;