uu
This commit is contained in:
parent
23e4a81122
commit
909b98ab8d
@ -30,20 +30,17 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.initData()
|
||||
},
|
||||
unmounted() {
|
||||
},
|
||||
methods: {
|
||||
async initData() {
|
||||
this.pic_res = await this.renderPic();
|
||||
},
|
||||
// 打印-发送二进制数据
|
||||
async writeBLECharacteristicValue(){
|
||||
|
||||
let pic_res
|
||||
try{
|
||||
pic_res = await this.renderPic();
|
||||
showToast('图片获取成功')
|
||||
}catch(e){
|
||||
showToast('图片获取失败')
|
||||
}
|
||||
let pic_res = this.pic_res
|
||||
let printerJobs = new PrinterJobs()
|
||||
|
||||
printerJobs
|
||||
@ -134,11 +131,12 @@ export default {
|
||||
src: filePath,
|
||||
success(res) {
|
||||
cxt.drawImage(filePath, 0, 0, that.canvas_width, that.canvas_height);
|
||||
cxt.draw();
|
||||
that.$nextTick(async () => { //获取画布像素数据
|
||||
let data = await that.getImageInfo({ canvasId: that.canvasId, width: that.canvas_width, height: that.canvas_height, })
|
||||
resolve(data)
|
||||
})
|
||||
cxt.draw(true, ()=> {
|
||||
setTimeout( async ()=> {
|
||||
let data = await that.getImageInfo({ canvasId: that.canvasId, width: that.canvas_width, height: that.canvas_height, })
|
||||
resolve(data)
|
||||
}, 1000)
|
||||
});
|
||||
},
|
||||
fail(e) {
|
||||
reject(e)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user