(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/face-bio-assay/face-bio-assay"],{333:function(e,t,n){"use strict";n.r(t);var o=n(334),c=n(336);for(var a in c)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return c[e]}))}(a);n(339);var s,i=n(32),l=Object(i["default"])(c["default"],o["render"],o["staticRenderFns"],!1,null,"bbde6278",null,!1,o["components"],s);l.options.__file="components/face-bio-assay/face-bio-assay.vue",t["default"]=l.exports},334:function(e,t,n){"use strict";n.r(t);var o=n(335);n.d(t,"render",(function(){return o["render"]})),n.d(t,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(t,"components",(function(){return o["components"]}))},335:function(e,t,n){"use strict";var o;n.r(t),n.d(t,"render",(function(){return c})),n.d(t,"staticRenderFns",(function(){return s})),n.d(t,"recyclableRender",(function(){return a})),n.d(t,"components",(function(){return o}));var c=function(){var e=this,t=e.$createElement;e._self._c},a=!1,s=[];c._withStripped=!0},336:function(e,t,n){"use strict";n.r(t);var o=n(337),c=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=c.a},337:function(e,t,n){"use strict";(function(e,o){var c=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=c(n(56)),s=c(n(58)),i={name:"face-detect",data:function(){return{device:"front",show:!1,tipsText:"",isSuccess:!1,face:{},actionsList:null,context:"",tipsTextCss:"tipsTextCss",listener:null,VKSession:null,isFace:null,loadingState:null,QHimg:"",photoimg:"",clooseimg:"",backImg:n(338),faceImg:"",tipsList:[{id:1,imgPath:"https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/0667c02c3a464a1098d1fa040b922a2d.png",text:"光线充足",className:"line"},{id:3,imgPath:"https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/ae3846b0acd04bc791e3f8117ae8677a.png",text:"不要化妆",className:"brush"},{id:4,imgPath:"https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/9077a2a4695a4e5ea171bf777c53459d.png",text:"不戴眼镜",className:"glasses"},{id:5,imgPath:"https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/1fa444eb992c42e6b77b8d148550336c.png",text:"不戴帽子",className:"hat"}]}},props:{buildActionContainer:Function,actions:Function,hasSwitch:!1,isDev:!1,navbarTitle:String,isShowNavbar:!0,top:String},onLoad:function(){},onUnload:function(){this.VKSession.destroy()},mounted:function(){},methods:{onNavBack:function(){console.log("返回"),this.$emit("onBack")},onLoadReset:function(){this.initData()},createdVKSession:function(){var t=this;e.showLoading({title:"相机加载中"});this.context=e.createCameraContext(),this.listener=this.context.onCameraFrame((function(e){})),this.VKSession=o.createVKSession({version:"v1",track:{plane:{mode:1},face:{mode:2}}}),this.VKSession.start((function(e){e?(console.log("初始化失败",e),t.$u.toast("相机加载失败"),t.loadingState=!1,t.show=!0,setTimeout((function(){t.QHimg="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/f5dd3ef3f3bc49a48aec330c43e638da.png",t.clooseimg="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/2ef369bc619e4098b091cf7fefe26ecb.png",t.faceImg="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/d8565c6b51404b4996820083d684a111.png",t.photoimg="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/de6c268fcced49069c3f75ad0f2eb5be.png"}),800)):(console.log("初始化成功",e),t.$u.toast("相机加载成功"),t.loadingState=!0,t.show=!0,setTimeout((function(){t.QHimg="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/f5dd3ef3f3bc49a48aec330c43e638da.png",t.clooseimg="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/2ef369bc619e4098b091cf7fefe26ecb.png",t.faceImg="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/d8565c6b51404b4996820083d684a111.png",t.photoimg="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/knowledge/202412/de6c268fcced49069c3f75ad0f2eb5be.png"}),800))})),this.listener.start()},detectFace:function(e){return(0,s.default)(a.default.mark((function t(){return a.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:console.warn(e.data);case 1:case"end":return t.stop()}}),t)})))()},onGetPhoto:function(){var e=this;this.listener.stop(),this.context.takePhoto({quality:"high",success:function(t){e.compressImage(t.tempImagePath)},fail:function(e){console.log(e)},complete:function(e){console.log(e)}})},closeImage:function(){var t=this;console.log("选择相片"),e.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album"],success:function(e){console.log("选择的图片地址",e.tempFilePaths[0]),t.VKSession.destroy(),t.compressImage(e.tempFilePaths[0])},fail:function(e){console.log("选择图片失败",e.errMsg)}})},deviceQH:function(){console.log("点击切换"),this.device="back"==this.device?"front":"back"},error:function(){},stop:function(){},cameraError:function(e){var t=this;this.t=setTimeout((function(){clearTimeout(t.t),t.hideModal(),t.$emit("detectFailed",e)}),2e3)},close:function(){clearTimeout(this.t),this.hideModal(),this.$emit("detectFailed")},hideModal:function(){e.stopFaceDetect(),this.face={},this.isSuccess=!1},compressImage:function(t){var n=this;e.compressImage({src:t,quality:80,success:function(e){var t=e.tempFilePath;console.log("压缩后的图片路径:",t),n.$emit("photoChange",t)},fail:function(e){console.error(e)}})},takePhoto:function(){this.context.takePhoto({quality:"high",success:function(e){that.compressImage(e.tempImagePath)},fail:function(e){console.log(e)},complete:function(e){console.log(e)}})},detectOver:function(){var e=this;this.isSuccess=!0;var t=setTimeout((function(){e.hideModal(),clearTimeout(t),e.$emit("detectOver")}),3e3)},initData:function(){var t=this;e.getSetting({success:function(e){!0===e.authSetting["scope.camera"]?t.createdVKSession():!1===e.authSetting["scope.camera"]?t.getCameraAuth():t.createdVKSession()}})},getCameraAuth:function(){var t=this;e.showModal({title:"温馨提示",content:"需要获取您摄像头权限才能更好的为您服务!是否授权摄像头权限?",confirmText:"授权",confirmColor:"#f94218",success:function(n){n.confirm?e.openSetting({success:function(e){e.authSetting["scope.camera"]?t.createdVKSession():(t.tipsText="您未授权摄像头权限",t.cameraError("noAuth"))}}):n.cancel&&(t.tipsText="您未授权摄像头权限",t.cameraError("noAuth"))}})},showData:function(e){if(this.$emit("showData",e),this.isDev){var t=e.faceInfo[0].angleArray;this.face=t}}}};t.default=i}).call(this,n(2)["default"],n(1)["default"])},339:function(e,t,n){"use strict";n.r(t);var o=n(340),c=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=c.a},340:function(e,t,n){}}]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/components/face-bio-assay/face-bio-assay.js.map ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([ 'components/face-bio-assay/face-bio-assay-create-component', { 'components/face-bio-assay/face-bio-assay-create-component':(function(module, exports, __webpack_require__){ __webpack_require__('2')['createComponent'](__webpack_require__(333)) }) }, [['components/face-bio-assay/face-bio-assay-create-component']] ]);