(function(t){function e(e){for(var i,a,s=e[0],c=e[1],l=e[2],p=0,d=[];p=500?"50px":t/10+"px"}A(),onresize=A,i["a"].config.productionTip=!1,i["a"].use(k.a),i["a"].component("icon",w["a"]),i["a"].component("custedLogo",O),i["a"].use(N),new i["a"]({router:m,store:g,render:function(t){return t(l)}}).$mount("#app")},"5c0b":function(t,e,n){"use strict";n("9c0c")},7126:function(t,e,n){var i={"./left_arrow.svg":"7992"};function o(t){var e=r(t);return n(e)}function r(t){if(!n.o(i,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return i[t]}o.keys=function(){return Object.keys(i)},o.resolve=r,t.exports=o,o.id="7126"},7992:function(t,e){t.exports={svg:{$:{t:"1592540000470",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6373","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"200",height:"200"},defs:[{style:[{$:{type:"text/css"}}]}],path:[{$:{d:"M783.872 542.122667l-0.042667-64.405334-477.610666-0.298666 225.28-225.322667-45.568-45.568L182.506667 509.952l303.829333 303.829333 45.525333-45.504-226.474666-226.453333 478.506666 0.298667z","p-id":"6374",fill:"#494e5e"}}]}}},"871b":function(t,e,n){},"9c0c":function(t,e,n){},bb51:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"home"},[t.img?[n("header",[n("div",{staticClass:"warp"},[n("div",{on:{click:t.back}},[n("icon",{staticClass:"back",attrs:{name:"left_arrow"}})],1),n("p",[t._v("图片压缩")])])]),n("cropper-image",{ref:"child",attrs:{img:t.img}})]:n("main",[n("div",{staticClass:"logo-box"},[n("custedLogo",{staticClass:"logo"})],1),n("div",{staticClass:"title"},[t._v("护资照片压缩")]),t._m(0),n("div",{staticClass:"btn-submit",on:{click:t.selectImg}},[t._v("选择图片")]),n("input",{ref:"uploads",staticStyle:{position:"absolute",clip:"rect(0 0 0 0)"},attrs:{type:"file",accept:"image/png, image/jpeg, image/gif, image/jpg"},on:{change:function(e){return t.manageImg(e)}}})]),t._m(1)],2)},o=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"tip-box"},[n("div",{staticClass:"tip-line"},[n("div",{staticClass:"tip-title"},[t._v("冲印尺寸")]),n("div",{staticClass:"tip-content"},[t._v("25mm x 35mm")])]),n("div",{staticClass:"tip-line"},[n("div",{staticClass:"tip-title"},[t._v("像素尺寸")]),n("div",{staticClass:"tip-content"},[t._v("295 x 413 px")])]),n("div",{staticClass:"tip-line"},[n("div",{staticClass:"tip-title"},[t._v("分辨率")]),n("div",{staticClass:"tip-content"},[t._v("300 DPI")])]),n("div",{staticClass:"tip-line"},[n("div",{staticClass:"tip-title"},[t._v("背景色")]),n("div",{staticClass:"tip-content"},[t._v("白色")])]),n("div",{staticClass:"tip-line"},[n("div",{staticClass:"tip-title"},[t._v("文件大小")]),n("div",{staticClass:"tip-content"},[t._v("小于100kb")])]),n("div",{staticClass:"tip-line"},[n("div",{staticClass:"tip-title"},[t._v("其他")]),n("div",{staticClass:"tip-content"},[t._v(" 无噪点,不模糊,服装突出,肩膀等高,中性表情,双眼水平,人像剧中,人脸姿态自然 ")])])])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("footer",[n("a",{attrs:{href:"http://beian.miit.gov.cn/"}},[n("p",[t._v("吉ICP备18005655号")])]),n("p",[t._v("Copyright © 2020 小单同学")]),n("p",[t._v("All Rights Reserved")])])}],r=(n("d3b7"),n("3ca3"),n("ddb0"),n("2b3d"),n("53ca")),a=(n("96cf"),n("1da1")),s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cropper-box"},[n("div",{staticClass:"cropper"},[n("vue-cropper",{ref:"cropper",attrs:{img:t.option.img,outputSize:t.option.outputSize,outputType:t.option.outputType,info:t.option.info,canScale:t.option.canScale,autoCrop:t.option.autoCrop,autoCropWidth:t.option.autoCropWidth,autoCropHeight:t.option.autoCropHeight,fixed:t.option.fixed,fixedNumber:t.option.fixedNumber,full:t.option.full,fixedBox:t.option.fixedBox,canMove:t.option.canMove,canMoveBox:t.option.canMoveBox,original:t.option.original,centerBox:t.option.centerBox,height:t.option.height,infoTrue:t.option.infoTrue,maxImgSize:t.option.maxImgSize,enlarge:t.option.enlarge,mode:t.option.mode},on:{realTime:t.realTime,imgLoad:t.imgLoad}})],1),n("footer",[n("div",{staticClass:"scope-btn"},[n("div",{staticClass:"btn",on:{click:function(e){return t.changeScale(1)}}},[t._v("放大")]),n("div",{staticClass:"btn",on:{click:function(e){return t.changeScale(-1)}}},[t._v("缩小")]),n("div",{staticClass:"btn",on:{click:t.rotateLeft}},[t._v("↺ 左旋转")]),n("div",{staticClass:"btn",on:{click:t.rotateRight}},[t._v("↻ 右旋转")])]),n("div",{staticClass:"upload-btn"},[n("div",{staticClass:"btn-submit",on:{click:function(e){return t.donwloadImg()}}},[t._v("压缩图片并下载")])])])])},c=[],l=n("b678"),u=(n("e688"),{name:"CropperImage",components:{VueCropper:l["VueCropper"]},props:["img"],data:function(){return{previews:{},option:{img:this.img,outputSize:1,outputType:"png",info:!1,canScale:!0,autoCrop:!0,autoCropWidth:200,autoCropHeight:280,fixed:!0,fixedNumber:[5,7],full:!1,fixedBox:!1,canMove:!1,canMoveBox:!0,original:!1,centerBox:!0,height:!0,infoTrue:!1,maxImgSize:3e3,enlarge:1,mode:"200px 280px"}}},methods:{imgLoad:function(t){console.log("工具初始化函数====="+t)},changeScale:function(t){t=t||1,this.$refs.cropper.changeScale(t)},rotateLeft:function(){this.$refs.cropper.rotateLeft()},rotateRight:function(){this.$refs.cropper.rotateRight()},realTime:function(t){this.previews=t},zipImg:function(t,e,n){var i=this;return new Promise((function(o){var r=new Image;r.src=t,r.onload=function(){var a=document.createElement("canvas"),s=a.getContext("2d");a.setAttribute("width",e),a.setAttribute("height",n),s.drawImage(r,0,0,e,n);var c=a.toDataURL("image/png");console.log(c.length/1024/1024),c.length/1024/1024>.1?(console.log(1,e,n),o(i.zipImg(t,.9*e,.9*n))):(console.log(2,e,n),o(c))}}))},donwloadImg:function(){var t=this;this.$refs.cropper.getCropData(function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(n){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.zipImg(n,295,413).then((function(t){console.log(t.length/1024/1024);var e=document.createElement("a");e.href=t,e.download="护士执业资格考试.png",document.body.appendChild(e),e.click(),document.body.removeChild(e)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},selectImg:function(){this.$refs.upload.click()}}}),p=u,d=(n("0ed4"),n("2877")),f=Object(d["a"])(p,s,c,!1,null,"a7e6d032",null),m=f.exports,v={name:"Home",components:{CropperImage:m},data:function(){return{img:null}},methods:{back:function(){this.img=null},selectImg:function(){this.$refs.uploads.click()},manageImg:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(e){var n,i,o=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.target.files[0],/\.(jpg|jpeg|png|JPG|PNG)$/.test(e.target.value)){t.next=4;break}return this.$snakebar("图片类型要求:jpeg、jpg、png"),t.abrupt("return",!1);case 4:i=new FileReader,i.onload=function(t){var e;e="object"===Object(r["a"])(t.target.result)?window.URL.createObjectURL(new Blob([t.target.result])):t.target.result,o.img=e},i.readAsDataURL(n);case 7:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()}},h=v,g=(n("2b9f"),Object(d["a"])(h,i,o,!1,null,"5d896ece",null));e["default"]=g.exports}});