fix(upload_image): 修改图片显示组件默认显示清晰度

This commit is contained in:
2026-04-28 15:26:58 +08:00
parent 0c7fbe5897
commit b380daf206

View File

@@ -97,15 +97,24 @@ class CustomerImagesNetworking extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String sizeParams = ''; String sizeParams = '';
const defaultResizeSize = 2048;
if (height != null && width != null) { if (height != null && width != null) {
final h = height!.toInt() <= 1080 ? 1080 : height!.toInt(); final h = height!.toInt() <= defaultResizeSize
final w = width!.toInt() <= 1080 ? 1080 : width!.toInt(); ? defaultResizeSize
: height!.toInt();
final w = width!.toInt() <= defaultResizeSize
? defaultResizeSize
: width!.toInt();
sizeParams = 'x-oss-process=image/resize,h_$h,w_$w'; sizeParams = 'x-oss-process=image/resize,h_$h,w_$w';
} else if (width != null) { } else if (width != null) {
final w = width!.toInt() <= 1080 ? 1080 : width!.toInt(); final w = width!.toInt() <= defaultResizeSize
? defaultResizeSize
: width!.toInt();
sizeParams = 'x-oss-process=image/resize,h_$w,w_$w'; sizeParams = 'x-oss-process=image/resize,h_$w,w_$w';
} else if (height != null) { } else if (height != null) {
final h = height!.toInt() <= 1080 ? 1080 : height!.toInt(); final h = height!.toInt() <= defaultResizeSize
? defaultResizeSize
: height!.toInt();
sizeParams = 'x-oss-process=image/resize,h_$h,w_$h'; sizeParams = 'x-oss-process=image/resize,h_$h,w_$h';
} }
final separator = imageUrl.contains('?') ? '&' : '?'; final separator = imageUrl.contains('?') ? '&' : '?';