home.js 4.2 KB

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