welfareMall.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. import request from '../utils/request.js'
  2. class WelfareMall extends request {
  3. /**
  4. * 获取订单
  5. */
  6. static getOrder(params) {
  7. return this.postRequest(`${this.BASE_URL}open/welfare-mall/order/get`, params);
  8. }
  9. /**
  10. * 取消订单
  11. */
  12. static cancelOrder(params) {
  13. return this.postRequest(`${this.BASE_URL}open/welfare-mall/order/cancel`, params);
  14. }
  15. /**
  16. * 订单列表
  17. */
  18. static getOrderList(params) {
  19. return this.postRequest(`${this.BASE_URL}open/welfare-mall/order/list`, params);
  20. }
  21. /**
  22. * 订单退款
  23. */
  24. static orderRefund(params) {
  25. return this.postRequest(`${this.BASE_URL}open/welfare-mall/order/refund`, params);
  26. }
  27. /**
  28. * 获得订单支付参数
  29. */
  30. static getPayParams(params) {
  31. return this.postRequest(`${this.BASE_URL}open/welfare-mall/activity/get-pay-params`, params);
  32. }
  33. /**
  34. * 获取订单的退款单信息
  35. */
  36. static getRefundOrderList(params) {
  37. return this.postRequest(`${this.BASE_URL}open/welfare-mall/order/get-refund-order-list`, params);
  38. }
  39. /**
  40. * 获取订单的退款单状态
  41. */
  42. static getRefundOrderStatus(params) {
  43. return this.postRequest(`${this.BASE_URL}open/welfare-mall/order/get-refund-order-status`, params);
  44. }
  45. /**
  46. * 添加反馈
  47. */
  48. static feedBackAdd(params) {
  49. return this.postRequest(`${this.BASE_URL}open/welfare-mall/add-feedback`, params);
  50. }
  51. /**
  52. * 福利社
  53. * 获取购买优惠券个数
  54. */
  55. static async getUserBuyCouponNum(params) {
  56. return this.postRequest(`${this.BASE_URL}open/welfare-mall/user-buy-coupon-num`, params);
  57. }
  58. /**
  59. * 签到
  60. * 获取购买优惠券个数
  61. */
  62. static async getUserAwardCouponNum(params) {
  63. return this.postRequest(`${this.BASE_URL}open/sign-in/user-award-coupon-num`, params);
  64. }
  65. /**
  66. * 抽奖
  67. * 获取购买优惠券个数
  68. */
  69. static async getUserDrawCouponNum(params) {
  70. return this.postRequest(`${this.BASE_URL}open/luck-draw/user-draw-coupon-num`, params);
  71. }
  72. /**
  73. * 获取首页信息
  74. */
  75. static getIndexList(params ={}) {
  76. return this.postRequest(`${this.BASE_URL}open/welfare-mall/homepage-data`, params);
  77. }
  78. /**
  79. * 获取活动列表
  80. */
  81. static getActivityList(type,page,pageSize) {
  82. let params={
  83. type:type,
  84. page:page,
  85. pageSize:pageSize,
  86. }
  87. return this.postRequest(`${this.BASE_URL}open/welfare-mall/activity/list`, params);
  88. }
  89. /**
  90. * 获取活动详情
  91. */
  92. static getActivityDetail(activityId) {
  93. let params={
  94. activityId:activityId
  95. }
  96. return this.postRequest(`${this.BASE_URL}open/welfare-mall/activity/detail`, params);
  97. }
  98. /**
  99. * 创建订单
  100. */
  101. static createOrder(mobile,activityId,num,shopId="") {
  102. let params = {
  103. activityId:activityId,
  104. memberMobile:mobile,
  105. num:num,
  106. shopId:shopId
  107. };
  108. return this.postRequest(`${this.BASE_URL}open/activity/create-order`, params);
  109. }
  110. //获取支付参数
  111. static getOrderParams(orderSn,openId) {
  112. let params = {
  113. orderSn:orderSn,
  114. source: "FREE_MINI_APP",
  115. thirdPartyName: 'coupon-activity',
  116. payCode: "HSAY-SHARE",
  117. openId: openId
  118. };
  119. return this.postRequest(`${this.BASE_URL}open/activity/get-order-params`, params);
  120. }
  121. }
  122. export default WelfareMall