examTeamApp/unpackage/dist/build/mp-weixin/pages/skiping/skip.js

1 line
11 KiB
JavaScript
Raw Normal View History

2024-12-10 14:14:28 +08:00
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/skiping/skip"],{"115c":function(e,t,i){"use strict";i.r(t);var n=i("ac7d"),o=i("6a7a");for(var c in o)["default"].indexOf(c)<0&&function(e){i.d(t,e,(function(){return o[e]}))}(c);i("c3fb");var s=i("828b"),r=Object(s["a"])(o["default"],n["b"],n["c"],!1,null,"eaae2774",null,!1,n["a"],void 0);t["default"]=r.exports},"46f7":function(e,t,i){"use strict";(function(e,t){var n=i("47a9");i("30b7");n(i("3240"));var o=n(i("115c"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(o.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"49a5":function(e,t,i){"use strict";(function(e){var n=i("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,c=n(i("7ca3")),s=i("8f59");function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){(0,c.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var u={data:function(){return{active:1,acd_id:6,weight:50,disabled:!1,isDevice:0,isConnection:!1,time_m:"",time_s:"",timeList:[],devicesList:[],timesTndex:[1,0],deviceId:"",serviceId:"",write:"",notify:"",islink:0,textLink:""}},components:{record:function(){i.e("element/manuallyAdd/record").then(function(){return resolve(i("e472"))}.bind(null,i)).catch(i.oe)}},computed:a(a({},(0,s.mapState)(["user","MeasureSkip","isConnected","isBluetoothTyle"])),{},{info:function(){return this.MeasureSkip}}),mounted:function(){this.timeList=this.$tools.gethms(),this.time_m=this.timeList[0][1].substring(0,2),this.time_s=this.timeList[1][0].substring(0,2)},onLoad:function(t){var i=this;t&&t.deviceId&&(i.deviceId=t.deviceId,setTimeout((function(){i.createBLEConnection()}),500)),t&&t.acd_id&&(i.$Bluetooth.stopBluetoothDevicesDiscovery(),setTimeout((function(){i.handleisSdevice()}),500)),i.$store.dispatch("getSkipResult",{aud_id:e.getStorageSync("userid")}),i.isConnection=i.isConnected,i.onBLEConnectionStateChange(),e.onBluetoothAdapterStateChange((function(e){i.$store.commit("changeBluetooth",e.available)}))},onPullDownRefresh:function(){setTimeout((function(){e.stopPullDownRefresh()}),1e3)},onShow:function(){var t=this;e.$on("updateData",(function(i){var n=JSON.parse(i);t.acd_id=n.acd_id,t.isDevice=n.device,t.active=n.active,t.deviceId=n.deviceId,t.serviceId=n.serviceId,t.write=n.write,t.notify=n.notify,t.islink=t.isConnected?1:-1,t.isConnection=t.isConnected,t.notifyBLECharacteristicValue(),n.isSuccessful&&t.$store.dispatch("getSkipResult",{aud_id:e.getStorageSync("userid")}),t.onBLEConnectionStateChange(),e.onBluetoothAdapterStateChange((function(e){t.$store.commit("changeBluetooth",e.available)})),console.log("监听到事件来自 updateData",n)}))},onUnload:function(){clearTimeout(o),this.islink=-1,this.isConnection=!1,this.closeBLEConnection(),this.closeBluetoothAdapter(),e.$off("updateData"),setTimeout((function(){e.switchTab({url:"/pages/home/home"})}),300),console.log("返回首页onUnload")},watch:{isConnected:function(){this.isConnected||(this.islink=-1,this.textLink="重新连接"),this.isConnection=this.isConnected,console.log("蓝牙是否连接",this.isConnected)},isBluetoothTyle:function(){this.isBluetoothTyle||(this.isConnection=!1,this.textLink="请打开手机蓝牙",this.islink=-1),console.log("蓝牙是否打开",this.isBluetoothTyle)}},methods:{handleisSdevice:function(){var t=this;t.isConnected||(t.devicesList=[],t.$Bluetooth.stopBluetoothDevicesDiscovery(),e.openBluetoothAdapter({success:function(e){t.islink=0,t.handleMyTime(),t.textLink="蓝牙搜索中",t.startBluetoothDeviceDiscovery(),t.$store.commit("changeBluetooth",!0),console.log("初始化蓝牙成功:"+e.errMsg)},fail:function(e){