fix(shop): 修复商品详情页轮播图显示不完整问题

- 将图片裁剪模式从 aspectFill 改为 widthFix,确保图片宽度撑满屏幕
- 新增 swiperHeight 状态,根据首张图片实际宽高比动态计算轮播图高度
- 通过图片 onLoad 事件设置动态高度,避免图片被裁剪不完整
- 优化图片组件布局,移除高度限制,防止图片变形
This commit is contained in:
2026-06-27 10:43:36 +08:00
parent dc0909d37d
commit fd6ba02d37

View File

@@ -25,7 +25,7 @@ const ProductCard: React.FC<ProductCardProps> = ({ product, onClick }) => {
<Image <Image
className='absolute top-0 left-0 w-full h-full' className='absolute top-0 left-0 w-full h-full'
src={product.image || product.files || ''} src={product.image || product.files || ''}
mode='aspectFill' mode='aspectFit'
lazyLoad lazyLoad
style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }} style={{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }}
/> />