115 lines
2.4 KiB
JavaScript
115 lines
2.4 KiB
JavaScript
import request from '@/common/system/request';
|
|
|
|
/**
|
|
* 申请成为代理商接口
|
|
* @param {Object} data 代理商申请数据
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const applyAgent = async (data) => {
|
|
const res = await request.post("Agent/ApplyAgent", data);
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 获取代理商排行
|
|
* @param {Object} params 查询参数
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const getAgentRanking = async (params) => {
|
|
const res = await request.post("Agent/GetAgentRanking", params);
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 根据查询条件获取分页数据
|
|
* @param {Object} params 查询参数
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const getGoodsPageList = async (params) => {
|
|
const res = await request.post("Agent/GetGoodsPageList", params);
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 获取我的订单统计
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const getOrderSum = async () => {
|
|
const res = await request.post("Agent/GetOrderSum");
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 获取店铺信息
|
|
* @param {number} id 店铺ID
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const getStoreInfo = async (id) => {
|
|
const res = await request.post("Agent/GetStoreInfo", { id });
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 获取我的下级用户数量
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const getTeamSum = async () => {
|
|
const res = await request.post("Agent/GetTeamSum");
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 查询用户是否可以成为代理商
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const info = async () => {
|
|
const res = await request.post("Agent/Info");
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 我推广的订单
|
|
* @param {Object} params 查询参数
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const myOrder = async (params) => {
|
|
const res = await request.post("Agent/MyOrder", params);
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 店铺设置
|
|
* @param {Object} data 店铺设置数据
|
|
* @returns {Promise<any>}
|
|
*/
|
|
export const setStore = async (data) => {
|
|
const res = await request.post("Agent/SetStore", data);
|
|
if (res.code == 0) {
|
|
return res.data;
|
|
}
|
|
return null;
|
|
}
|