实现价格折扣动态调整

This commit is contained in:
2026-03-24 17:14:50 +08:00
parent 8751ac19a6
commit 523d46874b
13 changed files with 1189 additions and 56 deletions

View File

@@ -19,3 +19,49 @@ export async function getPageProductSku(params: {
params,
)
}
export async function createProductSku(data: {
product_id: number
code: string
name: string
price: string
discount_id?: number
}) {
return callByUser<ProductSku>("/api/admin/product/sku/create", {
product_id: data.product_id,
code: data.code,
name: data.name,
price: data.price,
discount_id: data.discount_id,
})
}
export async function updateProductSku(data: {
id: number
code?: string
name?: string
price?: string
discount_id?: number | null
}) {
return callByUser<ProductSku>("/api/admin/product/sku/update", {
id: data.id,
code: data.code,
name: data.name,
price: data.price,
discount_id: data.discount_id,
})
}
export async function deleteProductSku(id: number) {
return callByUser<ProductSku>("/api/admin/product/sku/remove", { id })
}
export async function batchUpdateProductSkuDiscount(data: {
product_id: number
discount_id: number | null
}) {
return callByUser<void>("/api/admin/product/sku/update/discount/batch", {
product_id: data.product_id,
discount_id: data.discount_id,
})
}