You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.7 KiB
JavaScript

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