From 22d23797c55c1323c5007779db914c670bc5586c Mon Sep 17 00:00:00 2001 From: ShenQiLun <97694732@qq.com> Date: Fri, 26 Jun 2026 09:59:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=8B=8D=E5=AE=8C=E5=90=8Euni.compressIma?= =?UTF-8?q?ge=E7=BC=A9=E6=94=BE=E8=87=B31080=C3=971080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/upload/camera_capture.nvue | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pages/upload/camera_capture.nvue b/pages/upload/camera_capture.nvue index 610c600..3395d54 100644 --- a/pages/upload/camera_capture.nvue +++ b/pages/upload/camera_capture.nvue @@ -130,8 +130,30 @@ path = e.detail.path || '' } if (path) { - // takePhotoSnapshot截取预览区域=所见即所得,直接使用 - this.capturedList.push(path) + this.resizeAndAdd(path) + } + }, + // 等比例放大到 1080×1080 + resizeAndAdd(srcPath) { + var that = this + try { + uni.compressImage({ + src: srcPath, + width: 1080, + height: 1080, + quality: 95, + success: function(res) { + that.capturedList.push(res.tempFilePath) + that.$forceUpdate() + }, + fail: function() { + that.capturedList.push(srcPath) + that.$forceUpdate() + } + }) + } catch(e) { + this.capturedList.push(srcPath) + this.$forceUpdate() } }, flipCamera() {