diff --git a/components/tpx-bluetooth-print/render-template-native.vue b/components/tpx-bluetooth-print/render-template-native.vue index 9a3f294..5cd1edb 100644 --- a/components/tpx-bluetooth-print/render-template-native.vue +++ b/components/tpx-bluetooth-print/render-template-native.vue @@ -68,9 +68,8 @@ export default { } prtInstance.setPagePrint() let commond = prtInstance.getPrintCmd() - console.log("打印命令组装完成,开始打印=====", commond) + console.log("打印命令组装完成,开始打印=====") printModule.print(commond) - that.showToast('数据发送成功,如果无法打印请重连设备重试') resolve(true) // await that.loadPrintProcess() // printModule.printTestSimple(deviceId) @@ -97,12 +96,20 @@ export default { if(!Array.isArray(imgsRes)) { imgsRes = [imgsRes] } + let cBl = false if(conSta) { - await this.handlePrint(imgsRes) - return true - } else { - return false + showLoading('正在发送打印数据..') + try{ + await this.handlePrint(imgsRes) + showToast('数据发送成功,如果无法打印请重连设备重试') + cBl = true + }catch(e){ + console.log('callPrint 打印异常=======') + console.error(e) + } + hideLoading() } + return cBl } } } diff --git a/components/tpx-bluetooth-print/tpx-bluetooth-print.vue b/components/tpx-bluetooth-print/tpx-bluetooth-print.vue index a54cbfa..7b31000 100644 --- a/components/tpx-bluetooth-print/tpx-bluetooth-print.vue +++ b/components/tpx-bluetooth-print/tpx-bluetooth-print.vue @@ -19,7 +19,7 @@