mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 12:18:43 +08:00 
			
		
		
		
	【功能修复】修复装修页面的拼团价格和秒杀价格
This commit is contained in:
		@@ -86,11 +86,8 @@ watch(
 | 
			
		||||
    // 循环活动信息,赋值拼团价格
 | 
			
		||||
    activity.products.forEach((product: CombinationProductVO) => {
 | 
			
		||||
      spuList.value.forEach((spu: Spu) => {
 | 
			
		||||
        // 如果商品 SpuId 匹配
 | 
			
		||||
        if (spu.id === product.spuId) {
 | 
			
		||||
          // 商品原售价和拼团价,哪个便宜就赋值哪个
 | 
			
		||||
          spu.combinationPrice = Math.min(spu.price || 0, product.combinationPrice); // 设置 SPU 的最低价格
 | 
			
		||||
        }
 | 
			
		||||
        // 商品原售价和拼团价,哪个便宜就赋值哪个
 | 
			
		||||
        spu.combinationPrice = Math.min(spu.combinationPrice || Infinity, product.combinationPrice); // 设置 SPU 的最低价格
 | 
			
		||||
      })
 | 
			
		||||
    });
 | 
			
		||||
  },
 | 
			
		||||
 
 | 
			
		||||
@@ -84,14 +84,10 @@ watch(
 | 
			
		||||
    if (!activity?.spuId) return
 | 
			
		||||
    spuList.value = [await ProductSpuApi.getSpu(activity.spuId)]
 | 
			
		||||
    spuList.value = [await ProductSpuApi.getSpu(activity.spuId)]
 | 
			
		||||
    // 循环活动信息,赋值拼团价格
 | 
			
		||||
    // 循环活动信息,赋值秒杀最低价格
 | 
			
		||||
    activity.products.forEach((product: SeckillProductVO) => {
 | 
			
		||||
      spuList.value.forEach((spu: Spu) => {
 | 
			
		||||
        // 如果商品 SpuId 匹配
 | 
			
		||||
        if (spu.id === product.spuId) {
 | 
			
		||||
          // 商品原售价和拼团价,哪个便宜就赋值哪个
 | 
			
		||||
          spu.seckillPrice = Math.min(spu.price || 0, product.seckillPrice); // 设置 SPU 的最低价格
 | 
			
		||||
        }
 | 
			
		||||
        spu.seckillPrice = Math.min(spu.seckillPrice || Infinity, product.seckillPrice);  // 设置 SPU 的最低价格
 | 
			
		||||
      })
 | 
			
		||||
    });
 | 
			
		||||
  },
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user