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);