user.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. import request from '@/utils/request'
  2. import { upFilse} from '@/utils/request';
  3. // 订单统计信息
  4. export function orderData(data) {
  5. return request({
  6. url: '/api/order/number',
  7. method: 'get',
  8. data
  9. });
  10. }
  11. //获取用户信息
  12. // export function getUserInfo(data) {
  13. // return request({
  14. // url: '/api/userinfo',
  15. // method: 'get',
  16. // data
  17. // });
  18. // }
  19. /**
  20. * 获取用户信息 new
  21. *
  22. */
  23. export function getUserInfo(data) {
  24. // return request.get('user');
  25. return request({
  26. url: '/api/user',
  27. method: 'get',
  28. data
  29. })
  30. }
  31. // 用户分享图
  32. export function spreadBanner(data) {
  33. return request({
  34. url: '/api/spread/banner',
  35. method: 'get',
  36. data
  37. });
  38. }
  39. // 获取地址列表
  40. export function getAddressList(data) {
  41. return request({
  42. url: '/api/user/address/lst',
  43. method: 'get',
  44. data
  45. });
  46. }
  47. //获取单个地址
  48. export function getAddressDetail(id) {
  49. return request({
  50. url: 'user/address/detail/' + id,
  51. method: 'get'
  52. });
  53. }
  54. // 修改地址
  55. export function addressEdit(data) {
  56. return request({
  57. url: '/api/user/address/create',
  58. method: 'post',
  59. data
  60. });
  61. }
  62. // 删除地址
  63. export function addressDel(data,id) {
  64. return request({
  65. url: '/api/user/address/delete/'+id,
  66. method: 'post',
  67. data
  68. });
  69. }
  70. // 设为默认地址
  71. export function setAddressDefault(data,id) {
  72. return request({
  73. url: '/api/user/address/update/' + id,
  74. method: 'post',
  75. data
  76. });
  77. }
  78. // 购物车列表
  79. export function getCartList(data) {
  80. return request({
  81. url: '/api/user/cart/lst',
  82. method: 'get',
  83. data
  84. });
  85. }
  86. // 修改购物车数量
  87. export function getCartNum(cart_id,data) {
  88. return request({
  89. url: '/api/user/cart/change/' + cart_id,
  90. method: 'post',
  91. data
  92. });
  93. }
  94. //删除购物车
  95. export function cartDel(data) {
  96. return request({
  97. url: '/api/user/cart/delete',
  98. method: 'post',
  99. data
  100. });
  101. }
  102. //获取收藏夹列表
  103. export function getcollectList(data) {
  104. return request({
  105. url: '/api/collect/user',
  106. method: 'get',
  107. data
  108. });
  109. }
  110. // 取消收藏
  111. export function delcollect(data) {
  112. return request({
  113. url: '/api/collect/del',
  114. method: 'post',
  115. data
  116. });
  117. }
  118. //获取推广信息
  119. export function getExtensionData(data) {
  120. return request({
  121. // url: '/api/spread/people',
  122. url: '/api/user/spread_list',
  123. method: 'get',
  124. data
  125. })
  126. }
  127. export function uploads(data){
  128. return upFilse({
  129. url:'/api/upload/image',
  130. method:'post',
  131. data
  132. });
  133. }
  134. export function edit(data){
  135. return request({
  136. url: '/api/user/edit',
  137. method:'post',
  138. data
  139. });
  140. }
  141. // 获取佣金记录
  142. export function brokerage_list(data) {
  143. // return request.get("user/spread_info");
  144. return request({
  145. url: '/api/user/brokerage_list',
  146. method: 'get',
  147. data
  148. })
  149. }
  150. //佣金数据
  151. export function spreadInfo(data) {
  152. return request({
  153. url: '/api/user/spread_info',
  154. method: 'get',
  155. data
  156. })
  157. // return request.get("user/spread_info");
  158. }
  159. /*
  160. * 推广数据
  161. * */
  162. export function getSpreadInfo() {
  163. // return request.get("/commission");
  164. return request({
  165. url: '/api/commission',
  166. method: 'get'
  167. })
  168. }