(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-604b0973"],{3624:function(e,t,a){},"668b":function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));a("a4d3"),a("e01a"),a("b636"),a("d28b"),a("e260"),a("d3b7"),a("e6cf"),a("3ca3"),a("ddb0");function s(e){var t,a,s,n=2;for("undefined"!=typeof Symbol&&(a=Symbol.asyncIterator,s=Symbol.iterator);n--;){if(a&&null!=(t=e[a]))return t.call(e);if(s&&null!=(t=e[s]))return new i(t.call(e));a="@@asyncIterator",s="@@iterator"}throw new TypeError("Object is not async iterable")}function i(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return i=function(e){this.s=e,this.n=e.next},i.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var a=this.s["return"];return void 0===a?Promise.resolve({value:e,done:!0}):t(a.apply(this.s,arguments))},throw:function(e){var a=this.s["return"];return void 0===a?Promise.reject(e):t(a.apply(this.s,arguments))}},new i(e)}},"7c01":function(e,t,a){"use strict";var s=a("d074"),i=a.n(s);i.a},"9cca":function(e,t,a){"use strict";var s,i,n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"box"},[a("div",{staticClass:"canvaspanel"},[a("div",{staticClass:"buttongroup"},[a("div",{staticClass:"left",on:{click:e.reset}},[a("van-icon",{staticStyle:{"margin-right":"3px"},attrs:{name:"delete-o",size:"18"}}),a("span",{staticClass:"empty"},[e._v("清除")])],1),a("div",{staticClass:"right",on:{click:e.save}},[a("van-icon",{staticStyle:{"margin-right":"3px"},attrs:{name:"certificate",size:"18"}}),a("span",{staticClass:"empty"},[e._v("确认")])],1)]),a("div",{staticClass:"canvasborder"},[a("canvas",{attrs:{id:"canvas"},on:{touchstart:e.touchStart,touchmove:e.touchMove,touchend:e.touchEnd}})]),a("div",{staticStyle:{margin:"10px auto",width:"100px"}},[a("van-icon",{attrs:{name:"arrow-up",size:"20"},on:{click:function(t){e.$parent.isSign=!1}}})],1)])])},r=[],c=(a("d3b7"),a("e7e5"),a("d399")),o=function(e){return document.querySelector(e)},l={width:0,height:0,lineWidth:5,strokeStyle:"#000000",lineCap:"round",lineJoin:"round"},u={offsetX:0,offsetY:0},m={name:"Signature",components:{},data:function(){return{}},mounted:function(){this.drawingBoardInit()},methods:{handleReset:function(){},confirm:function(){var e=this;this.$refs.esign.generate().then((function(t){var a=e.rotateBase64(t);e.$emit("getSign",a),console.log(t)})).catch((function(e){c["a"].fail("请签名")}))},drawingBoardInit:function(){console.log(o(".canvasborder"),"$(canvasborder)");var e=o(".canvasborder").getBoundingClientRect(),t=e.width,a=e.height,n=e.left,r=e.top;l.width=t,l.height=a,u.offsetX=n,u.offsetY=r,s=o("#canvas"),s.width=l.width,s.height=l.height,i=s.getContext("2d"),i.fillStyle="transparent",i.fillRect(0,0,l.width,l.height)},touchStart:function(e){e.preventDefault();var t=e.changedTouches[0],a=t.clientX,s=t.clientY;i.beginPath(),i.lineWidth=l.lineWidth,i.strokeStyle=l.strokeStyle,i.lineCap=l.lineCap,i.lineJoin=l.lineJoin,i.moveTo(a-u.offsetX,s-u.offsetY)},touchMove:function(e){var t=e.changedTouches[0],a=t.clientX,s=t.clientY;i.lineTo(a-u.offsetX,s-u.offsetY),i.stroke()},touchEnd:function(){i.closePath(),window.removeEventListener("mousemove",this.draw)},reset:function(){i.clearRect(0,0,l.width,l.height)},save:function(){var e=this;return new Promise((function(t,a){e.isCanvasBlank(s)||e.rotateBase64(s.toDataURL("image/png")).then((function(a){var s=a;e.$emit("getSign",s),t(s)}))}))},isCanvasBlank:function(e){var t=document.createElement("canvas");return t.width=l.width,t.height=l.height,e.toDataURL()===t.toDataURL()},rotateBase64:function(e){return new Promise((function(t){var a=new Image;a.src=e;var s=document.createElement("canvas"),i=s.getContext("2d"),n={sx:0,sy:0,ex:0,ey:0};a.onload=function(){var e=a.width,r=a.height,c=r;s.width=2*c,s.height=2*c,n.sx=c,n.sy=c-e,n.ex=c+r,n.ey=c+e,i.translate(c,c),i.rotate(Math.PI/2*3),i.drawImage(a,0,0);for(var o=i.getImageData(n.sx,n.sy,n.ex,n.ey),l=0;l