Browse Source

拆包打印

lijuncheng0816
zhang_li 4 months ago
parent
commit
f1e08fae23
  1. 27
      src/pages/point/index.vue

27
src/pages/point/index.vue

@ -207,7 +207,7 @@
let fileReader = new plus.io.FileReader(); let fileReader = new plus.io.FileReader();
fileReader.onloadend = (evt) => { fileReader.onloadend = (evt) => {
console.log("文件路径" + evt.target.result) console.log("文件路径" + evt.target.result)
this.data[index].barcodeBase64 = evt.target.result // this.data[index].barcodeBase64 = evt.target.result
this.generateBase64(index + 1) this.generateBase64(index + 1)
} }
fileReader.readAsDataURL(file); fileReader.readAsDataURL(file);
@ -255,6 +255,31 @@
this.originData = JSON.parse(option.points); this.originData = JSON.parse(option.points);
} }
this.data = this.originData 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)
}
})
})
})
}, },
} }
</script> </script>

Loading…
Cancel
Save