welfareMall.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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 getIndexList(params ={}) {
  49. return this.postRequest(`${this.BASE_URL}open/welfare-mall/homepage-data`, params);
  50. }
  51. /**
  52. * 获取活动列表
  53. */
  54. static getActivityList(type,page,pageSize) {
  55. let params={
  56. type:type,
  57. page:page,
  58. pageSize:pageSize,
  59. }
  60. return this.postRequest(`${this.BASE_URL}open/welfare-mall/activity/list`, params);
  61. }
  62. /**
  63. * 获取活动详情
  64. */
  65. static getActivityDetail(activityId) {
  66. let params={
  67. activityId:activityId
  68. }
  69. return this.postRequest(`${this.BASE_URL}open/welfare-mall/activity/detail`, params);
  70. }
  71. /**
  72. * 创建订单
  73. */
  74. static createOrder(mobile,activityId,num,shopId="") {
  75. let params = {
  76. activityId:activityId,
  77. memberMobile:mobile,
  78. num:num,
  79. shopId:shopId
  80. };
  81. return this.postRequest(`${this.BASE_URL}open/activity/create-order`, params);
  82. }
  83. //获取支付参数
  84. static getOrderParams(orderSn,openId) {
  85. let params = {
  86. orderSn:orderSn,
  87. source: "WX_MINI_APP",
  88. thirdPartyName: 'coupon-activity',
  89. payCode: "HSAY-SHARE",
  90. openId: openId
  91. };
  92. return this.postRequest(`${this.BASE_URL}open/activity/get-order-params`, params);
  93. }
  94. }
  95. export default WelfareMall