brokerage.js 2.4 KB

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