mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-08-04 13:14:07 +08:00
fix: mall SeckillActivity
This commit is contained in:
@@ -47,17 +47,14 @@
|
||||
</el-table>
|
||||
</template>
|
||||
<script generic="T extends Spu" lang="ts" setup>
|
||||
// TODO 后续计划重新封装作为活动商品配置通用组件;可以等其他活动做到的时候,在统一处理 SPU 选择组件哈
|
||||
import { formatToFraction } from '@/utils'
|
||||
import { createImageViewer } from '@/components/ImageViewer'
|
||||
import { Spu } from '@/api/mall/product/spu'
|
||||
import { RuleConfig, SkuList } from '@/views/mall/product/spu/components'
|
||||
import { SeckillProductVO } from '@/api/mall/promotion/seckill/seckillActivity'
|
||||
import { SpuProperty } from '@/views/mall/promotion/components/index'
|
||||
|
||||
defineOptions({ name: 'PromotionSpuAndSkuList' })
|
||||
|
||||
// TODO @puhui999:是不是改成传递一个 spu 就好啦? 因为活动商品可以多选所以展示编辑的时候需要展示多个
|
||||
const props = defineProps<{
|
||||
spuList: T[]
|
||||
ruleConfig: RuleConfig[]
|
||||
@@ -70,12 +67,12 @@ const skuListRef = ref() // 商品属性列表Ref
|
||||
const spuPropertyList = ref<SpuProperty<T>[]>([]) // spuId 对应的 sku 的属性列表
|
||||
|
||||
/**
|
||||
* 获取所有 sku 秒杀配置
|
||||
* 获取所有 sku 活动配置
|
||||
* @param extendedAttribute 在 sku 上扩展的属性,例:秒杀活动 sku 扩展属性 productConfig 请参考 seckillActivity.ts
|
||||
*/
|
||||
const getSkuConfigs: <V>(extendedAttribute: string) => V[] = (extendedAttribute: string) => {
|
||||
const getSkuConfigs = (extendedAttribute: string) => {
|
||||
skuListRef.value.validateSku()
|
||||
const seckillProducts: SeckillProductVO[] = []
|
||||
const seckillProducts = []
|
||||
spuPropertyList.value.forEach((item) => {
|
||||
item.spuDetail.skus.forEach((sku) => {
|
||||
seckillProducts.push(sku[extendedAttribute])
|
||||
|
Reference in New Issue
Block a user