forked from gxwebsoft/mp-10550
- 新增文章详情页面组件,用于显示文章内容 - 优化购物车页面样式,增加空购物车状态的透明背景 - 添加多个购物相关 API 接口,包括优惠券、订单等 - 更新环境配置,修改 API 基础 URL - 调整发现页面布局,增加文章详情入口
102 lines
2.5 KiB
TypeScript
102 lines
2.5 KiB
TypeScript
import request from '@/utils/request';
|
|
import type { ApiResult, PageResult } from '@/api/index';
|
|
import type { ShopDealerWithdraw, ShopDealerWithdrawParam } from './model';
|
|
|
|
/**
|
|
* 分页查询分销商提现明细表
|
|
*/
|
|
export async function pageShopDealerWithdraw(params: ShopDealerWithdrawParam) {
|
|
const res = await request.get<ApiResult<PageResult<ShopDealerWithdraw>>>(
|
|
'/shop/shop-dealer-withdraw/page',
|
|
params
|
|
);
|
|
if (res.code === 0) {
|
|
return res.data;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 查询分销商提现明细表列表
|
|
*/
|
|
export async function listShopDealerWithdraw(params?: ShopDealerWithdrawParam) {
|
|
const res = await request.get<ApiResult<ShopDealerWithdraw[]>>(
|
|
'/shop/shop-dealer-withdraw',
|
|
params
|
|
);
|
|
if (res.code === 0 && res.data) {
|
|
return res.data;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 添加分销商提现明细表
|
|
*/
|
|
export async function addShopDealerWithdraw(data: ShopDealerWithdraw) {
|
|
const res = await request.post<ApiResult<unknown>>(
|
|
'/shop/shop-dealer-withdraw',
|
|
data
|
|
);
|
|
if (res.code === 0) {
|
|
return res.message;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 修改分销商提现明细表
|
|
*/
|
|
export async function updateShopDealerWithdraw(data: ShopDealerWithdraw) {
|
|
const res = await request.put<ApiResult<unknown>>(
|
|
'/shop/shop-dealer-withdraw',
|
|
data
|
|
);
|
|
if (res.code === 0) {
|
|
return res.message;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 删除分销商提现明细表
|
|
*/
|
|
export async function removeShopDealerWithdraw(id?: number) {
|
|
const res = await request.del<ApiResult<unknown>>(
|
|
'/shop/shop-dealer-withdraw/' + id
|
|
);
|
|
if (res.code === 0) {
|
|
return res.message;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 批量删除分销商提现明细表
|
|
*/
|
|
export async function removeBatchShopDealerWithdraw(data: (number | undefined)[]) {
|
|
const res = await request.del<ApiResult<unknown>>(
|
|
'/shop/shop-dealer-withdraw/batch',
|
|
{
|
|
data
|
|
}
|
|
);
|
|
if (res.code === 0) {
|
|
return res.message;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|
|
|
|
/**
|
|
* 根据id查询分销商提现明细表
|
|
*/
|
|
export async function getShopDealerWithdraw(id: number) {
|
|
const res = await request.get<ApiResult<ShopDealerWithdraw>>(
|
|
'/shop/shop-dealer-withdraw/' + id
|
|
);
|
|
if (res.code === 0 && res.data) {
|
|
return res.data;
|
|
}
|
|
return Promise.reject(new Error(res.message));
|
|
}
|