(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/yq-avatar/yq-avatar"],{360:function(t,i,e){"use strict";e.r(i);var s=e(361),h=e(363);for(var a in h)["default"].indexOf(a)<0&&function(t){e.d(i,t,(function(){return h[t]}))}(a);e(365);var n,r=e(32),o=Object(r["default"])(h["default"],s["render"],s["staticRenderFns"],!1,null,null,null,!1,s["components"],n);o.options.__file="components/yq-avatar/yq-avatar.vue",i["default"]=o.exports},361:function(t,i,e){"use strict";e.r(i);var s=e(362);e.d(i,"render",(function(){return s["render"]})),e.d(i,"staticRenderFns",(function(){return s["staticRenderFns"]})),e.d(i,"recyclableRender",(function(){return s["recyclableRender"]})),e.d(i,"components",(function(){return s["components"]}))},362:function(t,i,e){"use strict";var s;e.r(i),e.d(i,"render",(function(){return h})),e.d(i,"staticRenderFns",(function(){return n})),e.d(i,"recyclableRender",(function(){return a})),e.d(i,"components",(function(){return s}));var h=function(){var t=this,i=t.$createElement,e=(t._self._c,t.__get_style([t.iS]));t.$mp.data=Object.assign({},{$root:{s0:e}})},a=!1,n=[];h._withStripped=!0},363:function(t,i,e){"use strict";e.r(i);var s=e(364),h=e.n(s);for(var a in s)["default"].indexOf(a)<0&&function(t){e.d(i,t,(function(){return s[t]}))}(a);i["default"]=h.a},364:function(t,i,e){"use strict";(function(t){var s=e(4);Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var h=s(e(56)),a=s(e(58));function n(t,i){var e="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=r(t))||i&&t&&"number"===typeof t.length){e&&(t=e);var s=0,h=function(){};return{s:h,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:h}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,n=!0,o=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return n=t.done,t},e:function(t){o=!0,a=t},f:function(){try{n||null==e.return||e.return()}finally{if(o)throw a}}}}function r(t,i){if(t){if("string"===typeof t)return o(t,i);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?o(t,i):void 0}}function o(t,i){(null==i||i>t.length)&&(i=t.length);for(var e=0,s=new Array(i);e=0){var o=r[1].trim().split(" ");for(var l in o)o[l]&&o[l].toString().indexOf("upx")>=0&&(o[l]=parseFloat(o[l])*this.pxRatio+"px");r[1]=o.join(" ")}h[r[0].trim()]=r[1].trim()}}}catch(p){a.e(p)}finally{a.f()}this.iS=h}this.expWidth&&(this.eW=this.expWidth.toString().indexOf("upx")>=0?parseInt(this.expWidth)*this.pxRatio:parseInt(this.expWidth)),this.expHeight&&(this.eH=this.expHeight.toString().indexOf("upx")>=0?parseInt(this.expHeight)*this.pxRatio:parseInt(this.expHeight)),"flex"===this.sD&&this.fDrawInit(!0),this.fHideImg()},fSelect:function(){var i=this;this.fSelecting||(this.fSelecting=!0,setTimeout((function(){i.fSelecting=!1}),500),t.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){t.showLoading({title:"加载中...",mask:!0});var s=i.imgPath=e.tempFilePaths[0];t.getImageInfo({src:s,success:function(e){if(i.imgWidth=e.width,i.imgHeight=e.height,i.path=s,!i.hasSel){var h=i.sS||{};if(!i.selWidth||!i.selHeight)return void t.showModal({title:"裁剪框的宽或高没有设置",showCancel:!1});var a=i.selWidth.toString().indexOf("upx")>=0?parseInt(i.selWidth)*i.pxRatio:parseInt(i.selWidth),n=i.selHeight.toString().indexOf("upx")>=0?parseInt(i.selHeight)*i.pxRatio:parseInt(i.selHeight);h.width=a+"px",h.height=n+"px",h.top=(i.wH-n-c|0)/2+"px",h.left=(i.wW-a|0)/2+"px",i.sS=h}i.noBar?i.fDrawInit(!0):t.hideTabBar({complete:function(){i.fDrawInit(!0)}})},fail:function(){t.showToast({title:"请选择正确图片",duration:2e3})},complete:function(){t.hideLoading()}})}}))},fUpload:function(){var i=this;if(!this.fUploading){this.fUploading=!0,setTimeout((function(){i.fUploading=!1}),1e3);var e=this.sS,s=parseInt(e.left),h=parseInt(e.top),a=parseInt(e.width),n=parseInt(e.height),r=this.eW||a*this.pixelRatio,o=this.eH||n*this.pixelRatio;t.showLoading({title:"加载中...",mask:!0}),this.sD="none",this.sT="-10000px",this.hasSel=!1,this.fHideImg(),t.canvasToTempFilePath({x:s,y:h,width:a,height:n,destWidth:r,destHeight:o,canvasId:"avatar-canvas",fileType:this.fType,quality:this.qlty,success:function(t){t=t.tempFilePath,i.$emit("upload",{avatar:i.imgSrc,path:t,index:i.indx,data:i.rtn,base64:i.base64||null})},fail:function(i){t.showToast({title:"error1",duration:2e3})},complete:function(){t.hideLoading(),i.noBar||t.showTabBar(),i.$emit("end")}},this)}},fPrvUpload:function(){var i=this;if(!this.fPrvUploading){this.fPrvUploading=!0,setTimeout((function(){i.fPrvUploading=!1}),1e3);var e=this.sS,s=(parseInt(e.width),parseInt(e.height),this.prvX),h=this.prvY,a=this.prvWidth,n=this.prvHeight,r=this.eW||parseInt(e.width)*this.pixelRatio,o=this.eH||parseInt(e.height)*this.pixelRatio;t.showLoading({title:"加载中...",mask:!0}),this.sD="none",this.sT="-10000px",this.hasSel=!1,this.fHideImg(),t.canvasToTempFilePath({x:s,y:h,width:a,height:n,destWidth:r,destHeight:o,canvasId:"prv-canvas",fileType:this.fType,quality:this.qlty,success:function(t){t=t.tempFilePath,i.$emit("upload",{avatar:i.imgSrc,path:t,index:i.indx,data:i.rtn,base64:i.base64||null})},fail:function(){t.showToast({title:"error_prv",duration:2e3})},complete:function(){t.hideLoading(),i.noBar||t.showTabBar(),i.$emit("end")}},this)}},fDrawInit:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.wW,s=this.wH,h=this.imgWidth,a=this.imgHeight,n=h/a,r=e-40,o=s-c-80,l=r/o,p=parseInt(this.sS.width),f=parseInt(this.sS.height);switch(this.fixWidth=0,this.fixHeight=0,this.lckWidth=0,this.lckHeight=0,this.stc){case"x":this.fixWidth=1;break;case"y":this.fixHeight=1;break;case"long":n>1?this.fixWidth=1:this.fixHeight=1;break;case"short":n>1?this.fixHeight=1:this.fixWidth=1;break;case"longSel":p>f?this.fixWidth=1:this.fixHeight=1;break;case"shortSel":p>f?this.fixHeight=1:this.fixWidth=1;break}switch(this.lck){case"x":this.lckWidth=1;break;case"y":this.lckHeight=1;break;case"long":n>1?this.lckWidth=1:this.lckHeight=1;break;case"short":n>1?this.lckHeight=1:this.lckWidth=1;break;case"longSel":p>f?this.lckWidth=1:this.lckHeight=1;break;case"shortSel":p>f?this.lckHeight=1:this.lckWidth=1;break}this.fixWidth?(r=p,o=r/n):this.fixHeight?(o=f,r=o*n):n0&&void 0!==arguments[0]?arguments[0]:void 0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(i){var s=i.selWidth,h=i.selHeight,a=i.expWidth,n=i.expHeight,r=i.quality,o=i.canRotate,l=i.canScale,p=i.minScale,f=i.maxScale,u=i.stretch,d=i.fileType,g=i.inner,v=i.lock;a&&(this.eW=a.toString().indexOf("upx")>=0?parseInt(a)*this.pxRatio:parseInt(a)),n&&(this.eH=n.toString().indexOf("upx")>=0?parseInt(n)*this.pxRatio:parseInt(n)),this.letRotate=!1===o||!0===g||"true"===g||"false"===o?0:1,this.letScale=!1===l||"false"===l?0:1,this.qlty=parseFloat(r)||1,this.mnScale=parseFloat(p)||.3,this.mxScale=parseFloat(f)||4,this.stc=u,this.isin=!0===g||"true"===g?1:0,this.fType="jpg"===d?"jpg":"png",this.lck=v,this.isin||!this.letRotate?(this.bW="24%",this.bD="none"):(this.bW="19%",this.bD="flex"),s&&h&&(s=s.toString().indexOf("upx")>=0?parseInt(s)*this.pxRatio:parseInt(s),h=h.toString().indexOf("upx")>=0?parseInt(h)*this.pxRatio:parseInt(h),this.sS.width=s+"px",this.sS.height=h+"px",this.sS.top=(this.wH-h-c|0)/2+"px",this.sS.left=(this.wW-s|0)/2+"px",this.hasSel=!0)}this.rtn=e,this.indx=t,this.fSelect()},fRotate:function(){this.rotateDeg+=90-this.rotateDeg%90,this.fDrawImage()},fStart:function(t){var i=t.touches,e=i[0],s=i[1];if(this.touch0=e,this.touch1=s,s){var h=s.x-e.x,a=s.y-e.y;this.fgDistance=Math.sqrt(h*h+a*a)}},fMove:function(t){var i=t.touches,e=i[0],s=i[1];if(s){var h=s.x-e.x,a=s.y-e.y,n=Math.sqrt(h*h+a*a),r=.005*(n-this.fgDistance),o=this.scaleSize+r;do{if(!this.letScale)break;if(othis.mxScale)break;var c=this.useWidth*r/2,l=this.useHeight*r/2;if(this.isin){var p=this.useWidth*o,f=this.useHeight*o,u=(this.posWidth,this.posHeight,parseInt(this.sS.left)),d=parseInt(this.sS.top),g=parseInt(this.sS.width),v=parseInt(this.sS.height),x=u+g,m=d+v,w=void 0,S=void 0;if(p<=g||f<=v)break;this.cx=w=this.focusX*o-this.focusX,this.cy=S=this.focusY*o-this.focusY,this.posWidth-=c,this.posHeight-=l,this.posWidth-w>u&&(this.posWidth=u+w),this.posWidth+p-wd&&(this.posHeight=d+S),this.posHeight+f-SO-y?this.posWidth=Y-k+y:(this.posWidth=W,this.focusX-=I)),!this.lckHeight&&Math.abs(H)<100&&(qM-T?(this.focusY-=z+T-(this.posHeight+R),this.posHeight=z-R+T):(this.posHeight=b,this.focusY-=H))}else Math.abs(I)<100&&!this.lckWidth&&(this.posWidth=W),Math.abs(H)<100&&!this.lckHeight&&(this.posHeight=b),this.focusX-=I,this.focusY-=H;this.touch0=e,this.fDrawImage()}},fEnd:function(t){var i=t.touches,e=i&&i[0];i&&i[1];e?this.touch0=e:(this.touch0=null,this.touch1=null)},fHideImg:function(){this.prvImg="",this.pT="-10000px",this.sO=!0,this.prvImgData=null,this.target=null},fClose:function(){this.sD="none",this.sT="-10000px",this.hasSel=!1,this.fHideImg(),this.noBar||t.showTabBar(),this.$emit("end")},fGetImgData:function(){var i=this;return new Promise((function(e,s){var h=i.prvX,a=i.prvY,n=i.prvWidth,r=i.prvHeight;t.canvasGetImageData({canvasId:"prv-canvas",x:h,y:a,width:n,height:r,success:function(t){e(t.data)},fail:function(t){s(t)}},i)}))},fColorChange:function(i){var e=this;return(0,a.default)(h.default.mark((function s(){var a,n,r,o,c,l,p,f,u,d,g,v,x,m,w,S,I,H,W,b,y,T,k,R,D,P,O;return h.default.wrap((function(s){while(1)switch(s.prev=s.next){case 0:if(a=Date.now(),!(a-e.prvTm<100)){s.next=3;break}return s.abrupt("return");case 3:if(e.prvTm=a,t.showLoading({title:"加载中...",mask:!0}),e.prvImgData){s.next=11;break}return s.next=8,e.fGetImgData().catch((function(){t.showToast({title:"error_read",duration:2e3})}));case 8:if(e.prvImgData=s.sent){s.next=10;break}return s.abrupt("return");case 10:e.target=new Uint8ClampedArray(e.prvImgData.length);case 11:if(n=e.prvImgData,r=e.target,o=i.detail.value,0===o)r=n;else for(o=(o+100)/200,o<.005&&(o=0),o>.995&&(o=1),y=n.length-1;y>=0;y-=4)c=n[y-3]/255,l=n[y-2]/255,p=n[y-1]/255,S=Math.max(c,l,p),w=Math.min(c,l,p),v=S-w,S===w?u=0:S===c&&l>=p?u=(l-p)/v*60:S===c&&l.5&&(d=v/(2-2*g)),n[y]&&(f=n[y]),o<.5?d=d*o/.5:o>.5&&(d=2*d+2*o-d*o/.5-1),0===d?c=l=p=Math.round(255*g):(g<.5?m=g*(1+d):g>=.5&&(m=g+d-g*d),x=2*g-m,I=u/360,H=I+1/3,W=I,b=I-1/3,T=function(t){return t<0?t+1:t>1?t-1:t},k=function(t){return t<1/6?x+6*(m-x)*t:t>=1/6&&t<.5?m:t>=.5&&t<2/3?x+6*(m-x)*(2/3-t):x},c=H=Math.round(255*k(T(H))),l=W=Math.round(255*k(T(W))),p=b=Math.round(255*k(T(b)))),f&&(r[y]=f),r[y-3]=c,r[y-2]=l,r[y-1]=p;R=e.prvX,D=e.prvY,P=e.prvWidth,O=e.prvHeight,t.canvasPutImageData({canvasId:"prv-canvas",x:R,y:D,width:P,height:O,data:r,fail:function(){t.showToast({title:"error_put",duration:2e3})},complete:function(){t.hideLoading()}},e);case 15:case"end":return s.stop()}}),s)})))()},btop:function(t){return this.base64=t,new Promise((function(i,e){var s=t.split(","),h=s[0].match(/:(.*?);/)[1],a=atob(s[1]),n=a.length,r=new Uint8Array(n);while(n--)r[n]=a.charCodeAt(n);return i((window.URL||window.webkitURL).createObjectURL(new Blob([r],{type:h})))}))}}};i.default=l}).call(this,e(2)["default"])},365:function(t,i,e){"use strict";e.r(i);var s=e(366),h=e.n(s);for(var a in s)["default"].indexOf(a)<0&&function(t){e.d(i,t,(function(){return s[t]}))}(a);i["default"]=h.a},366:function(t,i,e){}}]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/components/yq-avatar/yq-avatar.js.map ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([ 'components/yq-avatar/yq-avatar-create-component', { 'components/yq-avatar/yq-avatar-create-component':(function(module, exports, __webpack_require__){ __webpack_require__('2')['createComponent'](__webpack_require__(360)) }) }, [['components/yq-avatar/yq-avatar-create-component']] ]);