diff --git a/components/tpx-bluetooth-print/render-template-native.vue b/components/tpx-bluetooth-print/render-template-native.vue index 42d7c4d..71c173f 100644 --- a/components/tpx-bluetooth-print/render-template-native.vue +++ b/components/tpx-bluetooth-print/render-template-native.vue @@ -14,7 +14,7 @@ - 正在打印, 请勿退出页面, 如果卡住了请重连打印机重试 + 正在发送数据, 请勿退出页面, 如果卡住了请重连打印机重试 @@ -71,11 +71,27 @@ export default { let commond = prtInstance.getPrintCmd() console.log("打印命令组装完成,开始打印=====", commond) printModule.print(commond) + await that.loadPrintProcess() // printModule.printTestSimple(deviceId) }) }, - + // 模拟打印进度, 用于加载进度条 + async loadPrintProcess(){ + let that = this + this.percentage = 0 + let addLen = 10 + for(let i=0; i<100; i = i + addLen) { + await new Promise((resolve)=> { + setTimeout(()=> { + that.percentage = i + resolve() + }, 3000/addLen) + }) + } + that.percentage = 0 + that.showToast('数据发送完毕') + }, renderCanvasImg(filePath) { let that = this showLoading() diff --git a/components/tpx-bluetooth-print/render-template.vue b/components/tpx-bluetooth-print/render-template.vue index 052962f..2be159f 100644 --- a/components/tpx-bluetooth-print/render-template.vue +++ b/components/tpx-bluetooth-print/render-template.vue @@ -15,7 +15,7 @@ - 正在打印, 请勿退出页面, 如果卡住了请重连打印机重试 + 正在发送数据, 请勿退出页面, 如果卡住了请重连打印机重试