fix: 封装 SpuSelect SpuAndSkuList 为商品活动商品选择商品编辑通用组件

This commit is contained in:
puhui999
2023-06-25 16:43:49 +08:00
parent 76ccc54a35
commit 51e79f29cc
12 changed files with 229 additions and 177 deletions

View File

@ -47,17 +47,13 @@ export interface Spu {
recommendBest?: boolean // 是否精品
recommendNew?: boolean // 是否新品
recommendGood?: boolean // 是否优品
}
// TODO @puhui999: SpuRespVO 合并到 SPU 里?前端少点 VO 类哈;
export interface SpuRespVO extends Spu {
price: number
salesCount: number
marketPrice: number
costPrice: number
stock: number
createTime: Date
status: number
price?: number // 商品价格
salesCount?: number // 商品销量
marketPrice?: number // 市场价
costPrice?: number // 成本价
stock?: number // 商品库存
createTime?: Date // 商品创建时间
status?: number // 商品状态
}
// 获得 Spu 列表

View File

@ -1,5 +1,5 @@
import request from '@/config/axios'
import { Sku, SpuRespVO } from '@/api/mall/product/spu'
import { Sku, Spu } from '@/api/mall/product/spu'
export interface SeckillActivityVO {
id: number
@ -21,6 +21,7 @@ export interface SeckillActivityVO {
products: SeckillProductVO[]
}
// 秒杀活动所需属性
export interface SeckillProductVO {
spuId: number
skuId: number
@ -28,11 +29,12 @@ export interface SeckillProductVO {
stock: number
}
// 扩展 Sku 配置
type SkuExtension = Sku & {
productConfig: SeckillProductVO
}
export interface SpuExtension extends SpuRespVO {
export interface SpuExtension extends Spu {
skus: SkuExtension[] // 重写类型
}