(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/door-lock-module/door-lock-module"],{275:function(e,t,s){"use strict";(function(e,t){var n=s(4);s(26);n(s(25));var o=n(s(276));e.__webpack_require_UNI_MP_PLUGIN__=s,t(o.default)}).call(this,s(1)["default"],s(2)["createPage"])},276:function(e,t,s){"use strict";s.r(t);var n=s(277),o=s(279);for(var i in o)["default"].indexOf(i)<0&&function(e){s.d(t,e,(function(){return o[e]}))}(i);s(281);var u,a=s(36),r=Object(a["default"])(o["default"],n["render"],n["staticRenderFns"],!1,null,null,null,!1,n["components"],u);r.options.__file="pages/door-lock-module/door-lock-module.vue",t["default"]=r.exports},277:function(e,t,s){"use strict";s.r(t);var n=s(278);s.d(t,"render",(function(){return n["render"]})),s.d(t,"staticRenderFns",(function(){return n["staticRenderFns"]})),s.d(t,"recyclableRender",(function(){return n["recyclableRender"]})),s.d(t,"components",(function(){return n["components"]}))},278:function(e,t,s){"use strict";var n;s.r(t),s.d(t,"render",(function(){return o})),s.d(t,"staticRenderFns",(function(){return u})),s.d(t,"recyclableRender",(function(){return i})),s.d(t,"components",(function(){return n}));try{n={uNavbar:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-navbar/u-navbar")]).then(s.bind(null,383))},uSteps:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-steps/u-steps")]).then(s.bind(null,391))},uStepsItem:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-steps-item/u-steps-item")]).then(s.bind(null,399))},uButton:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-button/u-button")]).then(s.bind(null,292))},uPopup:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(s.bind(null,407))},"u-Input":function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u--input/u--input")]).then(s.bind(null,415))},uRadioGroup:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-radio-group/u-radio-group")]).then(s.bind(null,421))},uRadio:function(){return Promise.all([s.e("common/vendor"),s.e("uni_modules/uview-ui/components/u-radio/u-radio")]).then(s.bind(null,429))}}}catch(a){if(-1===a.message.indexOf("Cannot find module")||-1===a.message.indexOf(".vue"))throw a;console.error(a.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var o=function(){var e=this,t=e.$createElement;e._self._c},i=!1,u=[];o._withStripped=!0},279:function(e,t,s){"use strict";s.r(t);var n=s(280),o=s.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){s.d(t,e,(function(){return n[e]}))}(i);t["default"]=o.a},280:function(e,t,s){"use strict";(function(e){var n=s(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n(s(30)),i=n(s(32)),u={data:function(){return{powerNum:160,subType:null,uploadBtn:!1,uploadMsg:{testProjectId:e.getStorageSync("testProjectId"),deviceId:"",type:null},radiolist1:[{value:"通过",disabled:!1,powerRefs:!0},{value:"不通过",disabled:!1,powerRefs:!1}],show7:!1,flag:0,timer:null,signalNum:"",gatewayDeviceId:e.getStorageSync("gatewayDeviceId"),show:!1,current1:null,stepList:[{id:0,title:"测试信号",desc:"测试蓝牙设备信号值是否通过",error:!1},{id:1,title:"蓝牙测试开门",desc:"测试蓝牙进行门锁开门",error:!1},{id:2,title:"测试功率",desc:"验证功耗是否通过",error:!1}]}},methods:{changeInput:function(e){console.log(e)},leftClick:function(){var t=this,s=this.stepList.every((function(e){return 1==e.error}));console.log(s),s?(console.log("模态框"),e.hideLoading(),e.showModal({title:"温馨提示",content:"确定取消上传本次测试信息吗?",success:function(s){s.confirm&&(t.$u.toast("点击了确定"),t.flag=99,e.navigateBack({delta:1}))}})):e.navigateBack({delta:1})},testGateway:function(){var t=this;return(0,i.default)(o.default.mark((function s(){var n,i;return o.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return e.showLoading({mask:!0,title:"正在测试网关连接",icon:"none"}),s.next=3,e.$http.get("/api/v1/test/gateway/connection/".concat(t.gatewayDeviceId));case 3:n=s.sent,i=n.data,e.hideLoading(),1==i.data.isConnect?(t.flag=1,console.log("网关连接成功")):(console.log("网关连接失败"),t.$u.toast("网关连接失败"));case 7:case"end":return s.stop()}}),s)})))()},testSignal:function(t){var s=this;return(0,i.default)(o.default.mark((function n(){var i,u;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.showLoading({mask:!0,title:"正在测试信号",icon:"none"}),n.next=3,e.$http.post("/api/v1/test/bluetooth/checkSignal",t);case 3:i=n.sent,u=i.data,e.hideLoading(),1==u.data.isNormal?(s.current1=1,s.flag=2,console.log("信号测试成功")):(s.stepList[0].error=!0,console.log("信号测试失败"),s.$u.toast("信号测试失败"));case 7:case"end":return n.stop()}}),n)})))()},openDoor:function(){var t=this;return(0,i.default)(o.default.mark((function s(){var n,i;return o.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return e.showLoading({mask:!0,title:"蓝牙开门测试中",icon:"none"}),s.next=3,e.$http.post("/api/v1/test/bluetooth/openDoor",{deviceId:t.uploadMsg.deviceId});case 3:n=s.sent,i=n.data,e.hideLoading(),200==i.code?(t.current1=2,t.flag=3,t.show7=!0,console.log("开门成功")):(t.stepList[1].error=!0,console.log("开门失败"));case 7:case"end":return s.stop()}}),s)})))()},radioChange:function(e){console.log(e),e?(this.current1=3,this.show7=!1,this.flag=4):(this.stepList[2].error=!0,this.show7=!1)},uploadTest:function(){var t=this;return(0,i.default)(o.default.mark((function s(){var n,i;return o.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return e.showLoading({mask:!0,title:"正在上传本次测试结果",icon:"none"}),s.next=3,e.$http.post("/api/v1/test/testResult",t.uploadMsg);case 3:n=s.sent,i=n.data,e.hideLoading(),console.log(i),200==i.code?(e.$showMsg("上传成功"),setTimeout((function(){t.resetDevice()}),1500)):e.$showMsg("上传失败");case 8:case"end":return s.stop()}}),s)})))()},uploadTestMsg:function(){1!=this.flag&&0!=this.flag||(console.log("失败的案例"),console.log(this.uploadMsg),1==this.subType&&this.$set(this.uploadMsg,"subType",this.subType),this.$set(this.uploadMsg,"signalNum",this.signalNum),this.$set(this.uploadMsg,"status",0),this.$set(this.uploadMsg,"signalRes",!1),this.$set(this.uploadMsg,"doorOpenRes",!1),this.$set(this.uploadMsg,"powerRes",!1),this.uploadTest()),2==this.flag&&(1==this.subType&&this.$set(this.uploadMsg,"subType",this.subType),this.$set(this.uploadMsg,"signalNum",this.signalNum),this.$set(this.uploadMsg,"status",0),this.$set(this.uploadMsg,"signalRes",!0),this.$set(this.uploadMsg,"doorOpenRes",!1),this.$set(this.uploadMsg,"powerRes",!1),this.uploadTest()),3==this.flag&&(1==this.subType&&this.$set(this.uploadMsg,"subType",this.subType),this.$set(this.uploadMsg,"signalNum",this.signalNum),this.$set(this.uploadMsg,"status",0),this.$set(this.uploadMsg,"signalRes",!0),this.$set(this.uploadMsg,"doorOpenRes",!0),this.$set(this.uploadMsg,"powerRes",!1),this.uploadTest()),4==this.flag&&(1==this.subType&&this.$set(this.uploadMsg,"subType",this.subType),this.$set(this.uploadMsg,"signalNum",this.signalNum),this.$set(this.uploadMsg,"status",1),this.$set(this.uploadMsg,"signalRes",!0),this.$set(this.uploadMsg,"doorOpenRes",!0),this.$set(this.uploadMsg,"powerRes",!0),this.$set(this.uploadMsg,"powerNum",this.powerNum),console.log(this.uploadMsg),this.uploadTest())},resetDevice:function(){var t=this;return(0,i.default)(o.default.mark((function s(){var n,i;return o.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return e.showLoading({icon:"none",title:"正在重置设备"}),s.next=3,e.$http.post("/api/v1/test/bluetooth/resetDevice",{deviceId:t.uploadMsg.deviceId});case 3:n=s.sent,i=n.data,console.log(i),e.hideLoading(),200==i.code?(t.$u.toast("重置成功"),e.switchTab({url:"/pages/bluetooth/bluetooth"})):t.$u.toast("重置失败");case 8:case"end":return s.stop()}}),s)})))()}},onLoad:function(t){var s=this,n=JSON.parse(t.item);console.log(n),this.subType=n.subType,this.signalNum=n.signalNum,this.uploadMsg.deviceId=n.deviceId,this.uploadMsg.type=n.type;var o={testProjectId:e.getStorageSync("testProjectId"),deviceId:n.deviceId};this.testGateway().then((function(){1==s.flag&&s.testSignal(o).then((function(){2==s.flag&&s.openDoor().then((function(){}))}))}))}};t.default=u}).call(this,s(2)["default"])},281:function(e,t,s){"use strict";s.r(t);var n=s(282),o=s.n(n);for(var i in n)["default"].indexOf(i)<0&&function(e){s.d(t,e,(function(){return n[e]}))}(i);t["default"]=o.a},282:function(e,t,s){}},[[275,"common/runtime","common/vendor"]]]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/door-lock-module/door-lock-module.js.map