(this["webpackJsonp"]=this["webpackJsonp"]||[]).push([["app-service"],{"0de9":function(e,t,n){"use strict";function i(e){var t=Object.prototype.toString.call(e);return t.substring(8,t.length-1)}function o(){return"string"===typeof __channelId__&&__channelId__}function a(e,t){switch(i(t)){case"Function":return"function() { [native code] }";default:return t}}function r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1){var c=s.pop();l=s.join("---COMMA---"),0===c.indexOf(" at ")?l+=c:l+="---COMMA---"+c}else l=s[0];console[r](l)}n.r(t),n.d(t,"log",(function(){return r})),n.d(t,"default",(function(){return s}))},"16f0":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={data:function(){return{onBluetoothDeviceFoundcustom:"",deviceId:"",stringToSend:"$D50504010300#",setInterTimeBEL:null}},onLoad:function(){},methods:{checkAndOpenGPS:function(){var t=plus.android.importClass("android.content.Context"),n=plus.android.importClass("android.location.LocationManager"),i=plus.android.runtimeMainActivity(),o=i.getSystemService(t.LOCATION_SERVICE),a=o.isProviderEnabled(n.GPS_PROVIDER),r=o.isProviderEnabled(n.NETWORK_PROVIDER);if(a||r)e("log","\u4f4d\u7f6e\u670d\u52a1\u5df2\u5f00\u542f"," at mixins/linkBEL.js:26"),this.openBluetoothAdapter();else{e("log","\u4f4d\u7f6e\u670d\u52a1\u672a\u5f00\u542f\uff0c\u8df3\u8f6c\u5230\u8bbe\u7f6e\u9875\u9762"," at mixins/linkBEL.js:29");var s=plus.android.importClass("android.content.Intent"),l=plus.android.importClass("android.provider.Settings"),c=new s(l.ACTION_LOCATION_SOURCE_SETTINGS);i.startActivity(c),plus.nativeUI.alert("\u8bf7\u624b\u52a8\u5f00\u542fGPS\uff01")}},openBluetoothAdapter:function(){var t=this;t.closeBluetoothAdapter(),e("log","\u521d\u59cb\u5316\u84dd\u7259"," at mixins/linkBEL.js:44"),uni.openBluetoothAdapter({success:function(n){e("log",n," at mixins/linkBEL.js:47");t.webViewToH5({command:"belConnectFeedback",commandType:"BEL",data:{state:0,message:"\u521d\u59cb\u5316\u6210\u529f"}}),t.startBluetoothDevicesDiscovery()},fail:function(n){e("log","\u521d\u59cb\u5316\u84dd\u7259\u5931\u8d25",n," at mixins/linkBEL.js:60");t.webViewToH5({command:"belConnectFeedback",commandType:"BEL",data:{state:0,message:"\u521d\u59cb\u5316\u5931\u8d25"}}),setTimeout((function(){t.openBluetoothAdapter()}),5e3)}})},startBluetoothDevicesDiscovery:function(){var t=this;e("log","\u5f00\u59cb\u641c\u7d22\u84dd\u7259\u8bbe\u5907"," at mixins/linkBEL.js:79");t.webViewToH5({command:"belConnectFeedback",commandType:"BEL",data:{state:0,message:"\u8bbe\u5907\u641c\u7d22\u4e2d"}}),uni.startBluetoothDevicesDiscovery({success:function(n){e("log",n," at mixins/linkBEL.js:91"),t.onBluetoothDeviceFound()}})},onBluetoothDeviceFound:function(){var t=this;this.onBluetoothDeviceFoundcustom=uni.onBluetoothDeviceFound((function(n){e("log","\u76d1\u542c\u8bbe\u5907\u53d1\u73b0",n.devices[0]," at mixins/linkBEL.js:100"),"ACP60205"===n.devices[0].name&&(e("log","hello\uff0c\u5389\u5bb3\uff0c\u627e\u5230\u5566\uff0c\u5566\u5566\u5566~~~"," at mixins/linkBEL.js:102"),uni.stopBluetoothDevicesDiscovery(),t.deviceId=n.devices[0].deviceId,t.createBLEConnection())}))},createBLEConnection:function(){var t=this;e("log","\u8fde\u63a5\u5230\u8bbe\u5907that.deviceId",t.deviceId," at mixins/linkBEL.js:113"),uni.createBLEConnection({deviceId:t.deviceId,success:function(){e("log","\u8fde\u63a5\u6210\u529f"," at mixins/linkBEL.js:117");t.webViewToH5({command:"belConnectFeedback",commandType:"BEL",data:{state:0,message:"\u5df2\u8fde\u63a5"}}),t.belStatus()},fail:function(n){e("error","\u8fde\u63a5\u5931\u8d25",n," at mixins/linkBEL.js:130");t.webViewToH5({command:"belConnectFeedback",commandType:"BEL",data:{state:0,message:"\u8fde\u63a5\u5931\u8d25"}}),setTimeout((function(){t.openBluetoothAdapter()}),5e3)}})},belStatus:function(){var e=this;clearInterval(this.setInterTimeBEL),this.setInterTimeBEL=setInterval((function(){e.getConnectedBluetoothDevices()}),5e3)},getConnectedBluetoothDevices:function(){var t=this;uni.getConnectedBluetoothDevices({success:function(n){if(e("log","\u5f53\u524d\u5df2\u8fde\u63a5\u7684\u8bbe\u5907:",n.devices," at mixins/linkBEL.js:158"),n.devices.length<=0){t.openBluetoothAdapter(),clearInterval(t.setInterTimeBEL);var i={command:"belConnectFeedback",commandType:"BEL",data:{state:0,message:"\u8fde\u63a5\u5931\u8d25"}};t.webViewToH5(i)}else{i={command:"belConnectFeedback",commandType:"BEL",data:{state:0,message:"\u5df2\u8fde\u63a5"}};t.webViewToH5(i)}},fail:function(n){e("log","\u83b7\u53d6\u5df2\u8fde\u63a5\u8bbe\u5907\u5931\u8d25:",n," at mixins/linkBEL.js:184"),t.openBluetoothAdapter()}})},writeBLECharacteristicValue:function(t){e("log","\u53d1\u9001\u84dd\u7259\u5185\u5bb9",t," at mixins/linkBEL.js:191");var n=this,i=n.stringToByteArray(t);e("log"," dataToSend.buffer",i.buffer," at mixins/linkBEL.js:198"),uni.writeBLECharacteristicValue({deviceId:n.deviceId,serviceId:"0000ffe0-0000-1000-8000-00805f9b34fb",characteristicId:"0000ffe1-0000-1000-8000-00805f9b34fb",value:i.buffer,writeType:"write",success:function(){e("log","\u53d1\u9001\u5185\u5bb9\u6210\u529f"," at mixins/linkBEL.js:206");n.webViewToH5({command:"sendBelDataFeedback",commandType:"BEL",data:{state:0,message:"\u53d1\u9001\u5185\u5bb9\u6210\u529f"}})},fail:function(t){e("error","\u53d1\u9001\u5185\u5bb9\u5931\u8d25",t," at mixins/linkBEL.js:218");n.webViewToH5({command:"sendBelDataFeedback",commandType:"BEL",data:{state:0,message:"\u53d1\u9001\u5185\u5bb9\u5931\u8d25"}})}})},stringToByteArray:function(e){for(var t=new Uint8Array(e.length),n=0;n0){var o=i.data.sort((function(e,t){return new Date(t.time)-new Date(e.time)}));e("log","newData\u65f6\u95f4\u6392\u5e8f",o," at mixins/linkFTP.js:123"),n.ftpChangeWorkingDirectory("/",(function(n){e("log","\u4e0b\u8f7d\u524d\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5",n," at mixins/linkFTP.js:126"),n.data&&t.ftpDownloadSingleFile(o[0])}))}else t.readerFileFlag=!1}))},ftpDownloadSingleFile:function(t){var i=this;e("log","androidFileDocPath",this.androidFileDocPath," at mixins/linkFTP.js:140"),n.ftpDownloadSingleFile(this.androidFileDocPath,t.name,(function(n){e("log","\u5355\u4e2a\u6587\u4ef6\u4e0b\u8f7d\u81f3\u5b89\u5353\u673a--\u6210\u529f",n," at mixins/linkFTP.js:143"),"download"===n.type&&n.data.status?i.readerFile(t):i.readerFileFlag=!1}))},readerFile:function(t){var n=this,i=this.androidFileDocPath+t.fileName;e("log","\u83b7\u53d6\u5b89\u5353\u673a\u4e34\u65f6\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9",i," at mixins/linkFTP.js:154"),plus.io.resolveLocalFileSystemURL(i,(function(i){e("log","\u6587\u4ef6\u6761\u76ee:",i," at mixins/linkFTP.js:157"),i.file((function(i){e("log","file",i," at mixins/linkFTP.js:159");var o=new plus.io.FileReader;o.onloadend=function(i){e("log","\u6587\u4ef6\u5185\u5bb9:",i.target.result," at mixins/linkFTP.js:162");var o={command:"examineData",commandType:"FTP",data:{state:0,message:JSON.stringify(i.target.result),fileName:t.fileName}};n.webViewToH5(o),n.readerFileFlag=!1},o.readAsText(i)}),(function(t){e("error","\u8bfb\u53d6\u6587\u4ef6\u5931\u8d25:",t," at mixins/linkFTP.js:177"),n.readerFileFlag=!1}))}),(function(t){e("error","\u83b7\u53d6\u6587\u4ef6\u8def\u5f84\u5931\u8d25:",t," at mixins/linkFTP.js:181"),n.readerFileFlag=!1}))},deleteAppDownLoadFile:function(t){e("log"," \u5220\u9664\u5b89\u5353\u673a\u4e0b\u8f7d\u4e0b\u6765\u7684\u6587\u4ef6--data",t," at mixins/linkFTP.js:187");var n=this.androidFileDocPath+t.fileName;plus.io.resolveLocalFileSystemURL(n,(function(t){t.remove((function(){e("log","\u6587\u4ef6\u5220\u9664\u6210\u529f"," at mixins/linkFTP.js:193")}),(function(t){e("log","\u6587\u4ef6\u5220\u9664\u5931\u8d25: "+t.message," at mixins/linkFTP.js:195")}))}),(function(t){e("log","\u65e0\u6cd5\u89e3\u6790\u6587\u4ef6\u8def\u5f84: "+t.message," at mixins/linkFTP.js:198")}))},ftpDeleteServerFiles:function(t){var i=this.cgConfigInfo.data.inspectionDir+"/"+t.fileName;e("log","\u5220\u9664FTP\u670d\u52a1\u5668\u6587\u4ef6",i," at mixins/linkFTP.js:207"),t&&t.fileName&&n.ftpDeleteServerFiles(i,(function(t){e("log","FTP\u670d\u52a1\u5668\u6587\u4ef6\u5220\u9664\u6210\u529f",i,t," at mixins/linkFTP.js:209")}))},ftpDeleteServerFilesWithoutDirectory:function(){n.ftpDeleteServerFilesWithoutDirectory(this.cgConfigInfo.data.inspectionDir,(function(t){e("log",t," at mixins/linkFTP.js:219")}))},closeFTPConnect:function(){var t=this;e("log","FTP\u65ad\u5f00\u8fde\u63a5\uff01\uff01\uff01\uff01"," at mixins/linkFTP.js:237"),n.closeFTPConnect((function(n){e("log","FTP\u65ad\u5f00\u8fde\u63a5",n," at mixins/linkFTP.js:240"),clearInterval(t.setInterTimeFTP)}))},webViewToH5:function(t){var n=this.$scope.$getAppWebview(),i=n.children()[0];e("log","uniapp \u4f20\u53c2\u7ed9 vue\u9875\u9762"," at mixins/linkFTP.js:249"),i.evalJS("getVueMessage(".concat(JSON.stringify(t),")"))}}};t.default=i}).call(this,n("0de9")["default"])},"8bbf":function(e,t){e.exports=Vue},9523:function(e,t,n){var i=n("a395");e.exports=function(e,t,n){return t=i(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports["default"]=e.exports},"9ba7":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=uni.requireNativePlugin("Zhimi-UsbSerial"),i={data:function(){return{setInterTimeUSB:null,vendorId:"",port:"",usbDevicesComPortsList:[]}},destroyed:function(){e("log","\u9500\u6bc1\u9875\u9762"," at mixins/linkUSB.js:12"),clearInterval(this.setInterTimeUSB)},methods:{usbStatus:function(){var e=this;clearInterval(this.setInterTimeUSB),this.setInterTimeUSB=setInterval((function(){e.connectUSB("open")}),5e3)},connectUSB:function(t,i){var o=this;e("log","UsbSerial",n," at mixins/linkUSB.js:25"),n.setDataCallback((function(t){if(e("log","\u8bbe\u7f6eUSB\u6570\u636e\u56de\u8c03-res",t," at mixins/linkUSB.js:28"),"onUsbDeviceAttached"==t.type){e("log","USB\u5df2\u63d2\u5165"," at mixins/linkUSB.js:30");var n={command:"comStatusChanged",data:{state:0,message:"USB\u5df2\u63d2\u5165"}};o.webViewToH5(n)}else if("onUsbDeviceDetached"==t.type){e("log","USB\u5df2\u62d4\u51fa"," at mixins/linkUSB.js:40");n={command:"comStatusChanged",data:{state:0,message:"USB\u5df2\u62d4\u51fa"}};o.webViewToH5(n)}else if("startUpdateValue"===t.type)e("log","\u6b63\u5728\u63a5\u53d7\u6570\u636e\u4e2d,\u8bf7\u7a0d\u7b49..."," at mixins/linkUSB.js:50");else if("onNewData"==t.type){n=t.data.data,t.data.string;var i=t.data.hex;e("log","hex",i," at mixins/linkUSB.js:57"),e("log","this.hexCharCodeToStr(hex)",JSON.stringify(o.hexCharCodeToStr(i))," at mixins/linkUSB.js:59");n={command:"examineData",commandType:"USB",data:{state:0,message:JSON.stringify(o.hexCharCodeToStr(i))}};o.webViewToH5(n)}else if("onRunError"==t.type){n={command:"comStatusChanged",data:{state:0,message:"USBRunError"}};o.webViewToH5(n)}})),n.setReceiveTime(2,500),n.getUsbDevices((function(n){if(e("log","\u83b7\u53d6usb\u5217\u8868-usbDevices",n," at mixins/linkUSB.js:88"),n.length>0)if(o.usbDevicesComPortsList=n.map((function(e){return e.device.vendorId})),"NoOpen"===t)i();else{var a=n.filter((function(e){return e.device.vendorId==o.cgConfigInfo.data.portName}));e("log","usbDevice",a," at mixins/linkUSB.js:98"),a.length>0&&(o.vendorId=a[0].device.vendorId,o.port=a[0].ports[0],o.openUSB())}else o.usbDevicesComPortsList=[],"NoOpen"===t&&i()}))},openUSB:function(){var t=this,i=this.cgConfigInfo.data;e("log","\u6253\u5f00USB",this.vendorId," at mixins/linkUSB.js:114"),n.grantUsbPermission(this.vendorId,(function(o){if(e("log","\u68c0\u67e5\u6388\u6743Usb\u6743\u9650",o," at mixins/linkUSB.js:117"),1==o)n.open(t.vendorId,t.port,(function(o){if(e("log","\u6253\u5f00usb\u8fde\u63a5",o," at mixins/linkUSB.js:121"),1==o){n.setParameters(i.baudRate,i.dataBits,i.stopBits,i.parity);t.webViewToH5({command:"comStatusChanged",data:{state:0,message:"USB\u5df2\u6253\u5f00"}})}}));else{t.webViewToH5({command:"comStatusChanged",data:{state:0,message:"USB\u672a\u6388\u6743"}})}}))},closeUSB:function(){e("log","\u5173\u95edusb"," at mixins/linkUSB.js:149"),n.close(),clearInterval(this.setInterTimeUSB);this.webViewToH5({command:"comStatusChanged",data:{state:0,message:"USB\u5df2\u5173\u95ed"}})},hexCharCodeToStr:function(e){var t,n=e.trim(),i="0x"===n.substr(0,2).toLowerCase()?n.substr(2):n,o=i.length;if(o%2!==0)return alert("\u5b58\u5728\u975e\u6cd5\u5b57\u7b26!"),"";for(var a=[],r=0;r