home.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. import request from "@/utils/request.js";
  2. /* 首页*/
  3. // 查询轮播数据
  4. export function getAdsList(data) {
  5. return request.get("v1/ads-list",data,{
  6. noAuth:true
  7. });
  8. }
  9. // 查询首页公告消息
  10. export function getNoticeList(data) {
  11. return request.get("v1/notice-list",data);
  12. }
  13. // 根据一级商品分类查询二级商品分类
  14. export function getCategoryOne(data) {
  15. return request.get("/v1/category/list",data);
  16. }
  17. // 根据一级商品分类查询二级商品分类
  18. export function getCategoryTwo(data) {
  19. return request.get("v1/category/list",data);
  20. }
  21. // 商品分页查询
  22. export function getGoodsPage(data) {
  23. return request.get("v1/goods-page",data);
  24. }
  25. // 根据用户Id查询首页商品列表
  26. export function getIndexData(data) {
  27. return request.get("v1/index-data",data);
  28. }
  29. // 根据商品列表
  30. export function getGoodsInfo(data) {
  31. return request.get("v1/re/goodsInfo/page",data);
  32. }
  33. // 查询商品列表
  34. export function getGoodsList(data) {
  35. return request.get("v1/goods/page",data);
  36. }
  37. /* 商品详情*/
  38. // 商品详情
  39. export function getGoodsDetail(data) {
  40. return request.get("v1/re/goodsInfo/detail",data);
  41. }
  42. // 获取用户收获地址
  43. export function getUserAddressByUserId(data) {
  44. return request.get("v1/userAddress-detailByUserId",data);
  45. }
  46. //
  47. export function getUserAddressByIdAndFreight(data) {
  48. return request.get("v1/userAddress-detailByIdAndFreight",data);
  49. }
  50. //
  51. export function getAvailableChec(data) {
  52. return request.get("v1/re/order/availableChec",data);
  53. }
  54. // 获取用户地址列表
  55. export function getUserAddressPage(data) {
  56. return request.get("v1/userAddress-page",data);
  57. }
  58. // 保存地址
  59. export function postUserAddressSave(data) {
  60. return request.post("v1/userAddress-save",data);
  61. }
  62. // 更改地址
  63. export function postUserAddressUpdate(data) {
  64. return request.post("v1/userAddress-update",data);
  65. }
  66. // 查询用户地址详情
  67. export function getUserAddressDetailById(data) {
  68. return request.get("v1/userAddress-detailById",data);
  69. }
  70. // 查询用户地址详情
  71. export function postUserAddressRemove(data) {
  72. let url = "ids="+data.ids
  73. return request.post("v1/userAddress-remove?"+url,data);
  74. }
  75. // 查询用户订单接口
  76. export function getUserOrderPage(data) {
  77. return request.get("v1/order/user",data);
  78. }
  79. // 查询用户订单接口
  80. export function getUserOrderDetail(data) {
  81. return request.get("v1/order/user/detail",data);
  82. }
  83. // 更换自提点
  84. export function modifySelfTake(data) {
  85. let url = "orderId="+data.orderId + "&selfTakeId=" + data.selfTakeId
  86. return request.post("v1/order/modifySelfTake?" + url);
  87. }
  88. // 根据用户订单NO查询物流信息
  89. export function getOrderLogistic(data) {
  90. return request.get("v1/order/logistic",data);
  91. }
  92. // 根据用户订单NO查询信息
  93. export function getOrderDetailById(data) {
  94. return request.get("v1/order/detail",data);
  95. }
  96. // 取消订单
  97. export function orderCancel(orderId) {
  98. return request.post("v1/order/cancel?orderId=" + orderId);
  99. }
  100. // 申请退款
  101. export function postUserOrderRefund(data) {
  102. let url = "orderId="+data.id
  103. return request.post("v1/order/refund?"+url,data);
  104. }
  105. // 立即购买下单前置校验
  106. export function postOrderSubmit(data) {
  107. return request.post("v1/order/submit",data);
  108. }
  109. // jspai下单API
  110. export function postJsapiPay(data) {
  111. let url = "?openid="+data.openId + "&orderNo="+data.outTradeNo
  112. return request.post("v1/wxPay/jsapiPay"+url,data);
  113. }
  114. // 获取手机验证码VS
  115. export function postSendValidate(data) {
  116. let url = "?phone="+data.phone
  117. return request.post("v1/common/send-validate"+url,data,{
  118. noAuth: true
  119. });
  120. }
  121. // 获取手机验证码VS
  122. export function postUserRegister(data) {
  123. let url = "?phone="+data.phone+"&password="+data.password
  124. +"&captchaCode="+ data.captchaCode+"&captchaId="+data.captchaId
  125. +"&inviteCode="+data.inviteCode
  126. return request.post("v1/user-register"+url,data,{
  127. noAuth: true
  128. });
  129. }
  130. // 微信授权登录
  131. export function postLoginAuth(data) {
  132. let url = "?code="+data.code+"&getPhoneNumberCode="+data.getPhoneNumberCode
  133. return request.post("v1/login/wx-auth"+url,data,{
  134. noAuth: true,
  135. noVerify: true
  136. });
  137. }
  138. // 获取分享连接
  139. export function postLinkedUrl(data) {
  140. // let url = "?code="+data.code+"&getPhoneNumberCode="+data.getPhoneNumberCode
  141. return request.post("v1/linked/getLinkedUser",data);
  142. }