welfareMall.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. static getPayStatus(orderSn) {
  107. let params={
  108. orderSn:orderSn
  109. }
  110. return this.postRequest(`${this.BASE_URL}open/call/getPayStatus`, params);
  111. }
  112. /**
  113. * 创建订单
  114. */
  115. static createOrder(mobile,activityId,num,shopId="", refStatisticsPostParam) {
  116. refStatisticsPostParam = refStatisticsPostParam || {}
  117. let params = {
  118. activityId:activityId,
  119. memberMobile:mobile,
  120. num:num,
  121. shopId:shopId,
  122. scene: refStatisticsPostParam.scene || "",
  123. channel: refStatisticsPostParam.channel || "0",
  124. department: refStatisticsPostParam.department || "0"
  125. };
  126. return this.postRequest(`${this.BASE_URL}open/activity/create-order`, params);
  127. }
  128. //获取支付参数
  129. static getOrderParams(orderSn,openId,isOrderPayment=false) {
  130. let params = {
  131. orderSn:orderSn,
  132. source: "FREE_MINI_APP",
  133. thirdPartyName: 'coupon-activity',
  134. payCode: "HSAY-SHARE",
  135. openId: openId
  136. };
  137. if(isOrderPayment){
  138. params.isOrderPayment =true;
  139. params.orderInfoPath = "pages/welfareMall/order/orderCompletion?ordersn="
  140. params.productDetailPath = "pages/welfareMall/activityInfo/activityInfo?activityId="
  141. }
  142. return this.postRequest(`${this.BASE_URL}open/activity/get-order-params`, params);
  143. }
  144. /**
  145. * 个人中心数据,包括导航
  146. */
  147. static getPersonalData(params) {
  148. return this.postRequest(`${this.BASE_URL}open/welfare-mall/personal-data`, params);
  149. }
  150. /**
  151. * 未使用的卡券个数
  152. */
  153. static async getUserCouponSnNum(params) {
  154. return this.postRequest(`${this.BASE_URL}open/coupon/user-coupon-sn-num`, params);
  155. }
  156. /**
  157. * 用户卡券列表
  158. */
  159. static getUserCouponSnList(params) {
  160. return this.postRequest(`${this.BASE_URL}open/coupon/user-coupon-sn-list`, params);
  161. }
  162. /**
  163. * 获取核销记录
  164. */
  165. static getHexiaoList(params) {
  166. return this.postRequest(`${this.BASE_URL}open/hexiao/list`, params);
  167. }
  168. /**
  169. * 根据手机识别职员信息
  170. */
  171. static discernStoreStaff(params) {
  172. return this.postRequest(`${this.BASE_URL}open/staff/discern-store-staff`, params);
  173. }
  174. /**
  175. * 根据职员获取门店列表
  176. */
  177. static getStoreListByStaff(params) {
  178. return this.postRequest(`${this.BASE_URL}open/staff/get-store-list-by-staff`, params);
  179. }
  180. /**
  181. * 根据登录手机号获取职员列表
  182. */
  183. static getStoreStaffList(params) {
  184. return this.postRequest(`${this.BASE_URL}open/staff/get-store-staff-list`, params);
  185. }
  186. /**
  187. * 添加门店职员
  188. */
  189. static addStoreStaff(params) {
  190. return this.postRequest(`${this.BASE_URL}open/staff/add-store-staff`, params);
  191. }
  192. /**
  193. * 删除门店职员
  194. */
  195. static delStoreStaff(params) {
  196. return this.postRequest(`${this.BASE_URL}open/staff/del-store-staff`, params);
  197. }
  198. }
  199. export default WelfareMall