luck-draw.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import request from '../utils/request.js'
  2. class LuckDraw extends request {
  3. static getActivityDetail(id) {
  4. let params = {
  5. id
  6. }
  7. return this.postRequest(`${this.BASE_URL}open/luck-draw/detail`, params, true)
  8. }
  9. static drawPrize(activityId, mobile) {
  10. const params = {
  11. activityId,
  12. mobile
  13. }
  14. return this.postRequest(`${this.BASE_URL}open/luck-draw/draw-prize`, params, true)
  15. }
  16. static getHitList(activityId) {
  17. const params = {
  18. activityId
  19. }
  20. return this.postRequest(`${this.BASE_URL}open/luck-draw/hit-list`, params, true)
  21. }
  22. static getActivityList(params) {
  23. return this.postRequest(`${this.BASE_URL}open/luck-draw/activity-list`, params)
  24. }
  25. /**
  26. * 用户抽奖记录
  27. * @param {} params
  28. */
  29. static getUserDrawRecord(params) {
  30. return this.postRequest(`${this.BASE_URL}open/luck-draw/user-draw-record`, params)
  31. }
  32. /**
  33. * @param {*} params
  34. */
  35. static getUserPrizeList(params) {
  36. return this.postRequest(`${this.BASE_URL}open/luck-draw/user-prize-list`, params)
  37. }
  38. /**
  39. * 分享回调
  40. */
  41. static shareActivity(activityId, mobile) {
  42. const params = {
  43. activityId,
  44. mobile
  45. }
  46. return this.postRequest(`${this.BASE_URL}open/luck-draw/share-activity`, params, true)
  47. }
  48. static getTimes(activityId, mobile) {
  49. const params = {
  50. activityId,
  51. mobile
  52. }
  53. return this.postRequest(`${this.BASE_URL}open/luck-draw/get-times`, params, true)
  54. }
  55. }
  56. export default LuckDraw;
  57. // 示例
  58. // LuckDraw.drawPrize(3, "16602120168").then(res => {
  59. // }).catch(_ => {})
  60. // LuckDraw.getHitList(3).then(res => {
  61. // }).catch(_ => {})
  62. // LuckDraw.getActivityList({
  63. // page: 1,
  64. // pageSize: 20
  65. // }).then(res => {
  66. // }).catch(_ => {})
  67. // LuckDraw.getUserDrawRecord({
  68. // mobile: "16602120168",
  69. // activityId: 3,
  70. // page: 1,
  71. // pageSize: 20
  72. // }).then(res => {
  73. // }).catch(_ => {})
  74. // LuckDraw.getUserPrizeList({
  75. // mobile: "16602120168",
  76. // goodsType: 1,
  77. // page: 1,
  78. // pageSize: 20
  79. // }).then(res => {
  80. // }).catch(_ => {})
  81. // LuckDraw.shareActivity(3, "16602120168").then(res => {
  82. // }).catch(_ => {})
  83. // LuckDraw.getTimes(3, "16602120168").then(res => {
  84. // }).catch(_ => {})