From 5d3ac55f076c47fc5c6e1a37a23b8786b383dd25 Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Mon, 13 May 2024 19:02:16 +0800 Subject: [PATCH] uu --- components/tpx-bluetooth-print/render-template.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/tpx-bluetooth-print/render-template.vue b/components/tpx-bluetooth-print/render-template.vue index f7c3bc6..3867f38 100644 --- a/components/tpx-bluetooth-print/render-template.vue +++ b/components/tpx-bluetooth-print/render-template.vue @@ -6,7 +6,7 @@ @@ -36,7 +36,7 @@ export default { }, data () { return { - canvasId: 'shareCanvas', + canvasId: uni.$u.guid(20), canvasWidth: 1, canvasHeight: 1, imgData: '', @@ -110,6 +110,9 @@ export default { console.log("===renderCanvasImg:filePath=====", filePath) return new Promise(async (resolve, reject)=> { try{ + // 多次渲染,createCanvasContext,必须使用新的才可以 + that.canvasId = uni.$u.guid(20) + await promiseTimeout(500) let res = await getImageInfo(filePath) console.log("getImageInfo res====", res) const ctx = uni.createCanvasContext(that.canvasId, that);