| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-product-addGoods-addGoodDetils~pages-product-addGoods-index~pages-product-addGoods-modifyPrice","pages-product-addGoods-secound"],{"111a":function(t,i,e){"use strict";e.d(i,"b",(function(){return s})),e.d(i,"c",(function(){return a})),e.d(i,"a",(function(){}));var s=function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("v-uni-view",[e("v-uni-image",{staticClass:"my-avatar",style:[t.iS],attrs:{src:t.imgSrc.imgSrc},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.fSelect.apply(void 0,arguments)}}}),e("v-uni-canvas",{staticClass:"my-canvas",style:{top:t.sT,height:t.csH},attrs:{"canvas-id":"avatar-canvas",id:"avatar-canvas","disable-scroll":"false"}}),e("v-uni-canvas",{staticClass:"oper-canvas",style:{top:t.sT,height:t.csH},attrs:{"canvas-id":"oper-canvas",id:"oper-canvas","disable-scroll":"false"},on:{touchstart:function(i){arguments[0]=i=t.$handleEvent(i),t.fStart.apply(void 0,arguments)},touchmove:function(i){arguments[0]=i=t.$handleEvent(i),t.fMove.apply(void 0,arguments)},touchend:function(i){arguments[0]=i=t.$handleEvent(i),t.fEnd.apply(void 0,arguments)}}}),e("v-uni-canvas",{staticClass:"prv-canvas",style:{height:t.csH,top:t.pT},attrs:{"canvas-id":"prv-canvas",id:"prv-canvas","disable-scroll":"false"},on:{touchstart:function(i){arguments[0]=i=t.$handleEvent(i),t.fHideImg.apply(void 0,arguments)}}}),e("v-uni-view",{staticClass:"oper-wrapper",style:{display:t.sD,top:t.tp}},[e("v-uni-view",{staticClass:"oper"},[t.sO?e("v-uni-view",{staticClass:"btn-wrapper"},[e("v-uni-view",{style:{width:t.bW},attrs:{"hover-class":"hover"},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.fSelect.apply(void 0,arguments)}}},[e("v-uni-text",[t._v("重选")])],1),e("v-uni-view",{style:{width:t.bW},attrs:{"hover-class":"hover"},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.fClose.apply(void 0,arguments)}}},[e("v-uni-text",[t._v("关闭")])],1),e("v-uni-view",{style:{width:t.bW,display:t.bD},attrs:{"hover-class":"hover"},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.fRotate.apply(void 0,arguments)}}},[e("v-uni-text",[t._v("旋转")])],1),e("v-uni-view",{style:{width:t.bW},attrs:{"hover-class":"hover"},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.fPreview.apply(void 0,arguments)}}},[e("v-uni-text",[t._v("预览")])],1),e("v-uni-view",{style:{width:t.bW},attrs:{"hover-class":"hover"},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.fUpload.apply(void 0,arguments)}}},[e("v-uni-text",[t._v("上传")])],1)],1):e("v-uni-view",{staticClass:"clr-wrapper"},[e("v-uni-slider",{staticClass:"my-slider",attrs:{"block-size":"25",value:"0",min:"-100",max:"100",activeColor:"red",backgroundColor:"green","block-color":"grey","show-value":!0},on:{change:function(i){arguments[0]=i=t.$handleEvent(i),t.fColorChange.apply(void 0,arguments)}}}),e("v-uni-view",{style:{width:t.bW},attrs:{"hover-class":"hover"},on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.fPrvUpload.apply(void 0,arguments)}}},[e("v-uni-text",[t._v("上传")])],1)],1)],1)],1)],1)},a=[]},3471:function(t,i,e){"use strict";e("6a54"),Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(t,i){var e="undefined"!==typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=(0,s.default)(t))||i&&t&&"number"===typeof t.length){e&&(t=e);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:n}}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 o,h=!0,r=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return h=t.done,t},e:function(t){r=!0,o=t},f:function(){try{h||null==e["return"]||e["return"]()}finally{if(r)throw o}}}},e("01a2"),e("e39c"),e("bf0f"),e("844d"),e("18f7"),e("de6c"),e("7a76"),e("c9b5");var s=function(t){return t&&t.__esModule?t:{default:t}}(e("5d6b"))},"57a6":function(t,i,e){"use strict";e("6a54");var s=e("f5bd").default;Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var a=s(e("2634")),n=s(e("2fdc")),o=s(e("3471"));e("e838"),e("e966"),e("0c26"),e("5ef2"),e("c9b5"),e("bf0f"),e("ab80"),e("4db2"),e("9480"),e("4d8f"),e("7b97"),e("668a"),e("c5b7"),e("8ff5"),e("2378"),e("641a"),e("64e0"),e("cce3"),e("efba"),e("d009"),e("bd7d"),e("7edd"),e("d798"),e("f547"),e("5e54"),e("b60a"),e("8c18"),e("12973"),e("f991"),e("198e"),e("8557"),e("63b1"),e("1954"),e("1cf1"),e("5c47"),e("2c10"),e("15d1"),e("d5c6"),e("5a56"),e("f074"),e("c976"),e("18f7"),e("de6c"),e("dc89"),e("2425");var h={name:"yq-avatar",data:function(){return{csH:"0px",sD:"none",sT:"-10000px",pT:"-10000px",iS:{},sS:{},sO:!0,bW:"19%",bD:"flex",tp:0,imgSrc:{imgSrc:""}}},watch:{avatarSrc:function(){this.imgSrc.imgSrc=this.avatarSrc}},props:{avatarSrc:"",avatarStyle:"",selWidth:"",selHeight:"",expWidth:"",expHeight:"",minScale:"",maxScale:"",canScale:"",canRotate:"",lockWidth:"",lockHeight:"",stretch:"",lock:"",fileType:"",noTab:"",inner:"",quality:"",index:"",bgImage:""},created:function(){var t=this;this.cc=uni.createCanvasContext("avatar-canvas",this),this.cco=uni.createCanvasContext("oper-canvas",this),this.ccp=uni.createCanvasContext("prv-canvas",this),this.qlty=parseFloat(this.quality)||1,this.imgSrc.imgSrc=this.avatarSrc,this.letRotate=!1===this.canRotate||!0===this.inner||"true"===this.inner||"false"===this.canRotate?0:1,this.letScale=!1===this.canScale||"false"===this.canScale?0:1,this.isin=!0===this.inner||"true"===this.inner?1:0,this.indx=this.index||void 0,this.mnScale=parseFloat(this.minScale)||.3,this.mxScale=parseFloat(this.maxScale)||4,this.noBar=!0===this.noTab||"true"===this.noTab?1:0,this.stc=this.stretch,this.lck=this.lock,this.fType="jpg"===this.fileType?"jpg":"png",this.isin||!this.letRotate?(this.bW="24%",this.bD="none"):(this.bW="19%",this.bD="flex"),this.noBar?this.fWindowResize():uni.showTabBar({fail:function(){t.noBar=1},success:function(){t.noBar=0},complete:function(i){t.fWindowResize()}})},methods:{fWindowResize:function(){var t=uni.getSystemInfoSync();this.platform=t.platform,this.wW=t.windowWidth,this.drawTop=t.windowTop,this.wH=t.windowHeight,this.noBar||(this.wH+=50),this.csH=this.wH-50+"px",this.tp=this.csH,this.tp=t.windowTop+parseInt(this.csH)+"px",this.pxRatio=this.wW/750;var i=this.avatarStyle;if(i&&!0!==i&&(i=i.trim())){i=i.split(";");var e,s={},a=(0,o.default)(i);try{for(a.s();!(e=a.n()).done;){var n=e.value;if(n){if(n=n.trim().split(":"),n[1].toString().indexOf("upx")>=0){var h=n[1].trim().split(" ");for(var r in h)h[r]&&h[r].toString().indexOf("upx")>=0&&(h[r]=parseFloat(h[r])*this.pxRatio+"px");n[1]=h.join(" ")}s[n[0].trim()]=n[1].trim()}}}catch(c){a.e(c)}finally{a.f()}this.iS=s}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 t=this;this.fSelecting||(this.fSelecting=!0,setTimeout((function(){t.fSelecting=!1}),500),uni.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(i){uni.showLoading({title:"加载中...",mask:!0});var e=t.imgPath=i.tempFilePaths[0],s=i.tempFiles[0].name;!s&&e&&(s=e.split("/"),s=s[s.length-1]),uni.getImageInfo({src:e,success:function(i){if(t.imgWidth=i.width,t.imgHeight=i.height,t.path=e,!t.hasSel){var a=t.sS||{};if(!t.selWidth||!t.selHeight)return void uni.showModal({title:"裁剪框的宽或高没有设置",showCancel:!1});var n=t.selWidth.toString().indexOf("upx")>=0?parseInt(t.selWidth)*t.pxRatio:parseInt(t.selWidth),o=t.selHeight.toString().indexOf("upx")>=0?parseInt(t.selHeight)*t.pxRatio:parseInt(t.selHeight);a.width=n+"px",a.height=o+"px",a.top=(t.wH-o-50|0)/2+"px",a.left=(t.wW-n|0)/2+"px",t.sS=a}t.noBar?t.fDrawInit(!0):uni.hideTabBar({complete:function(){t.fDrawInit(!0)}}),t.$emit("getName",s)},fail:function(){uni.showToast({title:"请选择正确图片",duration:2e3})},complete:function(){uni.hideLoading()}})}}))},fUpload:function(){var t=this;if(!this.fUploading){this.fUploading=!0,setTimeout((function(){t.fUploading=!1}),1e3);var i=this.sS,e=parseInt(i.left),s=parseInt(i.top),a=parseInt(i.width),n=parseInt(i.height),o=this.eW||a*this.pixelRatio,h=this.eH||n*this.pixelRatio;uni.showLoading({title:"加载中...",mask:!0}),this.sD="none",this.sT="-10000px",this.hasSel=!1,this.fHideImg(),uni.canvasToTempFilePath({x:e,y:s,width:a,height:n,destWidth:o,destHeight:h,canvasId:"avatar-canvas",fileType:this.fType,quality:this.qlty,success:function(i){i=i.tempFilePath,t.btop(i).then((function(i){t.$emit("upload",{avatar:t.imgSrc,path:i,index:t.indx,data:t.rtn,base64:t.base64||null})}))},fail:function(t){uni.showToast({title:"error1",duration:2e3})},complete:function(){uni.hideLoading(),t.noBar||uni.showTabBar(),t.$emit("end")}},this)}},fPrvUpload:function(){var t=this;if(!this.fPrvUploading){this.fPrvUploading=!0,setTimeout((function(){t.fPrvUploading=!1}),1e3);var i=this.sS,e=(parseInt(i.width),parseInt(i.height),this.prvX),s=this.prvY,a=this.prvWidth,n=this.prvHeight,o=this.eW||parseInt(i.width)*this.pixelRatio,h=this.eH||parseInt(i.height)*this.pixelRatio;uni.showLoading({title:"加载中...",mask:!0}),this.sD="none",this.sT="-10000px",this.hasSel=!1,this.fHideImg(),uni.canvasToTempFilePath({x:e,y:s,width:a,height:n,destWidth:o,destHeight:h,canvasId:"prv-canvas",fileType:this.fType,quality:this.qlty,success:function(i){i=i.tempFilePath,t.btop(i).then((function(i){t.$emit("upload",{avatar:t.imgSrc,path:i,index:t.indx,data:t.rtn,base64:t.base64||null})}))},fail:function(){uni.showToast({title:"error_prv",duration:2e3})},complete:function(){uni.hideLoading(),t.noBar||uni.showTabBar(),t.$emit("end")}},this)}},fDrawInit:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.wW,s=this.wH,a=this.imgWidth,n=this.imgHeight,o=a/n,h=e-40,r=s-50-80,c=h/r,l=parseInt(this.sS.width),d=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":o>1?this.fixWidth=1:this.fixHeight=1;break;case"short":o>1?this.fixHeight=1:this.fixWidth=1;break;case"longSel":l>d?this.fixWidth=1:this.fixHeight=1;break;case"shortSel":l>d?this.fixHeight=1:this.fixWidth=1;break}switch(this.lck){case"x":this.lckWidth=1;break;case"y":this.lckHeight=1;break;case"long":o>1?this.lckWidth=1:this.lckHeight=1;break;case"short":o>1?this.lckHeight=1:this.lckWidth=1;break;case"longSel":l>d?this.lckWidth=1:this.lckHeight=1;break;case"shortSel":l>d?this.lckHeight=1:this.lckWidth=1;break}this.fixWidth?(h=l,r=h/o):this.fixHeight?(r=d,h=r*o):o<c?n<r?(h=a,r=n):h=r*o:a<h?(h=a,r=n):r=h/o,this.isin&&(h<l&&(h=l,r=h/o,this.lckHeight=0),r<d&&(r=d,h=r*o,this.lckWidth=0)),this.scaleSize=1,this.rotateDeg=0,this.posWidth=(e-h)/2|0,this.posHeight=(s-r-50)/2|0,this.useWidth=0|h,this.useHeight=0|r,this.centerX=this.posWidth+h/2,this.centerY=this.posHeight+r/2,this.focusX=0,this.focusY=0;var u=this.sS,f=parseInt(u.left),p=parseInt(u.top),v=parseInt(u.width),g=parseInt(u.height),w=(this.canvas,this.canvasOper,this.cc,this.cco);w.beginPath(),w.setLineWidth(3),w.setGlobalAlpha(1),w.setStrokeStyle("white"),w.strokeRect(f,p,v,g),w.setFillStyle("black"),w.setGlobalAlpha(.5),w.fillRect(0,0,this.wW,p),w.fillRect(0,p,f,g),w.fillRect(0,p+g,this.wW,this.wH-g-p-50),w.fillRect(f+v,p,this.wW-v-f,g),w.setGlobalAlpha(1),w.setStrokeStyle("red"),w.moveTo(f+15,p),w.lineTo(f,p),w.lineTo(f,p+15),w.moveTo(f+v-15,p),w.lineTo(f+v,p),w.lineTo(f+v,p+15),w.moveTo(f+15,p+g),w.lineTo(f,p+g),w.lineTo(f,p+g-15),w.moveTo(f+v-15,p+g),w.lineTo(f+v,p+g),w.lineTo(f+v,p+g-15),w.stroke(),w.draw(!1,(function(){i&&(t.sD="flex",t.sT=t.drawTop+"px",t.fDrawImage(!0))})),this.$emit("init")},fDrawImage:function(){var t=Date.now();if(!(t-this.drawTm<20)){this.drawTm=t;var i=this.cc,e=this.useWidth*this.scaleSize,s=this.useHeight*this.scaleSize;if(this.bgImage?i.drawImage(this.bgImage,0,0,this.wW,this.wH-50):i.fillRect(0,0,this.wW,this.wH-50),this.isin){var a=this.focusX*(this.scaleSize-1),n=this.focusY*(this.scaleSize-1);i.translate(this.centerX,this.centerY),i.rotate(this.rotateDeg*Math.PI/180),i.drawImage(this.imgPath,this.posWidth-this.centerX-a,this.posHeight-this.centerY-n,e,s)}else i.translate(this.posWidth+e/2,this.posHeight+s/2),i.rotate(this.rotateDeg*Math.PI/180),i.drawImage(this.imgPath,-e/2,-s/2,e,s);i.draw(!1)}},fPreview:function(){var t=this;if(!this.fPreviewing){this.fPreviewing=!0,setTimeout((function(){t.fPreviewing=!1}),1e3);var i=this.sS,e=parseInt(i.left),s=parseInt(i.top),a=parseInt(i.width),n=parseInt(i.height);uni.showLoading({title:"加载中...",mask:!0}),uni.canvasToTempFilePath({x:e,y:s,width:a,height:n,expWidth:a*this.pixelRatio,expHeight:n*this.pixelRatio,canvasId:"avatar-canvas",fileType:this.fType,quality:this.qlty,success:function(i){t.prvImgTmp=i=i.tempFilePath;var e=t.ccp,s=t.wW,a=parseInt(t.csH),n=parseInt(t.sS.width),o=parseInt(t.sS.height),h=s-40,r=a-80,c=h/n,l=o*c;l<r?(n=h,o=l):(c=r/o,n*=c,o=r),e.fillRect(0,0,s,a),t.prvX=s=(s-n)/2|0,t.prvY=a=(a-o)/2|0,t.prvWidth=n|=0,t.prvHeight=o|=0,e.drawImage(i,s,a,n,o),e.draw(!1),t.btop(i).then((function(i){t.sO=!1,t.pT=t.drawTop+"px"})),t.sO=!1,t.pT=t.drawTop+"px"},fail:function(){uni.showToast({title:"error2",duration:2e3})},complete:function(){uni.hideLoading()}},this)}},fChooseImg:function(){var t=arguments.length>0&&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,a=i.selHeight,n=i.expWidth,o=i.expHeight,h=i.quality,r=i.canRotate,c=i.canScale,l=i.minScale,d=i.maxScale,u=i.stretch,f=i.fileType,p=i.inner,v=i.lock;n&&(this.eW=n.toString().indexOf("upx")>=0?parseInt(n)*this.pxRatio:parseInt(n)),o&&(this.eH=o.toString().indexOf("upx")>=0?parseInt(o)*this.pxRatio:parseInt(o)),this.letRotate=!1===r||!0===p||"true"===p||"false"===r?0:1,this.letScale=!1===c||"false"===c?0:1,this.qlty=parseFloat(h)||1,this.mnScale=parseFloat(l)||.3,this.mxScale=parseFloat(d)||4,this.stc=u,this.isin=!0===p||"true"===p?1:0,this.fType="jpg"===f?"jpg":"png",this.lck=v,this.isin||!this.letRotate?(this.bW="24%",this.bD="none"):(this.bW="19%",this.bD="flex"),s&&a&&(s=s.toString().indexOf("upx")>=0?parseInt(s)*this.pxRatio:parseInt(s),a=a.toString().indexOf("upx")>=0?parseInt(a)*this.pxRatio:parseInt(a),this.sS.width=s+"px",this.sS.height=a+"px",this.sS.top=(this.wH-a-50|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 a=s.x-e.x,n=s.y-e.y;this.fgDistance=Math.sqrt(a*a+n*n)}},fMove:function(t){var i=t.touches,e=i[0],s=i[1];if(s){var a=s.x-e.x,n=s.y-e.y,o=Math.sqrt(a*a+n*n),h=.005*(o-this.fgDistance),r=this.scaleSize+h;do{if(!this.letScale)break;if(r<this.mnScale)break;if(r>this.mxScale)break;var c=this.useWidth*h/2,l=this.useHeight*h/2;if(this.isin){var d,u,f=this.useWidth*r,p=this.useHeight*r,v=(this.posWidth,this.posHeight,parseInt(this.sS.left)),g=parseInt(this.sS.top),w=parseInt(this.sS.width),x=parseInt(this.sS.height),m=v+w,b=g+x;if(f<=w||p<=x)break;this.cx=d=this.focusX*r-this.focusX,this.cy=u=this.focusY*r-this.focusY,this.posWidth-=c,this.posHeight-=l,this.posWidth-d>v&&(this.posWidth=v+d),this.posWidth+f-d<m&&(this.posWidth=m-f+d),this.posHeight-u>g&&(this.posHeight=g+u),this.posHeight+p-u<b&&(this.posHeight=b-p+u)}else this.posWidth-=c,this.posHeight-=l;this.scaleSize=r}while(0);this.fgDistance=o,s.x!==e.x&&this.letRotate&&(a=(this.touch1.y-this.touch0.y)/(this.touch1.x-this.touch0.x),n=(s.y-e.y)/(s.x-e.x),this.rotateDeg+=180*Math.atan((n-a)/(1+a*n))/Math.PI,this.touch0=e,this.touch1=s),this.fDrawImage()}else if(this.touch0){var y=e.x-this.touch0.x,S=e.y-this.touch0.y,I=this.posWidth+y,T=this.posHeight+S;if(this.isin){var H,W,k=this.useWidth*this.scaleSize,D=this.useHeight*this.scaleSize,R=I,M=T,P=R+k,O=M+D,C=parseInt(this.sS.left),z=parseInt(this.sS.top),E=C+parseInt(this.sS.width),F=z+parseInt(this.sS.height);this.cx=H=this.focusX*this.scaleSize-this.focusX,this.cy=W=this.focusY*this.scaleSize-this.focusY,!this.lckWidth&&Math.abs(y)<100&&(C<R-H?this.posWidth=C+H:E>P-H?this.posWidth=E-k+H:(this.posWidth=I,this.focusX-=y)),!this.lckHeight&&Math.abs(S)<100&&(z<M-W?(this.focusY-=z+W-this.posHeight,this.posHeight=z+W):F>O-W?(this.focusY-=F+W-(this.posHeight+D),this.posHeight=F-D+W):(this.posHeight=T,this.focusY-=S))}else Math.abs(y)<100&&!this.lckWidth&&(this.posWidth=I),Math.abs(S)<100&&!this.lckHeight&&(this.posHeight=T),this.focusX-=y,this.focusY-=S;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||uni.showTabBar(),this.$emit("end")},fGetImgData:function(){var t=this;return new Promise((function(i,e){var s=t.prvX,a=t.prvY,n=t.prvWidth,o=t.prvHeight;uni.canvasGetImageData({canvasId:"prv-canvas",x:s,y:a,width:n,height:o,success:function(t){i(t.data)},fail:function(t){e(t)}},t)}))},fColorChange:function(t){var i=this;return(0,n.default)((0,a.default)().mark((function e(){var s,n,o,h,r,c,l,d,u,f,p,v,g,w,x,m,b,y,S,I,T,H,W,k,D,R,M;return(0,a.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(s=Date.now(),!(s-i.prvTm<100)){e.next=3;break}return e.abrupt("return");case 3:if(i.prvTm=s,uni.showLoading({title:"加载中...",mask:!0}),i.prvImgData){e.next=11;break}return e.next=8,i.fGetImgData().catch((function(){uni.showToast({title:"error_read",duration:2e3})}));case 8:if(i.prvImgData=e.sent){e.next=10;break}return e.abrupt("return");case 10:i.target=new Uint8ClampedArray(i.prvImgData.length);case 11:if(n=i.prvImgData,o=i.target,h=t.detail.value,0===h)o=n;else for(h=(h+100)/200,h<.005&&(h=0),h>.995&&(h=1),T=n.length-1;T>=0;T-=4)r=n[T-3]/255,c=n[T-2]/255,l=n[T-1]/255,m=Math.max(r,c,l),x=Math.min(r,c,l),v=m-x,m===x?u=0:m===r&&c>=l?u=(c-l)/v*60:m===r&&c<l?u=(c-l)/v*60+360:m===c?u=(l-r)/v*60+120:m===l&&(u=(r-c)/v*60+240),p=(m+x)/2,0===p||m===x?f=0:0<p&&p<=.5?f=v/(2*p):p>.5&&(f=v/(2-2*p)),n[T]&&(d=n[T]),h<.5?f=f*h/.5:h>.5&&(f=2*f+2*h-f*h/.5-1),0===f?r=c=l=Math.round(255*p):(p<.5?w=p*(1+f):p>=.5&&(w=p+f-p*f),g=2*p-w,b=u/360,y=b+1/3,S=b,I=b-1/3,H=function(t){return t<0?t+1:t>1?t-1:t},W=function(t){return t<1/6?g+6*(w-g)*t:t>=1/6&&t<.5?w:t>=.5&&t<2/3?g+6*(w-g)*(2/3-t):g},r=y=Math.round(255*W(H(y))),c=S=Math.round(255*W(H(S))),l=I=Math.round(255*W(H(I)))),d&&(o[T]=d),o[T-3]=r,o[T-2]=c,o[T-1]=l;k=i.prvX,D=i.prvY,R=i.prvWidth,M=i.prvHeight,uni.canvasPutImageData({canvasId:"prv-canvas",x:k,y:D,width:R,height:M,data:o,fail:function(){uni.showToast({title:"error_put",duration:2e3})},complete:function(){uni.hideLoading()}},i);case 15:case"end":return e.stop()}}),e)})))()},btop:function(t){return this.base64=t,new Promise((function(i,e){var s=t.split(","),a=s[0].match(/:(.*?);/)[1],n=atob(s[1]),o=n.length,h=new Uint8Array(o);while(o--)h[o]=n.charCodeAt(o);return i((window.URL||window.webkitURL).createObjectURL(new Blob([h],{type:a})))}))}}};i.default=h},"826cb":function(t,i,e){"use strict";var s=e("8ba8"),a=e.n(s);a.a},"8ba8":function(t,i,e){var s=e("d17f");s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);var a=e("967d").default;a("8c2b23e6",s,!0,{sourceMap:!1,shadowMode:!1})},c25d:function(t,i,e){"use strict";e("6a54");var s=e("f5bd").default;Object.defineProperty(i,"__esModule",{value:!0}),i.ActionSheet=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#000000";return new Promise((function(e,s){uni.showActionSheet({itemList:t,itemColor:i,success:function(t){e(t.tapIndex)},fail:function(t){s(t.errMsg)}})}))},i.Authorize=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"scope.userInfo";return new Promise((function(i,e){uni.authorize({scope:t,success:function(t){i(t)},fail:function(t){e(t)}})}))},i.GetUserInfo=function(){return new Promise((function(t,i){uni.getUserInfo({success:function(i){t(i)},fail:function(t){i(t)}})}))},i.Loading=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"正在加载...",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};uni.showLoading((0,n.default)({title:t,mask:!0},i))},i.Modal=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"提示",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"这是一个模态弹窗!";return new Promise((function(e,s){uni.showModal({title:t,content:i,success:function(t){t.confirm&&e(),t.cancel&&s()}})}))},i.ScrollTo=function(t){uni.pageScrollTo({scrollTop:t,duration:300})},i.Toast=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:800,a=(0,n.default)({title:t,duration:s,position:"center",mask:!0,icon:i||"none"},e);uni.showToast(a)},i.chooseImage=function(t){return new Promise((function(i,e){uni.chooseImage({count:t,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(t){i(t)},fail:function(t){e(t)}})}))},i.clearStorage=function(){try{uni.clearStorageSync()}catch(t){throw new Error("处理失败")}},i.convertObj=o,i.formatDate=h,i.getQuarterStartDate=function(){var t=new Date(l,function(){var t=0;c<3&&(t=0);2<c&&c<6&&(t=3);5<c&&c<9&&(t=6);c>8&&(t=9);return t}(),1);return h(t,"yyyy-MM-dd")},i.getStorage=function(t){var i=uni.getStorageSync(t);try{"number"!=typeof JSON.parse(i)&&(i=JSON.parse(i))}catch(e){}return i},i.hideLoading=function(){try{uni.hideLoading()}catch(t){throw new Error("处理失败")}},i.navigateBack=function(t){uni.navigateBack({delta:t})},i.navigateTo=function(t,i,e){var s=i,a="navigateTo";switch(s=e?s+"?"+o(e):s,t){case 1:a="navigateTo";break;case 2:a="redirectTo";break;case 3:a="reLaunch";break;case 4:a="switchTab";break;default:a="navigateTo";break}uni[a]({url:s,animationType:"slide-in-right",animationDuration:200})},i.pathToBase64=function(t){return new Promise((function(i,e){if("object"===("undefined"===typeof window?"undefined":(0,a.default)(window))&&"document"in window){if("function"===typeof FileReader){var s=new XMLHttpRequest;return s.open("GET",t,!0),s.responseType="blob",s.onload=function(){if(200===this.status){var t=new FileReader;t.onload=function(t){i(t.target.result)},t.onerror=e,t.readAsDataURL(this.response)}},s.onerror=e,void s.send()}var n=document.createElement("canvas"),o=n.getContext("2d"),h=new Image;return h.onload=function(){n.width=h.width,n.height=h.height,o.drawImage(h,0,0),i(n.toDataURL()),n.height=n.width=0},h.onerror=e,void(h.src=t)}"object"!==("undefined"===typeof plus?"undefined":(0,a.default)(plus))?"object"===("undefined"===typeof wx?"undefined":(0,a.default)(wx))&&wx.canIUse("getFileSystemManager")?wx.getFileSystemManager().readFile({filePath:t,encoding:"base64",success:function(t){i("data:image/png;base64,"+t.data)},fail:function(t){e(t)}}):e(new Error("not support")):plus.io.resolveLocalFileSystemURL(getLocalFilePath(t),(function(t){t.file((function(t){var s=new plus.io.FileReader;s.onload=function(t){i(t.target.result)},s.onerror=function(t){e(t)},s.readAsDataURL(t)}),(function(t){e(t)}))}),(function(t){e(t)}))}))},i.removeStorage=function(t){t&&uni.removeStorageSync(t)},i.serialize=function(t){if(null!=t&&""!=t)try{return JSON.parse(JSON.stringify(t))}catch(i){return t instanceof Array?[]:{}}return t},i.setStorage=function(t,i){if("string"==typeof i)return uni.setStorageSync(t,i),i;uni.setStorageSync(t,JSON.stringify(i))},i.showMonthFirstDay=function(){var t=(new Date).setDate(1);return h(new Date(t).getTime(),"yyyy-MM-dd")},i.showWeekFirstDay=function(){var t=new Date,i=t.getDay()||7;return t.setDate(t.getDate()-i+1),h(t,"yyyy-MM-dd")},i.throttle=function(t){var i,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return function(){for(var s=this,a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];i||(i=setTimeout((function(){t.apply(s,n),i=null}),e))}},i.unique=function(t){t=t||[];for(var i={},e=0;e<t.length;e++){var s=JSON.stringify(t[e]);"undefined"==typeof s&&(i[s]=1)}for(var e in t.length=0,i)t[t.length]=e;return t};var a=s(e("fcf3")),n=s(e("9b1b"));function o(t){var i,e=[];return Object.keys(t).forEach((function(i){e.push("".concat(i,"=").concat(t[i]))})),i=e.join("&"),i}function h(t,i){return t?(i=i||"yyyy-MM-dd hh:mm:ss",new Date(t).format(i)):""}e("d4b5"),e("7a76"),e("c9b5"),e("bf0f"),e("2797"),e("dc8a"),e("aa9c"),e("c223"),e("5c47"),e("0506"),e("a1c1"),e("23f4"),e("7d2f"),e("9c4e"),e("ab80"),Date.prototype.format=function(t){var i={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var e in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,String(this.getFullYear()).substr(4-RegExp.$1.length))),i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr(String(i[e]).length)));return t};var r=new Date,c=r.getMonth(),l=r.getYear();l+=l<2e3?1900:0},c528:function(t,i,e){"use strict";e.r(i);var s=e("111a"),a=e("d98d");for(var n in a)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return a[t]}))}(n);e("826cb");var o=e("828b"),h=Object(o["a"])(a["default"],s["b"],s["c"],!1,null,"85d577be",null,!1,s["a"],void 0);i["default"]=h.exports},d17f:function(t,i,e){var s=e("c86c");i=s(!1),i.push([t.i,".my-canvas[data-v-85d577be]{display:flex;position:fixed!important;background:#000;left:0;z-index:100000;width:100%}.my-avatar[data-v-85d577be]{width:%?150?%;height:%?150?%;border-radius:100%}.oper-canvas[data-v-85d577be]{display:flex;position:fixed!important;left:0;z-index:100001;width:100%}.prv-canvas[data-v-85d577be]{display:flex;position:fixed!important;background:#000;left:0;z-index:200000;width:100%}.oper-wrapper[data-v-85d577be]{height:50px;position:fixed!important;box-sizing:border-box;border:1px solid #f1f1f1;background:#fff;width:100%;left:0;bottom:0;z-index:100009;flex-direction:row}.oper[data-v-85d577be]{display:flex;flex-direction:column;justify-content:center;padding:%?10?% %?20?%;width:100%;height:100%;box-sizing:border-box;align-self:center}.btn-wrapper[data-v-85d577be]{display:flex;flex-direction:row;\n\n\nheight:50px;\njustify-content:space-between}.btn-wrapper uni-view[data-v-85d577be]{display:flex;align-items:center;justify-content:center;font-size:16px;color:#333;border:1px solid #f1f1f1;border-radius:6%}.hover[data-v-85d577be]{background:#f1f1f1;border-radius:6%}.clr-wrapper[data-v-85d577be]{display:flex;flex-direction:row;flex-grow:1}.clr-wrapper uni-view[data-v-85d577be]{display:flex;align-items:center;justify-content:center;font-size:16px;color:#333;border:1px solid #f1f1f1;border-radius:6%}.my-slider[data-v-85d577be]{flex-grow:1}",""]),t.exports=i},d98d:function(t,i,e){"use strict";e.r(i);var s=e("57a6"),a=e.n(s);for(var n in s)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return s[t]}))}(n);i["default"]=a.a}}]);
|