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

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