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