【代码优化】拼团活动和SPU详情分开查询

pull/537/head
卢越 2024-09-05 10:55:57 +08:00
parent 03356576b3
commit 40fe63a3fb
1 changed files with 1 additions and 3 deletions

View File

@ -123,7 +123,6 @@ import {fenToYuan} from "@/utils";
/** 拼团卡片 */ /** 拼团卡片 */
defineOptions({name: 'PromotionCombination'}) defineOptions({name: 'PromotionCombination'})
// //
//
const props = defineProps<{ property: PromotionCombinationProperty }>(); const props = defineProps<{ property: PromotionCombinationProperty }>();
// //
const spuList = ref<ProductSpuApi.Spu[]>([]); const spuList = ref<ProductSpuApi.Spu[]>([]);
@ -150,13 +149,12 @@ watch(
.map(activity => activity.spuId) .map(activity => activity.spuId)
.filter((spuId): spuId is number => typeof spuId === 'number'); .filter((spuId): spuId is number => typeof spuId === 'number');
// spuId API // spuId API
if (spuIdList.value.length > 0) { if (spuIdList.value.length > 0) {
spuList.value = await ProductSpuApi.getSpuDetailList(spuIdList.value); spuList.value = await ProductSpuApi.getSpuDetailList(spuIdList.value);
} else { } else {
console.warn('没有用于获取详细信息的有效 spuId。'); console.warn('没有用于获取详细信息的有效 spuId。');
} }
// SPU // SPU
combinationActivityList.value.forEach(activity => { combinationActivityList.value.forEach(activity => {
activity.products.forEach(product => { activity.products.forEach(product => {