| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-27337c7b"],{"30df":function(t,e,o){},"78c1":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("cropper",{attrs:{width:300,height:300,"fixed-number":[1,1]},on:{subUploadSucceed:t.getShopImages}}),t._v(" "+t._s(t.url)+" ")],1)},a=[],n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{staticClass:"one-form-item"},[o("el-upload",{staticClass:"avatar-uploader",attrs:{action:"","auto-upload":!1,"on-change":t.uploadFileMethodAnswer,"show-file-list":!1,multiple:!0,"before-upload":t.beforeUpload}},[o("el-button",{staticClass:"uploader-button",attrs:{type:"primary"}},[t._v("上传banner图")])],1)],1),o("el-dialog",{attrs:{title:"图片剪裁(为确保剪切后图片的分辨率足够,请尽量不缩放剪切原图)",visible:t.dialogVisible,"append-to-body":"",width:"70%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[o("div",{staticClass:"cropper-content"},[o("div",{staticClass:"cropper",staticStyle:{"text-align":"center"}},[o("vueCropper",{ref:"cropper",attrs:{img:t.option.img,outputSize:t.option.size,outputType:t.option.outputType}})],1)]),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),o("el-button",{attrs:{type:"primary",loading:t.loading},on:{click:t.finish}},[t._v("确认")])],1)])],1)},r=[],l=(o("a361"),o("f329")),u=o("965d"),s=o.n(u),p=o("daf0"),d={data:function(){return{imageUrl:"",token:{},domain:"https://up-z1.qiniup.com",qiniuaddr:"xhead.beswell.com",option:{img:"",outputSize:1,full:!1,outputType:"png",canMove:!0,original:!1,canMoveBox:!0,autoCrop:!0,autoCropWidth:868,autoCropHeight:488,fixedBox:!1,fixed:!0,maxImgSize:3e3,fixedNumber:[16,9]},dialogVisible:!1,loading:!1}},methods:{finish:function(){var t=this;this.$refs.cropper.getCropBlob((function(e){var o=null,i=new FileReader;i.onload=function(e){o=e.target.result,t.loading=!0;var i=new FormData;i.append("imageFile",o),uploadImg({formData:i}).then((function(t){})).catch((function(){}))},i.readAsDataURL(e)}))},uploadFileMethodAnswer:function(){this.dialogVisible=!0},cutDown:function(t){console.log(t),this.imageUrl=t.dataURL,this.upqiniu(t)},upqiniu:function(t){var e=this,o={headers:{"Content-Type":"multipart/form-data"}},i="";i="image/png"===t.file.type?"png":"jpg";var a="GoAllOut"+(new Date).valueOf()+Math.floor(100*Math.random())+"."+i,n={token:localStorage.token},r=p.stringify(n);this.axios.post("/api/v1/QiNiu/GetSimpleQiNiuToken",r).then((function(i){var n=new FormData;n.append("file",t.file),n.append("token",i.data.QiNinToken),n.append("key",a),e.axios.post(e.domain,n,o).then((function(t){e.imageUrl="http://"+e.qiniuaddr+"/"+t.data.key}))}))},beforeUpload:function(t){var e=t.size/1024/1024<70;return e||this.$message.error("上传头像图片大小不能超过 70MB!"),isJPG&&e}},components:{ImgCutter:l["a"],VueCropper:s.a}},c=d,f=(o("c65d"),o("cba8")),g=Object(f["a"])(c,n,r,!1,null,"5ebdf985",null),h=g.exports,m=o("8d6e"),b={data:function(){return{editableTabsValue:"1",url:""}},methods:{getShopImages:function(t){this.url=t}},components:{upHead:h,cropper:m["a"]}},v=b,w=Object(f["a"])(v,i,a,!1,null,"66ff9c23",null);e["default"]=w.exports},c65d:function(t,e,o){"use strict";o("30df")}}]);
|