- 调整fakeSku中price字段优先使用product.price,确保价格正确显示 - 修改currentPrice计算顺序,使price优先于salePrice,符合实际售价需求 - 统一价格逻辑,避免SKU弹窗和商品详情页价格不一致问题 - 添加注释说明ShopGoods和ShopGoodsSku中price与salePrice的区别及优先级规则
722 B
722 B
2026-06-27 工作日志
SKU选择器价格显示错误修复
- 文件:
src/components/business/SkuSelector/index.tsx - 问题: 商品详情页价格显示 ¥1019,但点击"立即购买"后SKU弹窗显示 ¥2519
- 根因:
currentPrice计算式中salePrice优先级高于price。ShopGoods 模型中price=实际售价(1019),salePrice=市场/原价(2519)。当 SKU 未选中时回退到 product 级别,错误地优先取了 salePrice - 修复:
- 第190行:
currentPrice优先级改为selectedSku?.price || selectedSku?.salePrice || product?.price || product?.salePrice - 第160行: 单规格 fakeSku 的 price 字段同样修正为
product.price || product.salePrice
- 第190行: