acdr-ui/dist/dev/mp-weixin/modules/mall/sheep/api/trade/brokerage.js

87 lines
2.8 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";
2024-10-01 09:15:35 +08:00
const modules_mall_sheep_request_index = require("../../request/index.js");
2024-09-19 07:20:14 +08:00
const BrokerageApi = {
// 绑定分销用户
bindBrokerageUser: (data) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/brokerage-user/bind",
method: "PUT",
data
});
},
// 获得个人分销信息
getBrokerageUser: () => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/brokerage-user/get",
method: "GET"
});
},
// 获得个人分销统计
getBrokerageUserSummary: () => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/brokerage-user/get-summary",
method: "GET"
});
},
// 获得分销记录分页
getBrokerageRecordPage: (params) => {
if (params.status === void 0) {
delete params.status;
}
const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: `/trade/brokerage-record/page?${queryString}`,
method: "GET"
});
},
// 创建分销提现
createBrokerageWithdraw: (data) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/brokerage-withdraw/create",
method: "POST",
data
});
},
// 获得商品的分销金额
getProductBrokeragePrice: (spuId) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/brokerage-record/get-product-brokerage-price",
method: "GET",
params: { spuId }
});
},
// 获得分销用户排行(基于佣金)
getRankByPrice: (params) => {
const queryString = `times=${params.times[0]}&times=${params.times[1]}`;
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: `/trade/brokerage-user/get-rank-by-price?${queryString}`,
method: "GET"
});
},
// 获得分销用户排行分页(基于佣金)
getBrokerageUserChildSummaryPageByPrice: (params) => {
const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: `/trade/brokerage-user/rank-page-by-price?${queryString}`,
method: "GET"
});
},
// 获得分销用户排行分页(基于用户量)
getBrokerageUserRankPageByUserCount: (params) => {
const queryString = Object.keys(params).map((key) => encodeURIComponent(key) + "=" + params[key]).join("&");
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: `/trade/brokerage-user/rank-page-by-user-count?${queryString}`,
method: "GET"
});
},
// 获得下级分销统计分页
getBrokerageUserChildSummaryPage: (params) => {
2024-10-01 09:15:35 +08:00
return modules_mall_sheep_request_index.request({
2024-09-19 07:20:14 +08:00
url: "/trade/brokerage-user/child-summary-page",
method: "GET",
params
});
}
};
exports.BrokerageApi = BrokerageApi;