home.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. // 根据用户订单NO查询物流信息
  82. export function getOrderLogistic(data) {
  83. return request.get("v1/order/logistic",data);
  84. }
  85. // 根据用户订单NO查询信息
  86. export function getOrderDetailById(data) {
  87. return request.get("v1/order/detail",data);
  88. }
  89. // 取消订单
  90. export function orderCancel(orderId) {
  91. return request.post("v1/order/cancel?orderId=" + orderId);
  92. }
  93. // 申请退款
  94. export function postUserOrderRefund(data) {
  95. let url = "id="+data.id
  96. return request.post("v1/finance/order-refund?"+url,data);
  97. }
  98. // 立即购买下单前置校验
  99. export function postOrderSubmit(data) {
  100. return request.post("v1/order/submit",data);
  101. }
  102. // jspai下单API
  103. export function postJsapiPay(data) {
  104. let url = "?openid="+data.openId + "&orderNo="+data.outTradeNo
  105. return request.post("v1/wxPay/jsapiPay"+url,data);
  106. }
  107. // 获取手机验证码VS
  108. export function postSendValidate(data) {
  109. let url = "?phone="+data.phone
  110. return request.post("v1/common/send-validate"+url,data,{
  111. noAuth: true
  112. });
  113. }
  114. // 获取手机验证码VS
  115. export function postUserRegister(data) {
  116. let url = "?phone="+data.phone+"&password="+data.password
  117. +"&captchaCode="+ data.captchaCode+"&captchaId="+data.captchaId
  118. +"&inviteCode="+data.inviteCode
  119. return request.post("v1/user-register"+url,data,{
  120. noAuth: true
  121. });
  122. }
  123. // 微信授权登录
  124. export function postLoginAuth(data) {
  125. let url = "?code="+data.code+"&getPhoneNumberCode="+data.getPhoneNumberCode
  126. return request.post("v1/login/wx-auth"+url,data,{
  127. noAuth: true,
  128. noVerify: true
  129. });
  130. }
  131. // 获取分享连接
  132. export function postLinkedUrl(data) {
  133. // let url = "?code="+data.code+"&getPhoneNumberCode="+data.getPhoneNumberCode
  134. return request.post("v1/linked/getLinkedUser",data);
  135. }