welfareMall.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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/activity/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/activity/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. * @param {*} openId
  75. */
  76. static async getUser(params) {
  77. const res = await this.postRequest(`${this.BASE_URL}open/activity/get-user`, params)
  78. return res.data
  79. }
  80. /**
  81. * 获取首页信息
  82. */
  83. static getIndexList(params ={}) {
  84. return this.postRequest(`${this.BASE_URL}open/welfare-mall/homepage-data`, params);
  85. }
  86. /**
  87. * 获取活动列表
  88. */
  89. static getActivityList(type,page,pageSize) {
  90. let params={
  91. type:type,
  92. page:page,
  93. pageSize:pageSize,
  94. }
  95. return this.postRequest(`${this.BASE_URL}open/welfare-mall/activity/list`, params);
  96. }
  97. /**
  98. * 获取活动详情
  99. */
  100. static getActivityDetail(activityId) {
  101. let params={
  102. activityId:activityId
  103. }
  104. return this.postRequest(`${this.BASE_URL}open/welfare-mall/activity/detail`, params);
  105. }
  106. /**
  107. * 创建订单
  108. */
  109. static createOrder(mobile,activityId,num,shopId="") {
  110. let params = {
  111. activityId:activityId,
  112. memberMobile:mobile,
  113. num:num,
  114. shopId:shopId
  115. };
  116. return this.postRequest(`${this.BASE_URL}open/activity/create-order`, params);
  117. }
  118. //获取支付参数
  119. static getOrderParams(orderSn,openId) {
  120. let params = {
  121. orderSn:orderSn,
  122. source: "FREE_MINI_APP",
  123. thirdPartyName: 'coupon-activity',
  124. payCode: "HSAY-SHARE",
  125. openId: openId
  126. };
  127. return this.postRequest(`${this.BASE_URL}open/activity/get-order-params`, params);
  128. }
  129. /**
  130. * 个人中心数据,包括导航
  131. */
  132. static getPersonalData(params) {
  133. return this.postRequest(`${this.BASE_URL}open/welfare-mall/personal-data`, params);
  134. }
  135. /**
  136. * 未使用的卡券个数
  137. */
  138. static async getUserCouponSnNum(params) {
  139. return this.postRequest(`${this.BASE_URL}open/coupon/user-coupon-sn-num`, params);
  140. }
  141. /**
  142. * 用户卡券列表
  143. */
  144. static getUserCouponSnList(params) {
  145. return this.postRequest(`${this.BASE_URL}open/coupon/user-coupon-sn-list`, params);
  146. }
  147. /**
  148. * 获取核销记录
  149. */
  150. static getHexiaoList(params) {
  151. return this.postRequest(`${this.BASE_URL}open/hexiao/list`, params);
  152. }
  153. /**
  154. * 根据手机识别职员信息
  155. */
  156. static discernStoreStaff(params) {
  157. return this.postRequest(`${this.BASE_URL}open/staff/discern-store-staff`, params);
  158. }
  159. /**
  160. * 根据职员获取门店列表
  161. */
  162. static getStoreListByStaff(params) {
  163. return this.postRequest(`${this.BASE_URL}open/staff/get-store-list-by-staff`, params);
  164. }
  165. /**
  166. * 根据登录手机号获取职员列表
  167. */
  168. static getStoreStaffList(params) {
  169. return this.postRequest(`${this.BASE_URL}open/staff/get-store-staff-list`, params);
  170. }
  171. /**
  172. * 添加门店职员
  173. */
  174. static addStoreStaff(params) {
  175. return this.postRequest(`${this.BASE_URL}open/staff/add-store-staff`, params);
  176. }
  177. /**
  178. * 删除门店职员
  179. */
  180. static delStoreStaff(params) {
  181. return this.postRequest(`${this.BASE_URL}open/staff/del-store-staff`, params);
  182. }
  183. }
  184. export default WelfareMall