(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uni_modules/bcode-camera/components/bcode-camera/bcode-camera"],{"165f":function(t,e,n){"use strict";(function(t){var a=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=a(n("7eb4")),o=a(n("ee10")),c={props:{tipsText:{type:String,default:"请靠近取景框"},color:{type:String,default:"rgba(36, 64, 135, 0.8)"}},data:function(){return{devicePosition:"back",cameraSrc:"",canvasW:0,canvasH:0,pageWidth:0,frameOptions:{},phoneSafeArea:!1}},mounted:function(){var e=this;t.getSystemInfo({success:function(t){t.safeAreaInsets.bottom&&(e.phoneSafeArea=!0)}}),this.$nextTick((function(){var n=t.createSelectorQuery().in(e);n.select("#frameDom").boundingClientRect((function(t){e.frameOptions=t,console.log("得到布局位置信息"+JSON.stringify(t))})).exec();var a=t.getSystemInfoSync();e.pageWidth=a.windowWidth}))},methods:{onCancel:function(){this.cameraSrc=""},onConfirm:function(){this.$emit("onConfirm",{url:this.cameraSrc})},takePhoto:function(){var e=this,n=t.createCameraContext();n.takePhoto({quality:"high",selfieMirror:!0,success:function(){var t=(0,o.default)(i.default.mark((function t(n){return i.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.cropImage(n.tempImagePath);case 2:e.cameraSrc=t.sent;case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),fail:function(){t.showToast({title:"拍照失败，请重试",icon:"none"})}})},cropImage:function(e){var n=this;return new Promise((function(a,i){t.getImageInfo({src:e,success:function(e){n.frameOptions.width,n.frameOptions.height,n.frameOptions.top,n.frameOptions.left;var o=t.createCanvasContext("myCanvas",n);n.canvasW=e.width,n.canvasH=e.height;e.width,n.pageWidth;o.save(),o.drawImage(e.path,0,0,e.width,e.height),o.restore(),o.draw(!0,(function(){setTimeout((function(){t.canvasToTempFilePath({x:0,y:0,width:e.width,height:e.width,destWidth:e.width,destHeight:e.width,canvasId:"myCanvas",fileType:"png",quality:1,success:function(t){a(t.tempFilePath)},fail:function(t){i(t)}},n)}),500)}))},fail:function(t){i(t)}})}))},saveImageToPhone:function(e){t.saveImageToPhotosAlbum({filePath:e,success:function(){t.showToast({icon:"none",title:"拍照成功"})}})},onDevicePosition:function(){this.devicePosition="back"==this.devicePosition?"front":"back"},onChangeError:function(t){console.error("camera报错：",t.detail)}},computed:{dynamicStyle:function(){return{"--theme-color":this.color}}}};e.default=c}).call(this,n("df3c")["default"])},"303b":function(t,e,n){"use strict";n.r(e);var a=n("165f"),i=n.n(a);for(var o in a)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(o);e["default"]=i.a},"498c":function(t,e,n){},"71b4":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var a=function(){var t=this.$createElement;this._self._c},i=[]},acbe:function(t,e,n){"use strict";n.r(e);var a=n("71b4"),i=n("303b");for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("bb44");var c=n("828b"),r=Object(c["a"])(i["default"],a["b"],a["c"],!1,null,"1ed53447",null,!1,a["a"],void 0);e["default"]=r.exports},bb44:function(t,e,n){"use strict";var a=n("498c"),i=n.n(a);i.a}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    'uni_modules/bcode-camera/components/bcode-camera/bcode-camera-create-component',
    {
        'uni_modules/bcode-camera/components/bcode-camera/bcode-camera-create-component':(function(module, exports, __webpack_require__){
            __webpack_require__('df3c')['createComponent'](__webpack_require__("acbe"))
        })
    },
    [['uni_modules/bcode-camera/components/bcode-camera/bcode-camera-create-component']]
]);
