From b20a93dd2854fef472eca51fd2a2934cba43ec59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=AE=E5=BE=AE=E4=B8=80=E7=AC=91?= <709648985@qq.com> Date: Fri, 24 Oct 2025 11:42:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BC=A0=E8=BE=93=E6=97=B6?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TextToHex/textToDotMatrixFor7305.vue | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/components/TextToHex/textToDotMatrixFor7305.vue b/components/TextToHex/textToDotMatrixFor7305.vue index 53661d0..3c6fc5e 100644 --- a/components/TextToHex/textToDotMatrixFor7305.vue +++ b/components/TextToHex/textToDotMatrixFor7305.vue @@ -149,26 +149,28 @@ // 5. 异步绘制并获取像素数据(串行处理避免冲突) await new Promise((resolve, reject) => { ctx.draw(false, () => { - uni.canvasGetImageData({ - canvasId: 'reusableCanvas', - x: 0, - y: 0, - width: this.currentCanvasWidth, - height: this.currentCanvasHeight, - success: res => { - result = { - line: textLine, - pixelData: res.data, - width: this.currentCanvasWidth, - height: this.currentCanvasHeight - }; - resolve(); - }, - fail: err => { - // console.error(`处理第${i+1}行失败:`, err); - reject(err) - } - }); + setTimeout(() => { + uni.canvasGetImageData({ + canvasId: 'reusableCanvas', + x: 0, + y: 0, + width: this.currentCanvasWidth, + height: this.currentCanvasHeight, + success: res => { + result = { + line: textLine, + pixelData: res.data, + width: this.currentCanvasWidth, + height: this.currentCanvasHeight + }; + resolve(); + }, + fail: err => { + // console.error(`处理第${i+1}行失败:`, err); + reject(err) + } + }); + }, 100); }); });