user.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. import request from '@/utils/request'
  2. //绑定上级
  3. export function spread(data) {
  4. return request({
  5. url: '/api/user/spread',
  6. method: 'post',
  7. data
  8. })
  9. }
  10. //我的推广
  11. export function myspread(data) {
  12. return request({
  13. url: '/api/spread/people',
  14. method: 'POST',
  15. data
  16. });
  17. }
  18. // 订单统计信息
  19. export function orderData(data) {
  20. return request({
  21. url: '/api/order/data',
  22. method: 'get',
  23. data
  24. });
  25. }
  26. // 获取用户信息
  27. export function getUserInfo(data) {
  28. return request({
  29. url: '/api/userinfo',
  30. method: 'get',
  31. data
  32. });
  33. }
  34. // 获取用户信息
  35. export function userinfo(data) {
  36. return request({
  37. url: '/api/userinfo',
  38. method: 'get',
  39. data
  40. });
  41. }
  42. // 用户分享图
  43. export function spreadBanner(data) {
  44. return request({
  45. url: '/api/spread/banner',
  46. method: 'get',
  47. data
  48. });
  49. }
  50. // 获取地址列表
  51. export function getAddressList(data) {
  52. return request({
  53. url: '/api/address/list',
  54. method: 'get',
  55. data
  56. });
  57. }
  58. // 修改地址
  59. export function addressEdit(data) {
  60. return request({
  61. url: '/api/address/edit',
  62. method: 'post',
  63. data
  64. });
  65. }
  66. // 删除地址
  67. export function addressDel(data) {
  68. return request({
  69. url: '/api/address/del',
  70. method: 'post',
  71. data
  72. });
  73. }
  74. // 设为默认地址
  75. export function setAddressDefault(data) {
  76. return request({
  77. url: '/api/address/default/set',
  78. method: 'post',
  79. data
  80. });
  81. }
  82. // 购物车列表
  83. export function getCartList(data) {
  84. return request({
  85. url: '/api/cart/list',
  86. method: 'get',
  87. data
  88. });
  89. }
  90. // 修改购物车数量
  91. export function getCartNum(data) {
  92. return request({
  93. url: '/api/cart/num',
  94. method: 'post',
  95. data
  96. });
  97. }
  98. //删除购物车
  99. export function cartDel(data) {
  100. return request({
  101. url: '/api/cart/del',
  102. method: 'post',
  103. data
  104. });
  105. }
  106. //获取收藏夹列表
  107. export function getcollectList(data) {
  108. return request({
  109. url: '/api/collect/user',
  110. method: 'get',
  111. data
  112. });
  113. }
  114. // 取消收藏
  115. export function delcollect(data) {
  116. return request({
  117. url: '/api/collect/del',
  118. method: 'post',
  119. data
  120. });
  121. }
  122. //文章列表
  123. export function article(data, id) {
  124. return request({
  125. url: '/api/article/list/' + id,
  126. method: 'GET',
  127. data
  128. });
  129. }
  130. //文章详情
  131. export function details(data, id) {
  132. return request({
  133. url: '/api/article/details/' + id,
  134. method: 'GET',
  135. data
  136. });
  137. }