(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesOrder/print"],{"1cf0":function(e,c,t){"use strict";t.r(c);var n=t("224e"),i=t("8b67");for(var o in i)["default"].indexOf(o)<0&&function(e){t.d(c,e,(function(){return i[e]}))}(o);var s,r=t("0095"),a=Object(r["a"])(i["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],s);c["default"]=a.exports},"224e":function(e,c,t){"use strict";var n;t.d(c,"b",(function(){return i})),t.d(c,"c",(function(){return o})),t.d(c,"a",(function(){return n}));var i=function(){var e=this,c=e.$createElement;e._self._c},o=[]},7410:function(e,c,t){"use strict";(function(e){t("6cdc");n(t("4a15"));var c=n(t("1cf0"));function n(e){return e&&e.__esModule?e:{default:e}}e(c.default)}).call(this,t("f3be")["createPage"])},"8b67":function(e,c,t){"use strict";t.r(c);var n=t("9700"),i=t.n(n);for(var o in n)["default"].indexOf(o)<0&&function(e){t.d(c,e,(function(){return n[e]}))}(o);c["default"]=i.a},9700:function(e,c,t){"use strict";(function(e){Object.defineProperty(c,"__esModule",{value:!0}),c.default=void 0;var n=t("758e"),i=t("874c"),o={data:function(){return{devices:[],currDev:null,connId:"",piaojuText:""}},onLoad:function(){},methods:{destroyed:function(){console.log("destroyed----------"),""!=this.connId&&e.closeBLEConnection({deviceId:this.connId,success:function(e){console.log(e)}})},searchBle:function(){var c=this;console.log("initBule"),e.openBluetoothAdapter({success:function(t){console.log("打开 蓝牙模块"),console.log(t),c.onDevice(),e.getBluetoothAdapterState({success:function(t){console.log(t),t.available?(t.discovering&&c.stopFindBule(),console.log("开始搜寻附近的蓝牙外围设备"),e.startBluetoothDevicesDiscovery({success:function(e){console.log(e)}})):console.log("本机蓝牙不可用")}})}})},onDevice:function(){console.log("监听寻找到新设备的事件---------------");var c=this;e.onBluetoothDeviceFound((function(e){console.log("--------------new-----------------------"+JSON.stringify(e));var t=JSON.parse(JSON.stringify(e));console.log(t.devices[0].name+"  "+t.devices[0].deviceId);var n=t.devices[0].name;if("未知设备"!=n&&""!=n){var i=t.devices[0].deviceId;c.devices.push({name:n,deviceId:i,services:[]})}}))},stopFindBule:function(){console.log("停止搜寻附近的蓝牙外围设备---------------"),e.stopBluetoothDevicesDiscovery({success:function(e){console.log(e)}})},onConn:function(c){var t=this;console.log("连接蓝牙---------------"+c.deviceId);var n=c.deviceId;e.createBLEConnection({deviceId:n,complete:function(e){"createBLEConnection:ok"==e.errMsg?(console.log("连接蓝牙-["+c.name+"]--成功"),t.$msg("连接蓝牙-["+c.name+"]--成功"),t.connId=n,t.currDev=c,setTimeout((function(){t.getBLEServices(n)}),2e3)):console.log(e),t.stopFindBule()}})},getBLEServices:function(c){var t=this,n=c;console.log("获取蓝牙设备所有服务(service)"),e.getBLEDeviceServices({deviceId:n,complete:function(c){console.log(c);for(var i=function(){console.log(c.services[o].uuid);var i=c.services[o].uuid;e.getBLEDeviceCharacteristics({deviceId:n,serviceId:i,success:function(e){var c=JSON.parse(JSON.stringify(e));console.log("deviceId = ["+n+"]  serviceId = ["+i+"]");for(var o=0;o<c.characteristics.length;o++)if(1==c.characteristics[o].properties.write){var s=c.characteristics[o].uuid;for(var r in console.log(" deviceId = ["+n+"]  serviceId = ["+i+"] characteristics=["+s),t.devices)if(t.devices[r].deviceId==n){t.devices[r].services.push({serviceId:i,characteristicId:s});break}console.log(JSON.stringify(t.devices))}}})},o=0;o<c.services.length;o++)i()},fail:function(e){console.log(e)}})},senBlData:function(c,t,n,i){console.log("************deviceId = ["+c+"]  serviceId = ["+t+"] characteristics=["+n+"]");var o=Array.from(i);function s(e,c){for(var t={},n=0,i=0;i<e.length;i+=c)t[n]=e.slice(i,i+c),n++;return console.log(t),t}var r=s(o,20);function a(i,o){var s=i[o];if("undefined"!=typeof s){console.log("第【"+o+"】次写数据"+s);for(var r=new ArrayBuffer(s.length),l=new DataView(r),u=0;u<s.length;u++)l.setUint8(u,s[u]);e.writeBLECharacteristicValue({deviceId:c,serviceId:t,characteristicId:n,value:r,success:function(e){a(i,o+1)}})}}var l=0;a(r,l)},senBleLabel:function(){var e=this.currDev.deviceId,c=this.currDev.services[0].serviceId,t=this.currDev.services[0].characteristicId,i=n.jpPrinter.createNew();i.setSize(40,30),i.setGap(2),i.setCls(),i.setText(10,50,"TSS24.BF2",1,1,"收花人姓名：22小火花帽"),i.setText(10,90,"TSS24.BF2",1,1,"收花人电话：5521667788"),i.setText(10,130,"TSS24.BF2",1,1,"收花时间：2020-6-10 上午"),i.setText(10,170,"TSS24.BF2",1,1,"收花地址：11111厦门市集美区凤林前山路147号110室"),i.setPagePrint(),this.senBlData(e,c,t,i.getData())},billPrint:function(){var e=this.currDev.deviceId,c=this.currDev.services[0].serviceId,t=this.currDev.services[0].characteristicId,n=i.jpPrinter.createNew();n.init(),n.setText(this.piaojuText),n.setPrintAndFeedRow(1),this.senBlData(e,c,t,n.getData())}}};c.default=o}).call(this,t("f3be")["default"])}},[["7410","common/runtime","common/vendor"]]]);