brokerage.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import request from '@/sheep/request';
  2. const BrokerageApi = {
  3. // 绑定推广员
  4. bindBrokerageUser: (data)=>{
  5. return request({
  6. url: '/trade/brokerage-user/bind',
  7. method: 'PUT',
  8. data
  9. });
  10. },
  11. // 获得个人分销信息
  12. getBrokerageUser: () => {
  13. return request({
  14. url: '/trade/brokerage-user/get',
  15. method: 'GET'
  16. });
  17. },
  18. // 获得个人分销统计
  19. getBrokerageUserSummary: () => {
  20. return request({
  21. url: '/trade/brokerage-user/get-summary',
  22. method: 'GET',
  23. });
  24. },
  25. // 获得分销记录分页
  26. getBrokerageRecordPage: params => {
  27. if (params.status === undefined) {
  28. delete params.status
  29. }
  30. const queryString = Object.keys(params)
  31. .map(key => encodeURIComponent(key) + '=' + params[key])
  32. .join('&');
  33. return request({
  34. url: `/trade/brokerage-record/page?${queryString}`,
  35. method: 'GET',
  36. });
  37. },
  38. // 创建分销提现
  39. createBrokerageWithdraw: data => {
  40. return request({
  41. url: '/trade/brokerage-withdraw/create',
  42. method: 'POST',
  43. data,
  44. });
  45. },
  46. // 获得商品的分销金额
  47. getProductBrokeragePrice: spuId => {
  48. return request({
  49. url: '/trade/brokerage-record/get-product-brokerage-price',
  50. method: 'GET',
  51. params: { spuId }
  52. });
  53. },
  54. // 获得分销用户排行(基于佣金)
  55. getRankByPrice: params => {
  56. const queryString = `times=${params.times[0]}&times=${params.times[1]}`;
  57. return request({
  58. url: `/trade/brokerage-user/get-rank-by-price?${queryString}`,
  59. method: 'GET',
  60. });
  61. },
  62. // 获得分销用户排行分页(基于佣金)
  63. getBrokerageUserChildSummaryPageByPrice: params => {
  64. const queryString = Object.keys(params)
  65. .map(key => encodeURIComponent(key) + '=' + params[key])
  66. .join('&');
  67. return request({
  68. url: `/trade/brokerage-user/rank-page-by-price?${queryString}`,
  69. method: 'GET',
  70. });
  71. },
  72. // 获得分销用户排行分页(基于用户量)
  73. getBrokerageUserRankPageByUserCount: params => {
  74. const queryString = Object.keys(params)
  75. .map(key => encodeURIComponent(key) + '=' + params[key])
  76. .join('&');
  77. return request({
  78. url: `/trade/brokerage-user/rank-page-by-user-count?${queryString}`,
  79. method: 'GET',
  80. });
  81. },
  82. // 获得下级分销统计分页
  83. getBrokerageUserChildSummaryPage: params => {
  84. return request({
  85. url: '/trade/brokerage-user/child-summary-page',
  86. method: 'GET',
  87. params,
  88. })
  89. }
  90. }
  91. export default BrokerageApi