蓝牙控制阀小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
33 KiB

{"version":3,"sources":["uni-app:///main.js","webpack:///D:/yin/workspace/uni-app/BLEApp/pages/index/index.vue?55a3","webpack:///D:/yin/workspace/uni-app/BLEApp/pages/index/index.vue?9f1e","webpack:///D:/yin/workspace/uni-app/BLEApp/pages/index/index.vue?5bfe","webpack:///D:/yin/workspace/uni-app/BLEApp/pages/index/index.vue?973a","uni-app:///pages/index/index.vue","webpack:///D:/yin/workspace/uni-app/BLEApp/pages/index/index.vue?2821","webpack:///D:/yin/workspace/uni-app/BLEApp/pages/index/index.vue?9cbb"],"names":["createPage","Page"],"mappings":";;;;;;;;;;kDAAA;AACA;AACA,4F;AACAA,UAAU,CAACC,cAAD,CAAV,C;;;;;;;;;;;;;ACHA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkH;AAClH;AACyD;AACL;AACa;;;AAGjE;AAC4M;AAC5M,gBAAgB,mNAAU;AAC1B,EAAE,2EAAM;AACR,EAAE,gFAAM;AACR,EAAE,yFAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,oFAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,8NAEN;AACP,KAAK;AACL;AACA,aAAa,wNAEN;AACP,KAAK;AACL;AACA,aAAa,wNAEN;AACP,KAAK;AACL;AACA,aAAa,0OAEN;AACP,KAAK;AACL;AACA,aAAa,kQAEN;AACP,KAAK;AACL;AACA,aAAa,0OAEN;AACP,KAAK;AACL;AACA,aAAa,oOAEN;AACP,KAAK;AACL;AACA,aAAa,oOAEN;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACzEA;AAAA;AAAA;AAAA;AAA+yB,CAAgB,6yBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACyCn0B;AACA,MADA,kBACA;AACA;AACA,uBADA;AAEA,gBAFA;AAGA,cAHA;AAIA,sBAJA;AAKA,mBALA;AAMA,sBANA;AAOA,kBAPA;AAQA,cARA;AASA,cATA;AAUA,cAVA;AAWA;AACA,qBADA;AAEA,mBAFA;AAGA,oBAHA,EAXA;;AAgBA,sBAhBA;;;AAmBA,GArBA;AAsBA,QAtBA,oBAsBA;AACA;AACA,GAxBA;AAyBA;AACA;AACA;AACA;AACA;AACA,GA9BA;AA+BA;AACA,aADA,uBACA;AACA;AACA,KAHA;AAIA,aAJA,uBAIA;AACA;AACA,KANA;AAOA,aAPA,uBAOA;AACA;AACA,KATA;AAUA,kBAVA,4BAUA;AACA;AACA;AACA;AACA;AACA;AACA,OAJA,EAIA,IAJA;AAKA;AACA,yBADA;AAEA,uBAFA;AAGA,sBAHA;;AAKA;AACA,KAvBA;AAwBA,cAxBA,wBAwBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCADA;AAEA,+BAFA;AAGA,8BAHA;;AAKA;AACA;AACA;AACA;AACA,eAJA,EAIA,IAJA;AAKA;AACA,aAhBA;AAiBA;AACA;;;;AAIA,aAtBA;;AAwBA;AACA,SA5BA;AA6BA;AACA;AACA;AACA;AACA;AACA;AACA,SAnCA;;;;AAuCA,KAhEA;;AAkEA;;;AAGA,wBArEA,kCAqEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SANA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA,SAbA;;AAeA,KArFA;AAsFA;;;AAGA,kCAzFA,4CAyFA;AACA;AACA;AACA;AACA,SAHA;AAIA;AACA;AACA;AACA;AACA;AACA,SATA;;AAWA,KArGA;AAsGA;;;AAGA,iCAzGA,yCAyGA,KAzGA,EAyGA;AACA;AACA;AACA;AACA;AACA,SAHA;AAIA;AACA;AACA;AACA;AACA;AACA,SATA;;AAWA,KAtHA;AAuHA;;;AAGA,0BA1HA,oCA0HA;AACA;AACA;AACA;AACA,OAHA;AAIA,KA/HA;AAgIA;;;AAGA,uBAnIA,iCAmIA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAPA,MAOA;AACA;AACA;AACA,WAZA;AAaA,SAfA;AAgBA;AACA;AACA;AACA;AACA;AACA,SArBA;;;;AAyBA,KAjKA;AAkKA;;;AAGA,4BArKA,sCAqKA;AACA;AACA;AACA;AACA;AACA,SAHA;AAIA;AACA;AACA;AACA;AACA;AACA,SATA;;AAWA,KAlLA;AAmLA;;;AAGA,uBAtLA,iCAsLA;;AAEA;AACA;AACA,wBADA;AAEA,uBAFA;AAGA,uBAHA;;;AAMA;AACA;AACA,4BADA;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,2BADA;AAEA,6BAFA;AAGA,4BAHA;;AAKA;;AAEA;AACA,WAnBA;AAoBA;AACA;AACA;;;;;AAKA;AACA;AACA;AACA;AACA,WA/BA;;AAiCA;AACA,KAlOA;AAmOA;;;AAGA,sBAtOA,gCAsOA;AACA;AACA;AACA;AACA,0BADA;AAEA;AACA;AACA;AACA;AACA;AACA,SAPA;AAQA;AACA;AACA;AACA;AACA;AACA,SAbA;;AAeA,KAxPA;AAyPA;;;AAGA,wBA5PA,kCA4PA;AACA;AACA;AACA,0BADA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAFA;AAGA;AACA,SAfA;AAgBA;AACA;AACA;AACA;AACA;AACA,SArBA;;AAuBA,KArRA;AAsRA;;;AAGA,+BAzRA,uCAyRA,IAzRA,EAyRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BADA;AAEA,4BAFA;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;AAqBA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA,WAhCA;AAiCA;AACA;AACA,kCADA;AAEA,4BAFA;AAGA,8BAHA;;AAKA;AACA;AACA,yBADA,EACA;AACA,gCAFA;AAGA,kCAHA;AAIA,wDAJA;AAKA,qBALA,mBAKA,GALA,EAKA;AACA;AACA;AACA;AACA,iBAFA,EAEA,IAFA;AAGA,eAVA;AAWA,kBAXA,gBAWA,CAXA,EAWA;AACA;AACA;AACA;AACA;AACA,eAhBA;;AAkBA;AACA,SArEA;AAsEA;AACA;AACA;AACA;AACA;AACA,SA3EA;;AA6EA,KA5WA;AA6WA;;;AAGA,8BAhXA,wCAgXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAXA;AAYA,KA7XA;AA8XA,qCA9XA,6CA8XA,GA9XA,EA8XA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0BADA;;AAGA,4BAHA;AAIA;AACA,0CALA;AAMA,qBANA;AAOA;AACA;AACA,SATA;AAUA;AACA;AACA,SAZA;;AAcA,KAxZA;AAyZA;AACA,UA1ZA,kBA0ZA,MA1ZA,EA0ZA;AACA;AACA,4BADA;AAEA;AACA;AACA,OAJA;;AAMA;AACA,KAlaA;AAmaA;;;AAGA,kCAtaA,4CAsaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OATA;AAUA,KAnbA;;AAqbA;;;AAGA,yBAxbA,iCAwbA,MAxbA,EAwbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SANA;;AAQA,KAjcA,EA/BA,E;;;;AAoeA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAhCA;;AAkCA;;AAEA;;;AAGA;AACA;AACA,eADA;AAEA,oBAFA;AAGA,0BAHA;;AAKA,C;;;;;;;;;;;;;AC9jBA;AAAA;AAAA;AAAA;AAAopC,CAAgB,8mCAAG,EAAC,C;;;;;;;;;;;ACAxqC;AACA,OAAO,KAAU,EAAE,kBAKd","file":"pages/index/index.js","sourcesContent":["import 'uni-pages';\nimport Vue from 'vue'\nimport Page from './pages/index/index.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./index.vue?vue&type=template&id=57280228&\"\nvar renderjs\nimport script from \"./index.vue?vue&type=script&lang=js&\"\nexport * from \"./index.vue?vue&type=script&lang=js&\"\nimport style0 from \"./index.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pages/index/index.vue\"\nexport default component.exports","export * from \"-!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=template&id=57280228&\"","var components\ntry {\n components = {\n uIcon: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-icon/u-icon\" */ \"uview-ui/components/u-icon/u-icon.vue\"\n )\n },\n uRow: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-row/u-row\" */ \"uview-ui/components/u-row/u-row.vue\"\n )\n },\n uCol: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-col/u-col\" */ \"uview-ui/components/u-col/u-col.vue\"\n )\n },\n uSlider: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-slider/u-slider\" */ \"uview-ui/components/u-slider/u-slider.vue\"\n )\n },\n uNumberBox: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-number-box/u-number-box\" */ \"uview-ui/components/u-number-box/u-number-box.vue\"\n )\n },\n uButton: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-button/u-button\" */ \"uview-ui/components/u-button/u-button.vue\"\n )\n },\n uModal: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-modal/u-modal\" */ \"uview-ui/components/u-modal/u-modal.vue\"\n )\n },\n uToast: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-toast/u-toast\" */ \"uview-ui/components/u-toast/u-toast.vue\"\n )\n }\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n if (!_vm._isMounted) {\n _vm.e0 = function($event) {\n _vm.stopBluetoothDevicesDiscovery, (_vm.show = false)\n }\n }\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view >\r\n\t\r\n\t <view class=\"content\" v-if=\"!connected\">\r\n\t\t\t<u-icon class=\"logo\" size=\"300\" color=\"#808080\" @click=\"scanDevice\" name=\"scan\"></u-icon>\r\n\t\t\t<view class=\"text-area\">\r\n\t\t\t\t<text class=\"title\">{{title}}</text>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t\r\n\t\t\r\n\t\t<view v-else style=\"margin-top: 300rpx;padding-left: 10px;\">\r\n\t\t\t<u-row gutter=\"16\">\r\n\t\t\t\t<u-col span=\"7\">\r\n\t\t\t\t<view ><u-slider :height=\"20\" @end=\"kiTovalue\" v-model=\"valueki\" step=\"10\"></u-slider></view>\r\n\t\t\t\t</u-col>\r\n\t\t\t\t<u-col span=\"4\" offset=\"1\">\r\n\t\t\t\t<u-number-box v-model=\"value\" :min=\"0\" :max=\"10\" @change=\"valueToki\"/>\r\n\t\t\t\t</u-col>\r\n\t\t\t</u-row>\r\n\t\t\t<u-row gutter=\"16\" >\r\n\t\t\t\t<u-col span=\"3\">\r\n\t\t\t\t<u-button plain size=\"mini\" type=\"success\" @click=\"sendValue\">确认发送</u-button>\r\n\t\t\t\t</u-col>\r\n\t\t\t\t<u-col span=\"3\">\r\n\t\t\t\t<u-button plain size=\"mini\" type=\"error\" @click=\"closeBLEConnection\">断开连接</u-button>\r\n\t\t\t\t</u-col>\r\n\t\t\t\t<u-col span=\"3\">\r\n\t\t\t\t<u-button plain size=\"mini\" type=\"warning\" @click=\"writeBLECharacteristicValueString('getd')\">获取开合度</u-button>\r\n\t\t\t\t\t\t</u-col>\r\n\t\t\t</u-row>\r\n\t\t\t\r\n\t\t</view>\r\n\t\t<u-modal @cancel='stopBluetoothDevicesDiscovery,show=false' title=\"提示\" content=\"未搜索到设备,是否继续搜索\" :show-cancel-button=\"true\" @confirm=\"continueSearch()\" v-model=\"searchLoad\" >\r\n\t\t</u-modal> \r\n\t\t<u-toast ref=\"uToast\" />\r\n\r\n\t</view>\r\n</template>\r\n\r\n<script> \r\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tsearchLoad:false,\r\n\t\t\t\tvalueki:0,\r\n\t\t\t\tvalue: 0,\r\n\t\t\t\ttitle: '扫描设备二维码',\r\n\t\t\t\tequipment: {},\r\n\t\t\t\tconnected: false,\r\n\t\t\t\tisStop: true,\r\n\t\t\t\tlist: [],\r\n\t\t\t\timei: '',\r\n\t\t\t\titem: [],\r\n\t\t\t\tidObject:{\r\n\t\t\t\t\tserviceId:'',\r\n\t\t\t\t\twriteId:'',\r\n\t\t\t\t\tnotifyId:'',\r\n\t\t\t\t},\r\n\t\t\t\ttimeSearch:null,\r\n\r\n\t\t\t};\r\n\t\t},\r\n\t\tonLoad() {\r\n\t\t\tthis.onBLEConnectionStateChange();\r\n\t\t},\r\n\t\tonUnload:function(){ \r\n\t\t if(this.timeSearch) { \r\n\t\t \tclearTimeout(this.timeSearch)\r\n\t\t this.timeSearch = null\r\n\t\t } \r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tkiTovalue(){\r\n\t\t\t\tthis.value=this.valueki/10\r\n\t\t\t},\r\n\t\t\tvalueToki(){\r\n\t\t\t\tthis.valueki=this.value*10\r\n\t\t\t},\r\n\t\t\tsendValue() {\r\n\t\t\t\tthis.writeBLECharacteristicValueString('vals'+this.value)\r\n\t\t\t},\r\n\t\t\tcontinueSearch(){\r\n\t\t\t\tclearTimeout(this.timeSearch)\r\n\t\t\t\tthis.timeSearch=setTimeout(() => {\r\n\t\t\t\t\tif(!this.searchLoad&&!this.connected){\r\n\t\t\t\t\t\tthis.searchLoad=true\r\n\t\t\t\t\t}\r\n\t\t\t\t}, 8000);\r\n\t\t\t\tuni.showToast({\r\n\t\t\t\t\ttitle: '搜索设备中...',\r\n\t\t\t\t\ticon: 'loading',\r\n\t\t\t\t\tduration: 8000\r\n\t\t\t\t});\r\n\t\t\t\tthis.startBluetoothDevicesDiscovery();\r\n\t\t\t},\r\n\t\t\tscanDevice() {\r\n\t\t\t\tuni.openBluetoothAdapter({\r\n\t\t\t\t\tsuccess: e => {\r\n\t\t\t\t\t\tvar that = this\r\n\t\t\t\t\t\tuni.scanCode({\r\n\t\t\t\t\t\t\tsuccess: function(res) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tlet str1 = res.result.replace(';', '');\r\n\t\t\t\t\t\t\t\tthat.imei = str1\r\n\t\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\t\ttitle: '搜索设备中...',\r\n\t\t\t\t\t\t\t\t\ticon: 'loading',\r\n\t\t\t\t\t\t\t\t\tduration: 8000\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\tthat.timeSearch=setTimeout(() => {\r\n\t\t\t\t\t\t\t\t\tif(!that.searchLoad&&!that.connected){\r\n\t\t\t\t\t\t\t\t\t\tthat.searchLoad=true\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}, 8000);\r\n\t\t\t\t\t\t\t\tthat.startBluetoothDevicesDiscovery();\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tfail: (res) => {\r\n\t\t\t\t\t\t\t\t/* this.$refs.uToast.show({\r\n\t\t\t\t\t\t\t\t\ttitle: '已取消',\r\n\t\t\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\t\t}) */\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.getBluetoothAdapterState();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\tconsole.log(e)\r\n\t\t\t\t\t\tconsole.log('初始化蓝牙失败,错误码:' + (e.errCode || e.errMsg));\r\n\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\tinitTypes(e.errCode, e.errMsg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * 初始化蓝牙设备\r\n\t\t\t */\r\n\t\t\topenBluetoothAdapter() {\r\n\t\t\t\tuni.openBluetoothAdapter({\r\n\t\t\t\t\tsuccess: e => {\r\n\t\t\t\t\t\tconsole.log('初始化蓝牙成功:' + e.errMsg);\r\n\t\t\t\t\t\tconsole.log(JSON.stringify(e));\r\n\t\t\t\t\t\tthis.isStop = false;\r\n\t\t\t\t\t\tthis.getBluetoothAdapterState();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\tconsole.log(e)\r\n\t\t\t\t\t\tconsole.log('初始化蓝牙失败,错误码:' + (e.errCode || e.errMsg));\r\n\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\tinitTypes(e.errCode, e.errMsg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 开始搜索蓝牙设备\r\n\t\t\t */\r\n\t\t\tstartBluetoothDevicesDiscovery() {\r\n\t\t\t\tuni.startBluetoothDevicesDiscovery({\r\n\t\t\t\t\tsuccess: e => {\r\n\t\t\t\t\t\tthis.onBluetoothDeviceFound();\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\tconsole.log('搜索蓝牙设备失败,错误码:' + e.errCode);\r\n\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 停止搜索蓝牙设备\r\n\t\t\t */\r\n\t\t\tstopBluetoothDevicesDiscovery(types) {\r\n\t\t\t\tclearTimeout(this.timeSearch)\r\n\t\t\t\tuni.stopBluetoothDevicesDiscovery({\r\n\t\t\t\t\tsuccess: e => {\r\n\t\t\t\t\t\tconsole.log('停止搜索蓝牙设备:' + e.errMsg);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\tconsole.log('停止搜索蓝牙设备失败,错误码:' + e.errCode);\r\n\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 发现外围设备\r\n\t\t\t */\r\n\t\t\tonBluetoothDeviceFound() {\r\n\t\t\t\tuni.onBluetoothDeviceFound(devices => {\r\n\t\t\t\t\t// this.$set(this.disabled, 3, false);\r\n\t\t\t\t\tthis.getBluetoothDevices();\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 获取在蓝牙模块生效期间所有已发现的蓝牙设备。包括已经和本机处于连接状态的设备。\r\n\t\t\t */\r\n\t\t\tgetBluetoothDevices() {\r\n\t\t\t\t//\tthis.list=[]\r\n\t\t\t\tlet that = this\r\n\t\t\t\tlet imei = that.imei\r\n\t\r\n\t\t\t\t\tuni.getBluetoothDevices({\r\n\t\t\t\t\t\tsuccess: res => {\r\n\t\t\t\t\t\t\tres.devices.forEach(device => {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!device.name.indexOf('tpsl04v-' + imei.substr(imei.length - 6))) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tuni.hideToast();\r\n\t\t\t\t\t\t\t\t\tthat.stopBluetoothDevicesDiscovery()\r\n\t\t\t\t\t\t\t\t\tthat.equipment = device;\r\n\t\t\t\t\t\t\t\t\tthat.createBLEConnection()\r\n\t\t\t\t\t\t\t\t\treturn\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t//that.list.push(device)\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\t\tconsole.log('获取蓝牙设备错误,错误码:' + e.errCode);\r\n\t\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 获取本机蓝牙适配器状态\r\n\t\t\t */\r\n\t\t\tgetBluetoothAdapterState() {\r\n\t\t\t\tconsole.log('--->');\r\n\t\t\t\tuni.getBluetoothAdapterState({\r\n\t\t\t\t\tsuccess: res => {\r\n\t\t\t\t\t\tconsole.log(JSON.stringify(res));\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\tconsole.log('获取本机蓝牙适配器状态失败,错误码:' + e.errCode);\r\n\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 连接低功耗蓝牙\r\n\t\t\t */\r\n\t\t\tcreateBLEConnection() {\r\n\r\n\t\t\t\tlet deviceId = this.equipment.deviceId;\r\n\t\t\t\tuni.showToast({\r\n\t\t\t\t\ttitle: '连接蓝牙...',\r\n\t\t\t\t\ticon: 'loading',\r\n\t\t\t\t\tduration: 99999\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (!this.connected) {\r\n\t\t\t\t\tuni.createBLEConnection({\r\n\t\t\t\t\t\tdeviceId,\r\n\t\t\t\t\t\tsuccess: res => {\r\n\t\t\t\t\t\t\t\tthis.connected = true;\r\n\t\t\t\t\t\t\t\tclearTimeout(this.timeSearch)\r\n\t\t\t\t\t\t\tconsole.log(res);\r\n\t\t\t\t\t\t\tconsole.log('连接蓝牙成功:' + res.errMsg);\r\n\t\t\t\t\t\t\t// 连接设备后断开搜索 并且不能搜索设备\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tuni.hideToast();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tuni.showToast({\r\n\t\t\t\t\t\t\t\ttitle: '连接成功',\r\n\t\t\t\t\t\t\t\ticon: 'success',\r\n\t\t\t\t\t\t\t\tduration: 2000\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t//\tthis.closeBLEConnection()\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.getBLEDeviceServices()\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\t\tuni.hideToast();\r\n\t\t\t\t\t\t/* \tuni.showToast({\r\n\t\t\t\t\t\t\t\ttitle: '连接错误',\r\n\t\t\t\t\t\t\t\ticon: 'error',\r\n\t\t\t\t\t\t\t\tduration: 2000\r\n\t\t\t\t\t\t\t}); */\r\n\t\t\t\t\t\t\tconsole.log('连接低功耗蓝牙失败,错误码:' + e.errCode);\r\n\t\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 断开与低功耗蓝牙设备的连接\r\n\t\t\t */\r\n\t\t\tcloseBLEConnection() {\r\n\t\t\t\tlet deviceId = this.equipment.deviceId;\r\n\t\t\t\tthis.connected = false\r\n\t\t\t\tuni.closeBLEConnection({\r\n\t\t\t\t\tdeviceId,\r\n\t\t\t\t\tsuccess: res => {\r\n\t\t\t\t\t\tconsole.log(res);\r\n\t\t\t\t\t\tconsole.log('断开低功耗蓝牙成功:' + res.errMsg);\r\n\t\t\t\t\t\tthis.equipment = {};\r\n\t\t\t\t\t\tthis.idObject={}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\tconsole.log('断开低功耗蓝牙成功,错误码:' + e.errCode);\r\n\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 获取所有服务\r\n\t\t\t */\r\n\t\t\tgetBLEDeviceServices() {\r\n\t\t\t\tlet deviceId = this.equipment.deviceId;\r\n\t\t\t\tuni.getBLEDeviceServices({\r\n\t\t\t\t\tdeviceId,\r\n\t\t\t\t\tsuccess: res => {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.list = res.services;\r\n\t\t\t\t\t\tthis.idObject = {};\r\n\t\t\t\t\t\tif (this.list.length <= 0) {\r\n\t\t\t\t\t\t\ttoast('获取服务失败,请重试!');\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.list.forEach(item => {\r\n\t\t\t\t\t\t\tthis.getBLEDeviceCharacteristics(item)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.maskShow = true;\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\tconsole.log('获取设备服务失败,错误码:' + e.errCode);\r\n\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 获取某个服务下的所有特征值\r\n\t\t\t */\r\n\t\t\tgetBLEDeviceCharacteristics(item) {\r\n\t\t\t\tlet deviceId = this.equipment.deviceId;\r\n\t\t\t\tlet serviceId = item.uuid;\r\n\t\t\t\tlet that = this\r\n\t\t\t\tlet write=''\r\n\t\t\t\tlet notify=''\r\n\t\t\t\tuni.getBLEDeviceCharacteristics({\r\n\t\t\t\t\tdeviceId,\r\n\t\t\t\t\tserviceId,\r\n\t\t\t\t\tsuccess: res => {\r\n\t\t\t\t\t\tthis.list = res.characteristics;\r\n\t\t\t\t\t\tif (this.list.length <= 0) {\r\n\t\t\t\t\t\t//\ttoast('获取特征值失败,请重试!');\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tthis.list.forEach(characteristic => {\r\n\t\t\t\t\t\t\t/* \tif (characteristic.properties.read) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tuni.readBLECharacteristicValue({\r\n\t\t\t\t\t\t\t\t\t\tdeviceId,\r\n\t\t\t\t\t\t\t\t\t\tserviceId,\r\n\t\t\t\t\t\t\t\t\t\tcharacteristicId: characteristic.uuid,\r\n\t\t\t\t\t\t\t\t\t\tsuccess: res => {\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('读取设备数据值成功read');\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(JSON.stringify(res));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\tfail(e) {\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('读取设备数据值失败,错误码:' + e.errCode);\r\n\t\t\t\t\t\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t} */\r\n\t\t\t\t\t\t\t\tif (characteristic.properties.write ) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\twrite=characteristic.uuid\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (characteristic.properties.notify || characteristic.properties.indicate) {\r\n\t\t\t\t\t\t\t\t\tnotify=characteristic.uuid\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\tif(write!==''&&notify!==''){\r\n\t\t\t\t\t\t\tthis.idObject={\r\n\t\t\t\t\t\t\t\tserviceId:serviceId,\r\n\t\t\t\t\t\t\t\twriteId:write,\r\n\t\t\t\t\t\t\t\tnotifyId:notify,\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconsole.log(this.idObject)\r\n\t\t\t\t\t\tuni.notifyBLECharacteristicValueChange({\r\n\t\t\t\t\t\t\t\t\t\tstate: true, // 启用 notify 功能\r\n\t\t\t\t\t\t\t\t\t\tdeviceId,\r\n\t\t\t\t\t\t\t\t\t\tserviceId,\r\n\t\t\t\t\t\t\t\t\t\tcharacteristicId: this.idObject.notifyId,\r\n\t\t\t\t\t\t\t\t\t\tsuccess(res) {\r\n\t\t\t\t\t\t\t\t\t\t\tthat.onBLECharacteristicValueChange()\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat.writeBLECharacteristicValueString('getd')\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\tfail(e) {\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('失败,错误码:' + e.errCode);\r\n\t\t\t\t\t\t\t\t\t\t\tif (e.errCode !== 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: e => {\r\n\t\t\t\t\t\tconsole.log('获取特征值失败,错误码:' + e.errCode);\r\n\t\t\t\t\t\tif (e.errCode !== 0) { \r\n\t\t\t\t\t\t\tinitTypes(e.errCode);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 监听低功耗蓝牙连接状态的改变事件。包括开发者主动连接或断开连接,设备丢失,连接异常断开等等\r\n\t\t\t */\r\n\t\t\tonBLEConnectionStateChange() {\r\n\t\t\t\tuni.onBLEConnectionStateChange(res => {\r\n\t\t\t\t\t// 该方法回调中可以用于处理连接意外断开等异常情况\r\n\t\t\t\t\tconsole.log(`蓝牙连接状态 -------------------------->`);\r\n\t\t\t\t\tconsole.log(JSON.stringify(res));\r\n\t\t\t\t\tif (!res.connected) {\r\n\t\t\t\t\t\tthis.connected=false\r\n\t\t\t\t\t\tconsole.log('断开低功耗蓝牙成功:');\r\n\t\t\t\t\t\tthis.equipment = {};\r\n\t\t\t\t\t\tthis.idObject={}\r\n\t\t\t\t\t\ttoast('已经断开当前蓝牙连接');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\twriteBLECharacteristicValueString(str) {\r\n\t\t\t\tconsole.log(str)\r\n\t\t\t\tlet deviceId = this.equipment.deviceId;\r\n\t\t\t\tlet serviceId = this.idObject.serviceId;\r\n\t\t\t\tlet characteristicId = this.idObject.writeId;\t\t\t\t\r\n\t\t\t\t// 向蓝牙设备发送16进制数据\r\n\t\t\t\tlet buffer = new ArrayBuffer(str.length);\r\n\t\t\t\tlet dataView = new DataView(buffer);\r\n\r\n\t\t\t\tfor (let i in str) {\r\n\t\t\t\t\tdataView.setUint8(i, str[i].charCodeAt() | 0);\r\n\t\t\t\t}\r\n\t\t\t\tuni.writeBLECharacteristicValue({\r\n\t\t\t\t\tdeviceId,\r\n\r\n\t\t\t\t\tserviceId,\r\n\t\t\t\t\t// 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取\r\n\t\t\t\t\tcharacteristicId,\r\n\t\t\t\t\tvalue: buffer,\r\n\t\t\t\t\tsuccess: function(res) {\r\n\t\t\t\t\t\tconsole.log(res);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfail: function(res) {\r\n\t\t\t\t\t\tconsole.log(res);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// ArrayBuffer转16进度字符串示例\r\n\t\t\tab2hex(buffer) {\r\n\t\t\t\tconst hexArr = Array.prototype.map.call(\r\n\t\t\t\t\tnew Uint8Array(buffer),\r\n\t\t\t\t\tfunction(bit) {\r\n\t\t\t\t\t\treturn ('00' + bit.toString(16)).slice(-2)\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t\treturn hexArr.join('')\r\n\t\t\t},\r\n\t\t\t/**\r\n\t\t\t * 监听低功耗蓝牙设备的特征值变化事件。必须先启用 notifyBLECharacteristicValueChange 接口才能接收到设备推送的 notification。\r\n\t\t\t */\r\n\t\t\tonBLECharacteristicValueChange() {\r\n\t\t\t\t// 必须在这里的回调才能获取\r\n\t\t\t\tlet that = this\r\n\t\t\t\tuni.onBLECharacteristicValueChange(function(res) {\r\n\t\t\t\t\tconsole.log(`characteristic ${res.characteristicId} has changed, now is ${res.value}`)\r\n\t\t\t\t\t// console.log(that.ab2hex(res.value))\r\n\t\t\t\t\tconsole.log(res)\r\n\t\t\t\t\tlet hex = new Uint8Array(res.value);\r\n\t\t\t\t\thex = String.fromCharCode.apply(null, hex);\r\n\t\t\t\t\tthat.value= parseInt(hex.replace('valve status: ', ''));\r\n\t\t\t\t\tthat.valueki=parseInt(hex.replace('valve status: ', ''))*10;\r\n\t\t\t\t\tconsole.log(that.value)\r\n\t\t\t\t})\r\n\t\t\t},\r\n\r\n\t\t\t/**\r\n\t\t\t * \t断开蓝牙模块\r\n\t\t\t */\r\n\t\t\tcloseBluetoothAdapter(OBJECT) {\r\n\t\t\t\tuni.closeBluetoothAdapter({\r\n\t\t\t\t\tsuccess: res => {\r\n\t\t\t\t\t\tconsole.log('断开蓝牙模块成功');\r\n\t\t\t\t\t\tthis.equipment = {};\r\n\t\t\t\t\t\tthis.idObject={}\r\n\t\t\t\t\t\ttoast('断开蓝牙模块');\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * 判断初始化蓝牙状态\r\n\t */\r\n\tfunction initTypes(code, errMsg) {\r\n\t\tswitch (code) {\r\n\t\t\tcase 10000:\r\n\t\t\t\tconsole.log('未初始化蓝牙适配器');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10001:\r\n\t\t\t\ttoast('未检测到蓝牙,请打开蓝牙重试!');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10002:\r\n\t\t\t\tconsole.log('没有找到指定设备');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10003:\r\n\t\t\t\tconsole.log('连接失败');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10004:\r\n\t\t\t\tconsole.log('没有找到指定服务');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10005:\r\n\t\t\t\tconsole.log('没有找到指定特征值');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10006:\r\n\t\t\t\tconsole.log('当前连接已断开');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10007:\r\n\t\t\t\tconsole.log('当前特征值不支持此操作');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10008:\r\n\t\t\t\tconsole.log('其余所有系统上报的异常');\r\n\t\t\t\tbreak;\r\n\t\t\tcase 10009:\r\n\t\t\t\tconsole.log('Android 系统特有,系统版本低于 4.3 不支持 BLE');\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.log(errMsg);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * 弹出框封装\r\n\t */\r\n\tfunction toast(content, showCancel = false) {\r\n\t\tuni.showModal({\r\n\t\t\ttitle: '提示',\r\n\t\t\tcontent,\r\n\t\t\tshowCancel\r\n\t\t});\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\tpage {\r\n\t\theight: 100%;\r\n\t\twidth: 100%;\r\n\t}\r\n\r\n\t.content {\r\n\t\tdisplay: flex;\r\n\t\twidth: 100%;\r\n\t\theight: 100%;\r\n\t\tflex-direction: column;\r\n\t\talign-items: center;\r\n\t\tjustify-content: center;\r\n\t}\r\n\r\n\t.logo {\r\n\t\t\r\n\t\tmargin: 0;\r\n\t\tpadding: 0;\r\n\t\tmargin-top: 300rpx;\r\n\t}\r\n\r\n\t.text-area {\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: center;\r\n\t}\r\n\r\n\t.title {\r\n\t\tfont-size: 36rpx;\r\n\t\tcolor: #8f8f94;\r\n\t}\r\n\t.u-row {\r\n\t\t\tmargin: 40rpx 0;\r\n\t\t}\r\n</style>\n","import mod from \"-!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--6-oneOf-1-2!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-3!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=style&index=0&lang=css&\"; export default mod; export * from \"-!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--6-oneOf-1-2!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-3!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=style&index=0&lang=css&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1618448227559\n var cssReload = require(\"D:/yin/develop/HBuilderX.3.0.7.20210123.full/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""}