feat(image): 全项目应用图片压缩优化
- 将图片显示统一替换为 getCompressedImageUrl 函数处理压缩 - 覆盖 35 个文件,包括 4 个组件和 31 个页面 - 主要组件:LazyImage、ProductCard、OrderCard、SkuSelector 内部自动压缩图片 - 主要页面:购物车、订单、积分、活动、拼团、秒杀、收藏、浏览历史等 - 跳过用户头像、二维码、商品详情大图及所有 Taro.previewImage 调用 - 调整压缩默认宽度为 300,保持质量90,启用压缩功能
This commit is contained in:
@@ -14,6 +14,7 @@ import type { ShopGoods } from '@/api/shop/shopGoods/model'
|
||||
import type { ShopUserCoupon } from '@/api/shop/shopUserCoupon/model'
|
||||
import type { OrderGoodsItem, OrderCreateRequest } from '@/api/shop/shopOrder/model'
|
||||
import { isVipMember } from '@/utils/vip'
|
||||
import { getCompressedImageUrl } from '@/utils/image'
|
||||
|
||||
// 满减门槛配置
|
||||
const THRESHOLDS = [
|
||||
@@ -344,7 +345,7 @@ const CheckoutPage: React.FC = () => {
|
||||
<View key={`${item.goodsId}-${item.skuId}-${idx}`} className='flex gap-3 py-3 border-b border-gray-50'>
|
||||
<Image
|
||||
className='w-16 h-16 rounded-md bg-gray-100'
|
||||
src={item.goodsImage || item.product?.image || item.sku?.image || ''}
|
||||
src={getCompressedImageUrl(item.goodsImage || item.product?.image || item.sku?.image || '')}
|
||||
mode='aspectFill'
|
||||
/>
|
||||
<View className='flex-1'>
|
||||
@@ -495,7 +496,7 @@ const CheckoutPage: React.FC = () => {
|
||||
>
|
||||
<Image
|
||||
className='w-full h-20 rounded bg-gray-100'
|
||||
src={product.image || ''}
|
||||
src={getCompressedImageUrl(product.image || '')}
|
||||
mode='aspectFill'
|
||||
/>
|
||||
<Text className='text-xs text-gray-700 block line-clamp-1 mt-1'>
|
||||
|
||||
Reference in New Issue
Block a user