refactor(shopCoupon): 重构优惠券页面

- 优化表格展示,增加状态标签和操作按钮
- 重新设计编辑弹窗,分为多个步骤展示
- 添加数据验证和错误提示
-优化删除操作提示信息
-调整表格样式,增加分页功能
This commit is contained in:
2025-08-11 12:33:29 +08:00
parent 32fe74c71f
commit d0000fb391
5 changed files with 661 additions and 393 deletions

View File

@@ -41,7 +41,12 @@ export async function listShopCoupon(params?: ShopCouponParam) {
export async function addShopCoupon(data: ShopCoupon) {
const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-coupon',
data
data,
{
headers: {
'Content-Type': 'application/json'
}
}
);
if (res.data.code === 0) {
return res.data.message;
@@ -55,7 +60,12 @@ export async function addShopCoupon(data: ShopCoupon) {
export async function updateShopCoupon(data: ShopCoupon) {
const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/shop/shop-coupon',
data
data,
{
headers: {
'Content-Type': 'application/json'
}
}
);
if (res.data.code === 0) {
return res.data.message;

View File

@@ -53,7 +53,7 @@ export interface ShopCoupon {
// 每人限领数量(-1表示无限制)
limitPerUser?: number;
// 是否启用(0禁用 1启用)
enabled?: string;
enabled?: boolean;
}
/**