12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/cat-eye-test/cat-eye-test"],{206:function(e,t,n){"use strict";(function(e,t){var s=n(4);n(26);s(n(25));var o=s(n(207));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n(1)["default"],n(2)["createPage"])},207:function(e,t,n){"use strict";n.r(t);var s=n(208),o=n(210);for(var i in o)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(i);n(212);var a,u=n(36),r=Object(u["default"])(o["default"],s["render"],s["staticRenderFns"],!1,null,null,null,!1,s["components"],a);r.options.__file="pages/cat-eye-test/cat-eye-test.vue",t["default"]=r.exports},208:function(e,t,n){"use strict";n.r(t);var s=n(209);n.d(t,"render",(function(){return s["render"]})),n.d(t,"staticRenderFns",(function(){return s["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return s["recyclableRender"]})),n.d(t,"components",(function(){return s["components"]}))},209:function(e,t,n){"use strict";var s;n.r(t),n.d(t,"render",(function(){return o})),n.d(t,"staticRenderFns",(function(){return a})),n.d(t,"recyclableRender",(function(){return i})),n.d(t,"components",(function(){return s}));try{s={uNavbar:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-navbar/u-navbar")]).then(n.bind(null,383))},uSteps:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-steps/u-steps")]).then(n.bind(null,391))},uStepsItem:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-steps-item/u-steps-item")]).then(n.bind(null,399))},uButton:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-button/u-button")]).then(n.bind(null,292))},uModal:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-modal/u-modal")]).then(n.bind(null,310))},uPopup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(n.bind(null,407))},"u-Input":function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u--input/u--input")]).then(n.bind(null,415))},uRadioGroup:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-radio-group/u-radio-group")]).then(n.bind(null,421))},uRadio:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uview-ui/components/u-radio/u-radio")]).then(n.bind(null,429))}}}catch(u){if(-1===u.message.indexOf("Cannot find module")||-1===u.message.indexOf(".vue"))throw u;console.error(u.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,a=[];o._withStripped=!0},210:function(e,t,n){"use strict";n.r(t);var s=n(211),o=n.n(s);for(var i in s)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return s[e]}))}(i);t["default"]=o.a},211:function(e,t,n){"use strict";(function(e){var s=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=s(n(30)),i=s(n(32)),a={data:function(){return{signalNum:"",uploadBtn:!1,powerNum:160,uploadMsg:{testProjectId:e.getStorageSync("testProjectId"),deviceId:"",type:null},radiolist1:[{value:"通过",disabled:!1,powerRefs:!0},{value:"不通过",disabled:!1,powerRefs:!1}],show7:!1,flag:0,gatewayDeviceId:e.getStorageSync("gatewayDeviceId"),show1:!1,title:"温馨提示",content1:"系统已成功植入您的人脸,请问您的人脸验证是否通过",obj:{testProjectId:e.getStorageSync("testProjectId"),deviceId:""},show:!1,current1:null,timer: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("change",e)},radioChange:function(e){console.log(e),e?(this.current1=3,this.show7=!1,this.flag=6):(this.stepList[2].error=!0,this.show7=!1),this.show7=!1},pass:function(){this.current1=2,this.show1=!1,this.flag=5,this.show7=!0},noPass:function(){this.show1=!1,this.stepList[1].error=!0},uploadTest:function(){var t=this;return(0,i.default)(o.default.mark((function n(){var s,i;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/testResult",t.uploadMsg);case 3:s=n.sent,i=s.data,e.hideLoading(),console.log(i),200==i.code?(e.$showMsg("上传成功"),setTimeout((function(){t.resetDevice()}),1500)):e.$showMsg("上传失败");case 8:case"end":return n.stop()}}),n)})))()},resetDevice:function(){var t=this;return(0,i.default)(o.default.mark((function n(){var s,i;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.showLoading({mask:!0,icon:"none",title:"正在重置设备"}),n.next=3,e.$http.post("/api/v1/test/bluetooth/resetDevice",{deviceId:t.uploadMsg.deviceId});case 3:s=n.sent,i=s.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 n.stop()}}),n)})))()},uploadTestMsg:function(){console.log(this.uploadMsg),0!=this.flag&&1!=this.flag&&2!=this.flag||(this.$set(this.uploadMsg,"signalNum",this.signalNum),this.$set(this.uploadMsg,"status",0),this.$set(this.uploadMsg,"signalRes",!1),this.$set(this.uploadMsg,"faceOpenRes",!1),this.$set(this.uploadMsg,"powerRes",!1),this.uploadTest()),3!=this.flag&&4!=this.flag||(this.$set(this.uploadMsg,"signalNum",this.signalNum),this.$set(this.uploadMsg,"status",0),this.$set(this.uploadMsg,"signalRes",!0),this.$set(this.uploadMsg,"faceOpenRes",!1),this.$set(this.uploadMsg,"powerRes",!1),this.uploadTest()),5==this.flag&&(this.$set(this.uploadMsg,"signalNum",this.signalNum),this.$set(this.uploadMsg,"status",0),this.$set(this.uploadMsg,"signalRes",!0),this.$set(this.uploadMsg,"faceOpenRes",!0),this.$set(this.uploadMsg,"powerRes",!1),this.$set(this.uploadMsg,"powerNum",this.powerNum),console.log(this.uploadMsg),this.uploadTest()),6==this.flag&&(this.$set(this.uploadMsg,"signalNum",this.signalNum),this.$set(this.uploadMsg,"status",1),this.$set(this.uploadMsg,"signalRes",!0),this.$set(this.uploadMsg,"faceOpenRes",!0),this.$set(this.uploadMsg,"powerRes",!0),this.$set(this.uploadMsg,"powerNum",this.powerNum),console.log(this.uploadMsg),this.uploadTest())},leftClick:function(){var t=this,n=this.stepList.every((function(e){return 1==e.error}));console.log(n),n?(console.log("模态框"),e.hideLoading(),e.showModal({title:"温馨提示",content:"确定取消上传本次测试信息吗?",success:function(n){n.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 n(){var s,i;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.showLoading({title:"正在测试网关连接",icon:"none"}),n.next=3,e.$http.get("/api/v1/test/gateway/connection/".concat(t.gatewayDeviceId));case 3:s=n.sent,i=s.data,e.hideLoading(),1==i.data.isConnect?(t.flag=1,console.log("网关连接成功")):(console.log("网关连接失败"),t.$u.toast("网关连接失败"));case 7:case"end":return n.stop()}}),n)})))()},testSignal:function(){var t=this;return(0,i.default)(o.default.mark((function n(){var s,i;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.obj);case 3:s=n.sent,i=s.data,e.hideLoading(),1==i.data.isNormal?(t.current1=1,t.flag=3,console.log("信号测试成功")):t.$u.toast("信号测试失败");case 7:case"end":return n.stop()}}),n)})))()},faceHas:function(){var t=this;return(0,i.default)(o.default.mark((function n(){var s,i;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.get("/api/v1/test/user/".concat(e.getStorageSync("userId"),"/hasUploadFace"));case 3:s=n.sent,i=s.data,e.hideLoading(),!0===i.data.hasUploadFace?(console.log("人脸已上传"),t.flag=2):t.$u.toast("人脸未上传,请去我的页面上传人脸");case 7:case"end":return n.stop()}}),n)})))()},uploadFace:function(){var t=this;return(0,i.default)(o.default.mark((function n(){var s,i;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/addTestFaceToCam",{userId:e.getStorageSync("userId"),deviceId:t.obj.deviceId});case 3:s=n.sent,i=s.data,e.hideLoading(),200===i.code?(t.show1=!0,console.log("植入成功"),e.showToast({duration:1500,title:"人脸植入成功",icon:"none"}),t.show1=!0,t.flag=4):(t.$u.toast("人脸植入失败"),console.log("人脸上传失败"),t.stepList[1].error=!0);case 7:case"end":return n.stop()}}),n)})))()}},onLoad:function(e){var t=this;console.log(111);var n=JSON.parse(e.item);console.log(n),this.signalNum=n.signalNum,this.obj.deviceId=n.deviceId,this.uploadMsg.deviceId=n.deviceId,this.uploadMsg.type=n.type,this.testGateway().then((function(){1==t.flag&&t.faceHas().then((function(){2==t.flag&&t.testSignal().then((function(){3==t.flag&&t.uploadFace()}))}))}))}};t.default=a}).call(this,n(2)["default"])},212:function(e,t,n){"use strict";n.r(t);var s=n(213),o=n.n(s);for(var i in s)["default"].indexOf(i)<0&&function(e){n.d(t,e,(function(){return s[e]}))}(i);t["default"]=o.a},213:function(e,t,n){}},[[206,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/cat-eye-test/cat-eye-test.js.map
|