| | |
| | | } |
| | | |
| | | for(let binary of binarys){ |
| | | let sendSuccess = await this.$refs.bt2.sendMessage(binary); |
| | | console.log("发送是否成功: ", sendSuccess) |
| | | if(sendSuccess === false) { |
| | | return |
| | | } |
| | | try{ |
| | | let sendSuccess = await this.$refs.bt2.sendMessage(binary); |
| | | console.log("发送是否成功: ", sendSuccess) |
| | | if(sendSuccess === false) { |
| | | return |
| | | }else { |
| | | // 断开蓝牙连接 |
| | | this.$refs.bt2.closeBluetooth() |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '打印成功' |
| | | }) |
| | | } |
| | | }catch(e) { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: e |
| | | }) |
| | | // 断开蓝牙连接 |
| | | this.$refs.bt2.closeBluetooth() |
| | | // 停止传输 |
| | | return |
| | | } |
| | | |
| | | } |
| | | }, |
| | | async execPrint() { |