fix(shop): 修复商品详情页孤立“0”渲染问题

- 修正赚取积分、重量和销量条件渲染,避免数字0被渲染成文本节点
- 赚取积分判断改为仅判断数值是否大于0,防止0泄漏
- 重量同样改为判断数值大于0避免显示无效数据
- 销量为0时隐藏销量信息,符合用户需求
- 调整加购按钮尺寸,使其视觉更协调
This commit is contained in:
2026-07-14 03:05:14 +08:00
parent b7bdefba96
commit f92e399d72
3 changed files with 44 additions and 4 deletions

View File

@@ -325,7 +325,7 @@ const ShopPage: React.FC = () => {
</View>
{/* 加购按钮 */}
<View
className='w-7 h-7 rounded-full bg-green-500 flex items-center justify-center flex-shrink-0 ml-1'
className='w-6 h-6 rounded-full bg-green-500 flex items-center justify-center flex-shrink-0 ml-1'
onClick={(e) => handleAddToCart(e, item)}
>
<Text className='text-white text-lg leading-none'>+</Text>