examTeamApp/unpackage/dist/build/mp-weixin/pageTwo/devices/F01PRO.js

1 line
9.4 KiB
JavaScript
Raw Normal View History

2025-08-06 15:49:20 +08:00
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageTwo/devices/F01PRO"],{"1b04":function(e,t,o){"use strict";o.d(t,"b",(function(){return n})),o.d(t,"c",(function(){return i})),o.d(t,"a",(function(){}));var n=function(){var e=this.$createElement;this._self._c},i=[]},"65dc":function(e,t,o){"use strict";o.r(t);var n=o("e9d1"),i=o.n(n);for(var s in n)["default"].indexOf(s)<0&&function(e){o.d(t,e,(function(){return n[e]}))}(s);t["default"]=i.a},ad58:function(e,t,o){"use strict";o.r(t);var n=o("1b04"),i=o("65dc");for(var s in i)["default"].indexOf(s)<0&&function(e){o.d(t,e,(function(){return i[e]}))}(s);var c=o("828b"),r=Object(c["a"])(i["default"],n["b"],n["c"],!1,null,"5409745b",null,!1,n["a"],void 0);t["default"]=r.exports},ccd9:function(e,t,o){"use strict";(function(e,t){var n=o("47a9");o("bad8");n(o("3240"));var i=n(o("ad58"));e.__webpack_require_UNI_MP_PLUGIN__=o,t(i.default)}).call(this,o("3223")["default"],o("df3c")["createPage"])},e9d1:function(e,t,o){"use strict";(function(e){var n=o("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(o("7ca3")),s=o("8f59");function c(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function r(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?c(Object(o),!0).forEach((function(t){(0,i.default)(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):c(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var a=requirePlugin("sdkPlugin").AiLink,u={data:function(){return{textW:"",textH:"",textImp:"",height:"",weight:"",imp:0,macAddr:"",deviceId:"",serviceId:"",readId:"",writeId:"",notifyId:"",isSend:!0,Unload:!1,isConnection:0,data01:{},data02:{},BLEResult:{}}},computed:r(r({},(0,s.mapState)(["user","isConnected","isBluetoothTyle"])),{},{userInfo:function(){return this.user}}),onUnload:function(){console.log("F01PROonUnload-"+this.Unload),this.Unload||(clearTimeout(void 0),this.closeBLEConnection(),this.closeBluetoothAdapter(),this.$store.state.devicesList2=[],console.log("页面返回onUnload"))},watch:{isConnected:function(){this.isConnected||(console.log("F01PROisConnected-"+this.isConnected),this.handleBack(),this.isConnection=2)},isBluetoothTyle:function(){this.isBluetoothTyle||(console.log("F01PROisBluetoothTyle-"+this.isBluetoothTyle),this.handleBack(),this.isConnection=2)}},onLoad:function(t){var o=this;o.textW="",o.textH="",console.log("options",t),t&&t.deviceId&&(o.deviceId=t.deviceId,o.createBLEConnection()),o.onBLEConnectionStateChange(),e.onBluetoothAdapterStateChange((function(e){o.$store.commit("changeBluetooth",e.available)}))},methods:{openBluetoothAdapter:function(){var t=this;t.textW="",t.textH="",t.isSend=!0,t.Unload=!1,e.openBluetoothAdapter({success:function(e){t.isConnection=0,t.startBluetoothDeviceDiscovery(),console.log("初始化蓝牙成功:"+e.errMsg)},fail:function(e){t.isConnection=2,t.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")}})},onBLEConnectionStateChange:function(){var t=this;e.onBLEConnectionStateChange((function(e){console.log("F01PROonBLEConnectionStateChange-"+t.Unload),e.connected||(t.Unload=!0,t.isConnection=2,clearTimeout(void 0),t.closeBLEConnection(),t.closeBluetoothAdapter()),t.$store.commit("changeConnected",e.connected)}))},startBluetoothDeviceDiscovery:function(){var t=this;e.startBluetoothDevicesDiscovery({allowDuplicatesKey:!1,interval:500,success:function(e){t.isConnection=0,t.onBluetoothDeviceFound()},fail:function(e){t.isConnection=2,t.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")}})},onBluetoothDeviceFound:function(){var t=this;t.isConnection=0,e.onBluetoothDeviceFound((function(e){e.devices.forEach((function(e){if((e.name||e.localName)&&(-1!=e.name.indexOf("AiLink_")||-1!=e.name.indexOf("PCF01")||e.localName&&(-1!=e