From de127eeef5c3e6a1a201adf3efea5f5cd7f978da Mon Sep 17 00:00:00 2001 From: wuxinglong Date: Fri, 24 Apr 2026 16:28:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(upload=5Fimage):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=98=BE=E7=A4=BA=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/utils/customer.dart | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/utils/customer.dart b/lib/utils/customer.dart index 0f85f99..2af86c9 100644 --- a/lib/utils/customer.dart +++ b/lib/utils/customer.dart @@ -96,22 +96,21 @@ class CustomerImagesNetworking extends StatelessWidget { @override Widget build(BuildContext context) { - String? sizeParams = ''; - int tempHeight = 300; - int tempWidth = 300; - if (height != null) { - sizeParams = '?x-oss-process=image/resize,h_$tempHeight,w_$tempHeight'; - } - if (width != null) { - tempWidth = width!.toInt() <= 300 ? 300 : width!.toInt(); - sizeParams = '?x-oss-process=image/resize,h_$tempWidth,w_$tempWidth'; - } + String sizeParams = ''; if (height != null && width != null) { - tempHeight = height!.toInt() <= 300 ? 300 : height!.toInt(); - sizeParams = '?x-oss-process=image/resize,h_$tempHeight,w_$tempWidth'; + final h = height!.toInt() <= 2048 ? 2048 : height!.toInt(); + final w = width!.toInt() <= 2048 ? 2048 : width!.toInt(); + sizeParams = 'x-oss-process=image/resize,h_$h,w_$w'; + } else if (width != null) { + final w = width!.toInt() <= 2048 ? 2048 : width!.toInt(); + sizeParams = 'x-oss-process=image/resize,h_$w,w_$w'; + } else if (height != null) { + final h = height!.toInt() <= 2048 ? 2048 : height!.toInt(); + sizeParams = 'x-oss-process=image/resize,h_$h,w_$h'; } + final separator = imageUrl.contains('?') ? '&' : '?'; return CachedNetworkImage( - imageUrl: imageUrl + sizeParams, + imageUrl: imageUrl.isEmpty ? imageUrl : '$imageUrl$separator$sizeParams', width: width, height: height, fit: fit, From 0c7fbe589790de853399ce157f809b28ee4a191b Mon Sep 17 00:00:00 2001 From: wuxinglong Date: Fri, 24 Apr 2026 16:53:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(upload=5Fimage):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=98=BE=E7=A4=BA=E7=BB=84=E4=BB=B6=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=98=BE=E7=A4=BA=E6=B8=85=E6=99=B0=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/utils/customer.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utils/customer.dart b/lib/utils/customer.dart index 2af86c9..24a586d 100644 --- a/lib/utils/customer.dart +++ b/lib/utils/customer.dart @@ -98,14 +98,14 @@ class CustomerImagesNetworking extends StatelessWidget { Widget build(BuildContext context) { String sizeParams = ''; if (height != null && width != null) { - final h = height!.toInt() <= 2048 ? 2048 : height!.toInt(); - final w = width!.toInt() <= 2048 ? 2048 : width!.toInt(); + final h = height!.toInt() <= 1080 ? 1080 : height!.toInt(); + final w = width!.toInt() <= 1080 ? 1080 : width!.toInt(); sizeParams = 'x-oss-process=image/resize,h_$h,w_$w'; } else if (width != null) { - final w = width!.toInt() <= 2048 ? 2048 : width!.toInt(); + final w = width!.toInt() <= 1080 ? 1080 : width!.toInt(); sizeParams = 'x-oss-process=image/resize,h_$w,w_$w'; } else if (height != null) { - final h = height!.toInt() <= 2048 ? 2048 : height!.toInt(); + final h = height!.toInt() <= 1080 ? 1080 : height!.toInt(); sizeParams = 'x-oss-process=image/resize,h_$h,w_$h'; } final separator = imageUrl.contains('?') ? '&' : '?';