提交接口文件

This commit is contained in:
zpc 2025-07-23 14:37:06 +08:00
parent 8e6b941c7e
commit 5b1181405e
23 changed files with 11150 additions and 27 deletions

View File

@ -5,13 +5,14 @@ export const getConfig = async () => {
return res.data;
}
/**
* 获取公告
* @param {Number} id 9:首页滚动公告
* @returns
*/
export const getNoticeInfo = async (id) => {
let res = await request.getOrCache("Notice/NoticeInfo", { id: id })
return res.data;
}
export class Config {
constructor() {
this.config = null;
}
async getConfig() {
if (this.config == null) {
this.config = await getConfig();
}
}
}

View File

@ -1,17 +1,6 @@
import request from '@/common/system/request';
import { getConfig, getNoticeInfo } from '@/common/server/config';
/**
* 获取滚动条
* @param {String} code 编码 TplIndexBanner1:首页轮播图
* @returns
*/
export const GetAdvertList = async (code) => {
if (code == null || code == "") {
return [];
}
const res = await request.getOrCache("advert/getadvertlist", { code: code });
return res.data;
}
import { getAdvertList } from '@/common/server/interface/advert'
import { noticeInfo as getNoticeInfo } from '@/common/server/interface/notice'
/**
* 获取首页关键数据
@ -19,7 +8,7 @@ export const GetAdvertList = async (code) => {
*/
export const getHomePage = async () => {
// 获取首页banner位
const advertTask = GetAdvertList("TplIndexBanner1");
const advertTask = getAdvertList("TplIndexBanner1");
// 获取首页滚动文字
const noticeInfoTask = getNoticeInfo(9);

View File

@ -0,0 +1,27 @@
import request from '@/common/system/request';
/**
* 获取滚动条
* @param {String} code 编码 TplIndexBanner1:首页轮播图
* @returns
*/
export const getAdvertList = async (code) => {
if (code == null || code == "") {
return [];
}
const res = await request.getOrCache("advert/GetAdvertList", { code: code });
return res.data;
}
/**
* 获取广告位置信息
* @param {Object} data 查询参数
* @returns {Promise<any>}
*/
export const getPositionList = async (data) => {
const res = await request.post("Advert/GetPositionList", data);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,115 @@
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;
}

View File

@ -0,0 +1,40 @@
import request from '@/common/system/request';
/**
* 获取文章列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getArticleList = async (params) => {
const res = await request.post("Article/GetArticleList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取单个文章内容
* @param {number} id 文章ID
* @returns {Promise<any>}
*/
export const getArticleDetail = async (id) => {
const res = await request.post("Article/GetArticleDetail", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取通知列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const noticeList = async (params) => {
const res = await request.post("Article/NoticeList", params);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,66 @@
import request from '@/common/system/request';
/**
* 添加单个货品到购物车
* @param {Object} data 包含商品信息的数据
* @returns {Promise<any>}
*/
export const addCart = async (data) => {
const res = await request.post("Cart/AddCart", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 删除购物车商品
* @param {number} id 购物车ID
* @returns {Promise<any>}
*/
export const doDelete = async (id) => {
const res = await request.post("Cart/DoDelete", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取购物车列表
* @param {Object} params 参数
* @returns {Promise<any>}
*/
export const getList = async (params) => {
const res = await request.post("Cart/GetList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 设置购物车商品数量
* @param {Object} data 设置数量参数
* @returns {Promise<any>}
*/
export const setCartNum = async (data) => {
const res = await request.post("Cart/SetCartNum", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 根据提交的数据判断哪些购物券可以使用
* @param {Object} data 优惠券判断参数
* @returns {Promise<any>}
*/
export const getCartAvailableCoupon = async (data) => {
const res = await request.post("Cart/GetCartAvailableCoupon", data);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,74 @@
import request from '@/common/system/request';
/**
* 获取层级分配后的区域信息
* @returns {Promise<any>}
*/
export const getAreas = async () => {
const res = await request.post("Common/GetAreas");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 返回配置数据文件V2.0
* @returns {Promise<any>}
*/
export const getConfigV2 = async () => {
const res = await request.post("Common/GetConfigV2");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 返回配置数据文件V3.0
* @returns {Promise<any>}
*/
export const getConfigV3 = async () => {
const res = await request.get("Common/GetConfigV3");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取商城关键词说明列表
* @returns {Promise<any>}
*/
export const getServiceDescription = async () => {
const res = await request.post("Common/GetServiceDescription");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 接口测试反馈
* @returns {Promise<any>}
*/
export const interFaceTest = async () => {
const res = await request.post("Common/InterFaceTest");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 上传附件通用接口
* @param {FormData} formData 上传的表单数据
* @returns {Promise<any>}
*/
export const uploadImages = async (formData) => {
const res = await request.post("Common/UploadImages", formData);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,66 @@
import request from '@/common/system/request';
/**
* 获取可领取的优惠券
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const couponList = async (params) => {
const res = await request.post("Coupon/CouponList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取优惠券详情
* @param {number} id 优惠券ID
* @returns {Promise<any>}
*/
export const couponDetail = async (id) => {
const res = await request.post("Coupon/CouponDetail", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 用户领取优惠券
* @param {number} id 优惠券ID
* @returns {Promise<any>}
*/
export const getCoupon = async (id) => {
const res = await request.post("Coupon/GetCoupon", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 用户输入code领取优惠券
* @param {Object} data 包含code的数据
* @returns {Promise<any>}
*/
export const getCouponKey = async (data) => {
const res = await request.post("Coupon/GetCouponKey", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取用户已领取的优惠券
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const userCoupon = async (params) => {
const res = await request.post("Coupon/UserCoupon", params);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,102 @@
import request from '@/common/system/request';
/**
* 申请成为分销商接口
* @param {Object} data 分销商申请数据
* @returns {Promise<any>}
*/
export const applyDistribution = async (data) => {
const res = await request.post("Distribution/ApplyDistribution", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取分销商排行
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getDistributionRanking = async (params) => {
const res = await request.post("Distribution/GetDistributionRanking", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取我的订单统计
* @returns {Promise<any>}
*/
export const getOrderSum = async () => {
const res = await request.post("Distribution/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("Distribution/GetStoreInfo", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取我的下级用户数量
* @returns {Promise<any>}
*/
export const getTeamSum = async () => {
const res = await request.post("Distribution/GetTeamSum");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 查询用户是否可以成为分销商
* @returns {Promise<any>}
*/
export const info = async () => {
const res = await request.post("Distribution/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("Distribution/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("Distribution/SetStore", data);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,27 @@
import request from '@/common/system/request';
/**
* 万能表单/提交表单
* @param {Object} data 表单数据
* @returns {Promise<any>}
*/
export const addSubmit = async (data) => {
const res = await request.post("Form/AddSubmit", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 万能表单/获取活动商品详情
* @param {Object} data 查询参数
* @returns {Promise<any>}
*/
export const getFormDetial = async (data) => {
const res = await request.post("Form/GetFormDetial", data);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,141 @@
import request from '@/common/system/request';
/**
* 获取所有分类
* @returns
*/
export const getAllCategories = async () => {
const res = await request.get("Good/GetAllCategories");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取商品评价列表分页数据
* @returns {}
*/
export const getGoodsComment = async (otherData, id, page, limit, order, where) => {
const res = await request.post("Good/GetGoodsComment", {
"otherData": otherData,
"id": id,
"page": page,
"limit": limit,
"order": order,
"where": where
});
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取商品详情
* @param {number} id 商品ID
* @returns {Promise<any>}
*/
export const getDetial = async (id) => {
const res = await request.get("Good/GetDetial", { params: { id } });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 根据Token获取商品详情
* @param {number} id 商品ID
* @returns {Promise<any>}
*/
export const getDetialByToken = async (id) => {
const res = await request.post("Good/GetDetialByToken", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 根据查询条件获取分页数据
* @param {number} page 页码
* @param {number} limit 每页数量
* @param {string} order 排序
* @param {string} where 条件
* @returns {Promise<any>}
*/
export const getGoodsPageList = async (page, limit, order, where) => {
const res = await request.get("Good/GetGoodsPageList", {
params: {
page,
limit,
order,
where
}
});
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取单个商品参数
* @param {number} id 商品ID
* @param {Object} data 附加数据
* @returns {Promise<any>}
*/
export const getGoodsParams = async (id, data = {}) => {
const res = await request.get("Good/GetGoodsParams", {
params: {
id,
data
}
});
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取随机推荐商品
* @param {number} id 商品ID
* @param {Object} data 附加数据
* @returns {Promise<any>}
*/
export const getGoodsRecommendList = async (id, data = {}) => {
const res = await request.get("Good/GetGoodsRecommendList", {
params: {
id,
data
}
});
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取单个货品信息
* @param {number} id 货品ID
* @param {string} type 类型
* @param {number} groupId 分组ID
* @returns {Promise<any>}
*/
export const getProductInfo = async (id, type, groupId) => {
const res = await request.get("Good/GetProductInfo", {
params: {
id,
type,
groupId
}
});
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,27 @@
import request from '@/common/system/request';
/**
* 获取秒杀团购详情
* @param {Object} data 查询参数
* @returns {Promise<any>}
*/
export const getGoodsDetial = async (data) => {
const res = await request.post("Group/GetGoodsDetial", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取秒杀团购列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getList = async (params) => {
const res = await request.post("Group/GetList", params);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,27 @@
import request from '@/common/system/request';
/**
* 获取单个公告内容
* @param {number} id 公告ID
* @returns {Promise<any>}
*/
export const noticeInfo = async (id) => {
const res = await request.getOrCache("Notice/NoticeInfo", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取公告列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const noticeList = async (params) => {
const res = await request.post("Notice/NoticeList", params);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,131 @@
import request from '@/common/system/request';
/**
* 创建订单
* @param {Object} data 订单数据
* @returns {Promise<any>}
*/
export const createOrder = async (data) => {
const res = await request.post("Order/CreateOrder", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取个人订单列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getOrderList = async (params) => {
const res = await request.post("Order/GetOrderList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取订单不同状态的数量
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getOrderStatusNum = async (params) => {
const res = await request.post("Order/GetOrderStatusNum", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 订单详情
* @param {string} id 订单ID
* @returns {Promise<any>}
*/
export const orderDetails = async (id) => {
const res = await request.post("Order/OrderDetails", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 取消订单
* @param {string} id 订单ID
* @returns {Promise<any>}
*/
export const cancelOrder = async (id) => {
const res = await request.post("Order/CancelOrder", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 删除订单
* @param {string} id 订单ID
* @returns {Promise<any>}
*/
export const deleteOrder = async (id) => {
const res = await request.post("Order/DeleteOrder", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 确认签收订单
* @param {string} id 订单ID
* @returns {Promise<any>}
*/
export const orderConfirm = async (id) => {
const res = await request.post("Order/OrderConfirm", { id });
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 添加售后单
* @param {Object} data 售后单数据
* @returns {Promise<any>}
*/
export const addAftersales = async (data) => {
const res = await request.post("Order/AddAftersales", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取售后单列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const aftersalesList = async (params) => {
const res = await request.post("Order/AftersalesList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取售后单详情
* @param {string} id 售后单ID
* @returns {Promise<any>}
*/
export const aftersalesinfo = async (id) => {
const res = await request.post("Order/Aftersalesinfo", { id });
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,27 @@
import request from '@/common/system/request';
/**
* 获取页面布局数据
* @param {Object} data 查询参数
* @returns {Promise<any>}
*/
export const getPageConfig = async (data) => {
const res = await request.post("Page/GetPageConfig", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取用户购买记录
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getRecod = async (params) => {
const res = await request.post("Page/GetRecod", params);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,27 @@
import request from '@/common/system/request';
/**
* 支付确认页面取信息
* @param {Object} params 支付参数
* @returns {Promise<any>}
*/
export const checkPay = async (params) => {
const res = await request.post("Payments/CheckPay", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取支付单详情
* @param {string} id 支付单ID
* @returns {Promise<any>}
*/
export const getInfo = async (id) => {
const res = await request.post("Payments/GetInfo", { id });
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,53 @@
import request from '@/common/system/request';
/**
* 获取拼团商品信息
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getGoodsInfo = async (params) => {
const res = await request.post("PinTuan/GetGoodsInfo", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取拼团列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getList = async (params) => {
const res = await request.post("PinTuan/GetList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取拼团团队
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getPinTuanTeam = async (params) => {
const res = await request.post("PinTuan/GetPinTuanTeam", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取拼团产品信息
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getProductInfo = async (params) => {
const res = await request.post("PinTuan/GetProductInfo", params);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,92 @@
import request from '@/common/system/request';
/**
* 添加服务订单
* @param {Object} data 服务订单数据
* @returns {Promise<any>}
*/
export const addServiceOrder = async (data) => {
const res = await request.post("Service/AddServiceOrder", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取服务详情
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getDetails = async (params) => {
const res = await request.post("Service/GetDetails", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取服务分页列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getPageList = async (params) => {
const res = await request.post("Service/GetPageList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取票务信息
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getTicketInfo = async (params) => {
const res = await request.post("Service/GetTicketInfo", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 删除日志
* @param {Object} params 删除参数
* @returns {Promise<any>}
*/
export const logDelete = async (params) => {
const res = await request.post("Service/LogDelete", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取验证分页列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const verificationPageList = async (params) => {
const res = await request.post("Service/VerificationPageList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 验证票据
* @param {Object} params 验证参数
* @returns {Promise<any>}
*/
export const verificationTicket = async (params) => {
const res = await request.post("Service/VerificationTicket", params);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,166 @@
import request from '@/common/system/request';
/**
* 获取默认商店
* @returns {Promise<any>}
*/
export const getDefaultStore = async () => {
const res = await request.post("Store/GetDefaultStore");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取商家订单分页
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getOrderPageByMerchant = async (params) => {
const res = await request.post("Store/GetOrderPageByMerchant", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取商家订单搜索分页
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getOrderPageByMerchantSearch = async (params) => {
const res = await request.post("Store/GetOrderPageByMerchantSearch", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取推荐关键词
* @returns {Promise<any>}
*/
export const getRecommendKeys = async () => {
const res = await request.post("Store/GetRecommendKeys");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 根据ID获取商店
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getStoreById = async (params) => {
const res = await request.post("Store/GetStoreById", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 根据用户ID获取商店
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getStoreByUserId = async (params) => {
const res = await request.post("Store/GetStoreByUserId", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取商店列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const getStoreList = async (params) => {
const res = await request.post("Store/GetStoreList", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取商店开关
* @returns {Promise<any>}
*/
export const getStoreSwitch = async () => {
const res = await request.post("Store/GetStoreSwitch");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 是否店员
* @returns {Promise<any>}
*/
export const isClerk = async () => {
const res = await request.post("Store/IsClerk");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 装载
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const lading = async (params) => {
const res = await request.post("Store/Lading", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 删除装载
* @param {Object} params 删除参数
* @returns {Promise<any>}
*/
export const ladingDelete = async (params) => {
const res = await request.post("Store/LadingDelete", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取装载信息
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const ladingInfo = async (params) => {
const res = await request.post("Store/LadingInfo", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取商店装载列表
* @param {Object} params 查询参数
* @returns {Promise<any>}
*/
export const storeLadingList = async (params) => {
const res = await request.post("Store/StoreLadingList", params);
if (res.code == 0) {
return res.data;
}
return null;
}

View File

@ -0,0 +1,63 @@
import request from '@/common/system/request';
/**
* 查询用户是否可以成为分销商
* @returns {Promise<any>}
*/
export const getDistributionInfo = async () => {
const res = await request.post("Distribution/Info");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 申请成为分销商接口
* @param {Object} data 分销商申请数据
* @returns {Promise<any>}
*/
export const applyDistribution = async (data) => {
const res = await request.post("Distribution/ApplyDistribution", data);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取分销商排行
* @param {Object} params 分页参数
* @returns {Promise<any>}
*/
export const getDistributionRanking = async (params) => {
const res = await request.post("Distribution/GetDistributionRanking", params);
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取我的订单统计
* @returns {Promise<any>}
*/
export const getOrderSum = async () => {
const res = await request.post("Distribution/GetOrderSum");
if (res.code == 0) {
return res.data;
}
return null;
}
/**
* 获取我的下级用户数量
* @returns {Promise<any>}
*/
export const getTeamSum = async () => {
const res = await request.post("Distribution/GetTeamSum");
if (res.code == 0) {
return res.data;
}
return null;
}

9855
common/server/swagger.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -20,17 +20,17 @@ export const appInit = async (timeoutMs = 5000) => {
timeoutMs
)
);
// 3. 使用Promise.race让广告获取任务和超时Promise"赛跑"
// 3. 使用Promise.race让首页获取数据和超时Promise"赛跑"
// 哪个先完成(成功或失败)就采用哪个的结果
await Promise.race([
// 使用Promise.all包装是为了保持一致性(虽然只有一个任务)
// 使用Promise.all包装是为了保持一致性
Promise.all([getConfigTask, homeTask]),
timeoutPromise
]);
// 4. 如果没有超时全部获取成功返回true
return true;
} catch (error) {
// 5. 错误处理(可能是超时错误或广告获取失败)
// 5. 错误处理(可能是超时错误或首页获取失败)
console.error('初始化任务失败:', error);
// 6. 返回false表示初始化失败
return false;

View File

@ -15,7 +15,14 @@ onLoad(async () => {
uni.onNetworkStatusChange(checkNetwork);
return;
}
//
const startTime = Date.now();
let res = await appInit();
//
const endTime = Date.now();
const duration = endTime - startTime;
console.log(`应用初始化成功,耗时: ${duration}ms`);
gy.navigateTo("/pages/home/home-page");
});
/**