From dc45abe72ebf90bf39bed0da1b5c8ebd3eab3314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com> Date: Mon, 28 Oct 2024 15:20:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=8C=85=E6=89=93=E5=8D=B0=202024/8/7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/point/index.vue | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/pages/point/index.vue b/src/pages/point/index.vue index ca49a5c2..3ab861cd 100644 --- a/src/pages/point/index.vue +++ b/src/pages/point/index.vue @@ -165,7 +165,7 @@ export default { ` } str += ` - +
打印时间
${item.printTimes}
@@ -201,7 +201,7 @@ export default { const fileReader = new plus.io.FileReader() fileReader.onloadend = (evt) => { console.log(`文件路径${evt.target.result}`) - this.data[index].barcodeBase64 = evt.target.result + // this.data[index].barcodeBase64 = evt.target.result this.generateBase64(index + 1) } fileReader.readAsDataURL(file) @@ -258,6 +258,29 @@ export default { this.originData = JSON.parse(option.points) } this.data = this.originData + this.$nextTick(async () => { + // 获取二维码图片临时路径 + const el = this.$refs['qrcodeRef'] + let str = '' + el.forEach(async (item, index) => { + await item.canvasToTempFilePath({ + success: async (res) => { + // 将临时路径转换成base64 + await pathToBase64(res.tempFilePath).then(base64 => { + this.data[index].barcodeBase64 = base64 + if (index == el.length - 1) { + this.isLoadFinish = true + } + }).catch(err => { + console.log(err); + }) + }, + fail(err) { + console.log('err:::', err) + } + }) + }) + }) } }