home.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. import request from "@/utils/request.js";
  2. /* 首页*/
  3. // 查询轮播数据
  4. export function getAdsList(data) {
  5. return request.get("v1/re/ads/list",data);
  6. }
  7. // 查询首页公告消息
  8. export function getNoticeList(data) {
  9. return request.get("v1/notice-list",data);
  10. }
  11. // 根据一级商品分类查询二级商品分类
  12. export function getCategoryOne(data) {
  13. return request.get("/v1/re/category/list",data);
  14. }
  15. // 根据一级商品分类查询二级商品分类
  16. export function getCategoryTwo(data) {
  17. return request.get("v1/re/category/list",data);
  18. }
  19. // 商品分页查询
  20. export function getGoodsPage(data) {
  21. return request.get("v1/goods-page",data);
  22. }
  23. // 根据用户Id查询首页商品列表
  24. export function getIndexData(data) {
  25. return request.get("v1/index-data",data);
  26. }
  27. // 根据商品列表
  28. export function getGoodsInfo(data) {
  29. return request.get("v1/re/goodsInfo/page",data);
  30. }
  31. /* 商品详情*/
  32. // 商品详情
  33. export function getGoodsDetail(data) {
  34. return request.get("v1/re/goodsInfo/detail",data);
  35. }
  36. // 获取用户收获地址
  37. export function getUserAddressByUserId(data) {
  38. return request.get("v1/userAddress-detailByUserId",data);
  39. }
  40. //
  41. export function getUserAddressByIdAndFreight(data) {
  42. return request.get("v1/userAddress-detailByIdAndFreight",data);
  43. }
  44. //
  45. export function getAvailableChec(data) {
  46. return request.get("v1/re/order/availableChec",data);
  47. }
  48. // 获取用户地址列表
  49. export function getUserAddressPage(data) {
  50. return request.get("v1/userAddress-page",data);
  51. }
  52. // 保存地址
  53. export function postUserAddressSave(data) {
  54. return request.post("v1/userAddress-save",data);
  55. }
  56. // 更改地址
  57. export function postUserAddressUpdate(data) {
  58. return request.post("v1/userAddress-update",data);
  59. }
  60. // 查询用户地址详情
  61. export function getUserAddressDetailById(data) {
  62. return request.get("v1/userAddress-detailById",data);
  63. }
  64. // 查询用户地址详情
  65. export function postUserAddressRemove(data) {
  66. let url = "ids="+data.ids
  67. return request.post("v1/userAddress-remove?"+url,data);
  68. }
  69. // 查询用户订单接口
  70. export function getUserOrderPage(data) {
  71. return request.get("v1/finance/order-page",data);
  72. }
  73. // 根据用户订单NO查询物流信息
  74. export function getOrderLogistic(data) {
  75. return request.get("v1/order/logistic",data);
  76. }
  77. // 根据用户订单NO查询信息
  78. export function getOrderDetailById(data) {
  79. return request.get("v1/order/detail",data);
  80. }
  81. // 取消订单
  82. export function postUserOrderCancel(data) {
  83. let url = "id="+data.id
  84. return request.post("v1/finance/order-cancel?"+url,data);
  85. }
  86. // 申请退款
  87. export function postUserOrderRefund(data) {
  88. let url = "id="+data.id
  89. return request.post("v1/finance/order-refund?"+url,data);
  90. }
  91. // 立即购买下单前置校验
  92. export function postBeforeCheck(data) {
  93. return request.post("v1/re/order/beforeCheck",data);
  94. }
  95. // 进入商品详情可售检测
  96. export function getAvailableCheck(data) {
  97. return request.get("v1/re/order/availableCheck",data);
  98. }
  99. // 立即购买下单前置校验
  100. export function postOrderSubmit(data) {
  101. return request.post("v1/re/order/submit",data);
  102. }
  103. // jspai下单API
  104. export function postJsapiPay(data) {
  105. let url = "?openid="+data.openId + "&outTradeNo="+data.outTradeNo
  106. return request.post("v1/wxPay/v3/jsapiPay"+url,data);
  107. }
  108. // 获取手机验证码VS
  109. export function postSendValidate(data) {
  110. let url = "?phone="+data.phone
  111. return request.post("v1/common/send-validate"+url,data,{
  112. noAuth: true
  113. });
  114. }
  115. // 获取手机验证码VS
  116. export function postUserRegister(data) {
  117. let url = "?phone="+data.phone+"&password="+data.password
  118. +"&captchaCode="+ data.captchaCode+"&captchaId="+data.captchaId
  119. +"&inviteCode="+data.inviteCode
  120. return request.post("v1/user-register"+url,data,{
  121. noAuth: true
  122. });
  123. }
  124. // 微信授权登录
  125. export function postLoginAuth(data) {
  126. let url = "?code="+data.code+"&getPhoneNumberCode="+data.getPhoneNumberCode
  127. return request.post("v1/login/wx-auth"+url,data,{
  128. noAuth: true,
  129. noVerify: true
  130. });
  131. }
  132. // 服务商数据
  133. export function postStatistics(data) {
  134. let url = "?userId="+data.userId
  135. return request.post("v1/linked/getStatistics"+url,data);
  136. }
  137. // 获取分享连接
  138. export function postLinkedUrl(data) {
  139. // let url = "?code="+data.code+"&getPhoneNumberCode="+data.getPhoneNumberCode
  140. return request.post("v1/linked/getLinkedUser",data);
  141. }
  142. // 红包排行榜
  143. export function leaderboard(data) {
  144. return request.get('v1/re/leaderboard', data)
  145. }
  146. // 红包首页数据-统计
  147. export function todayStatistics(data) {
  148. return request.get('v1/re/todayStatistics', data)
  149. }
  150. // 绑定记录
  151. export function linkedBindLogList(data) {
  152. return request.get('v1/linked/linkedBindLogList', data)
  153. }
  154. // 收益记录
  155. export function earningsList(data) {
  156. return request.get('v1/linked/earningsList', data)
  157. }
  158. // 查询当前登录人领取的红包金额记录
  159. export function logListByUserId(data) {
  160. return request.get('/v1/re/logListByUserId', data)
  161. }
  162. // 分页查询错失红包记录列表
  163. export function exclusivePage(data) {
  164. return request.get('/v1/re/exclusivePage', data)
  165. }
  166. // 判断当前用户是否可以抢红包
  167. export function grabFlag(data) {
  168. return request.get('/v1/re/grabFlagList', data)
  169. }
  170. // 抢红包
  171. export function doGrab(data) {
  172. return request.get('/v1/re/grab', data)
  173. }
  174. // 直属伙伴
  175. export function linkedUserList(data) {
  176. return request.get('/v1/linked/linkedUserList', data)
  177. }
  178. // 直推人数
  179. export function userRecomPage(data) {
  180. return request.get('/v1/userRecom-page', data)
  181. }
  182. // 查询自己的创客人数
  183. export function makerPage(data) {
  184. return request.post('/v1/makerPage', data)
  185. }