zyejMAll-mobile/sheep/api/trade/brokerage.js

94 lines
2.5 KiB
JavaScript
Raw Normal View History

2024-08-07 10:31:42 +08:00
import request from '@/sheep/request';
const BrokerageApi = {
// 绑定分销用户
2024-08-07 21:40:27 +08:00
bindBrokerageUser: (data) => {
2024-08-07 10:31:42 +08:00
return request({
url: '/trade/brokerage-user/bind',
method: 'PUT',
2024-08-07 21:40:27 +08:00
data,
2024-08-07 10:31:42 +08:00
});
},
// 获得个人分销信息
getBrokerageUser: () => {
return request({
url: '/trade/brokerage-user/get',
2024-08-07 21:40:27 +08:00
method: 'GET',
2024-08-07 10:31:42 +08:00
});
},
// 获得个人分销统计
getBrokerageUserSummary: () => {
return request({
url: '/trade/brokerage-user/get-summary',
method: 'GET',
});
},
// 获得分销记录分页
2024-08-07 21:40:27 +08:00
getBrokerageRecordPage: (params) => {
2024-08-07 10:31:42 +08:00
if (params.status === undefined) {
2024-08-07 21:40:27 +08:00
delete params.status;
2024-08-07 10:31:42 +08:00
}
const queryString = Object.keys(params)
2024-08-07 21:40:27 +08:00
.map((key) => encodeURIComponent(key) + '=' + params[key])
2024-08-07 10:31:42 +08:00
.join('&');
return request({
url: `/trade/brokerage-record/page?${queryString}`,
method: 'GET',
});
},
// 创建分销提现
2024-08-07 21:40:27 +08:00
createBrokerageWithdraw: (data) => {
2024-08-07 10:31:42 +08:00
return request({
url: '/trade/brokerage-withdraw/create',
method: 'POST',
data,
});
},
// 获得商品的分销金额
2024-08-07 21:40:27 +08:00
getProductBrokeragePrice: (spuId) => {
2024-08-07 10:31:42 +08:00
return request({
url: '/trade/brokerage-record/get-product-brokerage-price',
method: 'GET',
2024-08-07 21:40:27 +08:00
params: { spuId },
2024-08-07 10:31:42 +08:00
});
},
// 获得分销用户排行(基于佣金)
2024-08-07 21:40:27 +08:00
getRankByPrice: (params) => {
2024-08-07 10:31:42 +08:00
const queryString = `times=${params.times[0]}&times=${params.times[1]}`;
return request({
url: `/trade/brokerage-user/get-rank-by-price?${queryString}`,
method: 'GET',
});
},
// 获得分销用户排行分页(基于佣金)
2024-08-07 21:40:27 +08:00
getBrokerageUserChildSummaryPageByPrice: (params) => {
2024-08-07 10:31:42 +08:00
const queryString = Object.keys(params)
2024-08-07 21:40:27 +08:00
.map((key) => encodeURIComponent(key) + '=' + params[key])
2024-08-07 10:31:42 +08:00
.join('&');
return request({
url: `/trade/brokerage-user/rank-page-by-price?${queryString}`,
method: 'GET',
});
},
// 获得分销用户排行分页(基于用户量)
2024-08-07 21:40:27 +08:00
getBrokerageUserRankPageByUserCount: (params) => {
2024-08-07 10:31:42 +08:00
const queryString = Object.keys(params)
2024-08-07 21:40:27 +08:00
.map((key) => encodeURIComponent(key) + '=' + params[key])
2024-08-07 10:31:42 +08:00
.join('&');
return request({
url: `/trade/brokerage-user/rank-page-by-user-count?${queryString}`,
method: 'GET',
});
},
// 获得下级分销统计分页
2024-08-07 21:40:27 +08:00
getBrokerageUserChildSummaryPage: (params) => {
2024-08-07 10:31:42 +08:00
return request({
url: '/trade/brokerage-user/child-summary-page',
method: 'GET',
params,
2024-08-07 21:40:27 +08:00
});
},
};
2024-08-07 10:31:42 +08:00
2024-08-07 21:40:27 +08:00
export default BrokerageApi;