From b8d2743f3c051d0a90779836970db3fd1a7954fd Mon Sep 17 00:00:00 2001 From: liyuetong Date: Tue, 14 Sep 2021 14:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E6=88=90=E7=AD=BE=E5=AD=97=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/CFCA/Base64.js | 93 +++++ public/CFCA/EPaper.min.js | 31 ++ public/CFCA/SignTrue.html | 72 ++++ src/api/ebiz/allowance/allowance.js | 8 + src/router/ebiz/allowance.js | 2 +- src/views/ebiz/allowance/Detail.vue | 1 - .../application/SignatureConfirmation.vue | 0 .../SignatureConfirmation.vue | 187 ++++++++++ .../component/SignTure.vue | 327 ++++++++++++++++++ .../component/js/EPaper.min.js | 35 ++ src/views/ebiz/allowance/approval/List.vue | 1 + 11 files changed, 755 insertions(+), 2 deletions(-) create mode 100644 public/CFCA/Base64.js create mode 100644 public/CFCA/EPaper.min.js create mode 100644 public/CFCA/SignTrue.html delete mode 100644 src/views/ebiz/allowance/application/SignatureConfirmation.vue create mode 100644 src/views/ebiz/allowance/application/SignatureConfirmation/SignatureConfirmation.vue create mode 100644 src/views/ebiz/allowance/application/SignatureConfirmation/component/SignTure.vue create mode 100644 src/views/ebiz/allowance/application/SignatureConfirmation/component/js/EPaper.min.js diff --git a/public/CFCA/Base64.js b/public/CFCA/Base64.js new file mode 100644 index 000000000..a888b364c --- /dev/null +++ b/public/CFCA/Base64.js @@ -0,0 +1,93 @@ +function Base64() { + + // private property + b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + b64padchar="="; + + // public method for encoding + this.encode = function (bytes) { + var i; + var c = 0x0; + var ret = ""; + for (i = 0; i + 3 <= bytes.length; i += 3) { + c = ((bytes[i] & 0xFF) << 16) ^ ((bytes[i + 1]& 0xFF) << 8) ^ (bytes[i + 2] & 0xFF); + ret += b64map.charAt(c >>> 18) + b64map.charAt((c & 0x3F000) >>> 12) + b64map.charAt((c & 0xFC0) >>> 6) + b64map.charAt(c & 0x3F); + } + + if (i == (bytes.length-1)) { + c = bytes[i] & 0xFF; + ret += b64map.charAt((c & 0xFC) >>> 2) + b64map.charAt((c & 0x3) << 4); + } + else if (i + 1 == (bytes.length-1)) { + c = ((bytes[i] & 0xFF) << 8) ^ (bytes[i + 1] & 0xFF); + ret += b64map.charAt((c & 0xFC00) >>> 10) + b64map.charAt((c & 0x3F0) >>> 4) + b64map.charAt((c & 0xF) << 2); + } + + while ((ret.length & 3) > 0) { + ret += b64padchar; + } + + return ret; + } + + // public method for decoding + this.decode = function (s) { + var ret = []; + var i; + + for (i = 0; i < s.length; i += 4) { + var block = []; + var v1 = b64map.indexOf(s.charAt(i)); + if (v1 < 0) continue; + block.push(v1); + + var v2 = b64map.indexOf(s.charAt(i+1)); + if (v2 < 0) continue; + block.push(v2); + + var third = s.charAt(i+2); + if(third == b64padchar) { //Handle Block + ret = ret.concat(convertb64Block(block)); + break; + } + else { + var v3 = b64map.indexOf(third); + if (v3 < 0) continue; + block.push(v3); + } + + var fourth = s.charAt(i+3); + if(fourth == b64padchar) {//Handle Block + ret = ret.concat(convertb64Block(block)); + break; + } + else { + var v4 = b64map.indexOf(fourth); + if (v4 < 0) continue; + block.push(v4); + } + ret = ret.concat(convertb64Block(block));//Handle Block + } + + return ret; + } + + function convertb64Block(bytes) { + var ret = []; + var i = 0; + if (bytes.length == 4) { + ret.push(((bytes[i] & 0x3F) << 2) ^ ((bytes[i + 1] & 0x30) >>> 4)); + ret.push(((bytes[i + 1] & 0xF) << 4) ^ ((bytes[i + 2] & 0x3C) >>> 2)); + ret.push(((bytes[i + 2] & 0x3) << 6) ^ (bytes[i + 3] & 0xFF)); + } + else if (bytes.length == 3) { + ret.push(((bytes[i] & 0x3F) << 2) ^ ((bytes[i + 1] & 0x30) >>> 4)); + ret.push(((bytes[i + 1] & 0xF) << 4) ^ ((bytes[i + 2] & 0x3C)>>>2)); + } + else if (bytes.length == 2) { + ret.push(((bytes[i] & 0x3F) << 2) ^ ((bytes[i+1] & 0x30)>>>4)); + } + + return ret; +} +} \ No newline at end of file diff --git a/public/CFCA/EPaper.min.js b/public/CFCA/EPaper.min.js new file mode 100644 index 000000000..22b3a0383 --- /dev/null +++ b/public/CFCA/EPaper.min.js @@ -0,0 +1,31 @@ +var goog=goog||{};goog.global=this;goog.exportPath_=function(name,opt_object,opt_objectToExportTo){var parts=name.split(".");var cur=opt_objectToExportTo||goog.global;if(!(parts[0]in cur)&&cur.execScript)cur.execScript("var "+parts[0]);for(var part;parts.length&&(part=parts.shift());)if(!parts.length&&opt_object!==undefined)cur[part]=opt_object;else if(cur[part])cur=cur[part];else cur=cur[part]={}}; +goog.exportSymbol=function(publicPath,object,opt_objectToExportTo){goog.exportPath_(publicPath,object,opt_objectToExportTo)};goog.exportProperty=function(object,publicName,symbol){object[publicName]=symbol};function aa(l){l&&l.preventDefault?l.preventDefault():window.event&&(window.event.returnValue=!1)}function ba(l){l&&l.stopPropagation?l.stopPropagation():window.event&&(window.event.cancelBubble=!0)} +function m(l){function L(){var a=n.getBoundingClientRect().width,b=n.getBoundingClientRect().height;n.width=a*p;n.height=b*p;f.scale(p,p);n.style.backgroundColor=n.style.backgroundColor}function I(a,b,c){window.getSelection()?window.getSelection().removeAllRanges():document.selection.empty();f.save();f.moveTo(a,b);F=G/2*(B/320);N&&(J(document,"mousemove",N),J(document,"touchmove",N),J(document,"mouseup",M),J(document,"touchend",M));"touchstart"==c?(O(document,"touchmove",N),O(document,"touchend", +M)):(O(document,"mousemove",N),O(document,"mouseup",M));x=null;R(a,b)}function R(a,b){var c,d;if(u.length&&(c=u[u.length-1],d=Math.sqrt((c.x-a)*(c.x-a)+(c.y-b)*(c.y-b)),!d))return;ka++;navigator.userAgent.match(/ OS (\d+).*? Mac OS/)&&!ca&&2==u.length&&4*c3*H.a&&(g/=4,h=1);ca=1;b||(b=ma(g));X=b;if(h)for(h=1;3>=h;h++)na(c+h/3*(x.x-c),d+h/3*(x.y-d),g)}na(c,d,g);x=a}}function ma(a){var b=B/320*G;return.65*(a<.003125*B?1.2*b:a<.00625*B?1.15*b:a<.009375*B?1.1*b:a<.015625*B?1.05*b:a<.021875*B?b:a<.028125*B?.95*b:a<.034375*B?.9*b:a<.046875*B?.85*b:a<.0625*B?.8*b:.75*b)}function na(a,b,c){var d={x:a,y:b},g=F;f.fillStyle=C;f.strokeStyle=C;if(x){a=Math.floor(Math.abs(c)/(F/3));if(1B/320*G*.025&&(g=F-(F-X)/8);a=Math.abs(F-g);1<=a&&(g=F>g?g+.4*a:g-.4*a);a=null;if(0=a.length?P=null:P=a[1]}else 2<=u.length&&((g=u[1].a)&&(F=ma(g)),F+=2),f.beginPath(),f.fillStyle=C,f.arc(a,b,F,0,2*Math.PI),f.fill(),f.closePath()}function oa(a,b){return Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2))}function Q(){D&&M(null)}function da(a){aa(a);ba(a);Q();if("edit"===w){var b,c;if("touchstart"==a.type){if(2<=a.touches.length)return;b=a.touches[0].pageX;c=a.touches[0].pageY;J(n,"mousedown", +da)}else a.pageX?(b=a.pageX,c=a.pageY):(b=a.clientX,c=a.clientY);pa()||(canvasRect=n.getBoundingClientRect(),canvasRect={left:canvasRect.left+(window.scrollX||window.pageXOffset),top:canvasRect.top+(window.scrollY||window.pageYOffset)},b-=canvasRect.left,c-=canvasRect.top,D={time:new Date,points:[{x:b,y:c,t:0}],color:C,penSize:G},I(b,c,a.type))}}function N(a){aa(a);ba(a);if("edit"===w){var b;if("touchmove"==a.type){if(2<=a.touches.length)return;b=a.touches[0].pageX;a=a.touches[0].pageY}else a.pageX? +(b=a.pageX,a=a.pageY):(b=a.clientX,a=a.clientY);b-=canvasRect.left;a-=canvasRect.top;pa()?M(null):(D.points.push({x:b,y:a,t:new Date-D.time}),R(b,a))}}function M(a){aa(a);ba(a);"edit"===w&&(U(),k.length?D.time-=qa:(qa=D.time,D.time=D.time.getTime()),k.push(D),S=null,V=[],D=null)}function pa(){var a=0;D&&(a+=D.points.length);for(var b=0;bua?!0:!1}function ea(){"play"==w&&(w=Y,clearTimeout(T),W());"edit"===w&&(x=null,e=[-1,-1,-1,-1],ka=0,k.length&&(S=k), +k=[],f.beginPath(),f.clearRect(0,0,n.width,n.height),f.closePath())}function U(){J(document,"mousemove",N);J(document,"touchmove",N);J(document,"mouseup",M);J(document,"touchend",M);for(var a;u.length;)a=u.shift(),la(a,B/320*G/8)}function ra(){function a(){C=b;G=c;K>=k.length?w=Y:(clearTimeout(T),T=setTimeout(function(){ra()},300))}var b=C,c=G,d=k[K];if(d&&"play"==w){C=d.color;G=d.penSize;I(d.points[0].x,d.points[0].y);1==d.points.length&&(U(),a());var g=1,e,h=0;e=d.points[g];(function(){e&&(R(e.x, +e.y),g>=d.points.length-1&&(U(),a()),g++,e=d.points[g])&&(clearTimeout(T),T=setTimeout(arguments.callee,e.t-h),h=e.t)})();K++}}function W(){function a(){C=b;G=c;K>=k.length&&(w="edit")}var b=C,c=G;f.clearRect(0,0,n.width,n.height);f.beginPath();K=0;for(var d=k[K];d;){C=d.color;G=d.penSize;I(d.points[0].x,d.points[0].y);1==d.points.length&&(U(),a());for(var g=1,e=1;g=d.points.length&&(U(),a())}K++;d=k[K]}}function fa(a,b,c,d){a.height=d;a.width= +c;a.style.height=d/p+"px";a.style.width=c/p+"px";b.scale(p,p)}function sa(a,b){q+="getWritingRect start \n";e=[-1,-1,-1,-1];for(var c=0;cH-16?0:H-16,f=0>g-16?0:g-16;e[0]=0>e[0]?h:e[0];e[0]=e[0]>h?h:e[0];e[1]=e[1]e[2]?f:e[2];e[2]=e[2]>f?f:e[2];e[3]=e[3]a?a:e[1];e[3]=e[3]>b?b:e[3];for(c=0;ca)return null;var b=Math.floor(a/4294967295);a%=4294967295;var c=[],d=[];if(b){do c.push(b&255),b>>>=8;while(b);d.push.apply(d,c.reverse())}c= +[];do c.push(a&255),a>>>=8;while(a);d.push.apply(d,c.reverse());return d}function t(a){if(!a||0==a.length)return null;var b=4a.S||0>b?null:a.slice(b,c)}function z(a,b){var c=[],d=ha(a);if(null==d)return null;if(d.length>b){for(var g=0;g=a&&.9<=b&&1.1>=b||(L(),q+="[window-resize canvas.width + canvas.height] ="+n.width/p+"_"+n.height/p,ea(),q+="[window-resize function] end \n")});var p=(window.devicePixelRatio|| +1)/1,k=[],V=[],F=1,X=1,C="rgb(0,0,0)",G=8,B=320,ka=0,D=null,S=null,w="edit",e=[-1,-1,-1,-1],ta=.4,x=null,P=null,u=[],ca=0,qa=null,K=0,Y="edit",T=null,f=n.getContext("2d"),ua=5E4,q="";(function(){L();ea();n.getContext&&(f.strokeStyle=C,f.fillStyle=C,O(n,"selectstart",function(){return!1}),O(n,"touchstart",da),O(n,"mousedown",da))})();this.C=function(){for(var a="4.5.0.3";0<=a.indexOf(".");)a=a.replace(".","");return z(parseInt(a),2)};this.j=function(a){var b=a.match(/(\d+)/g);a=[];if(b)for(var c=0;c< +b.length;c++)a.push.apply(a,ha(b[c]));for(b=a.length;3>b;b++)a.push(0);return a};this.c=function(a){G=1==a&&18||2==a&&12||3==a&&8||4==a&&6||5==a&&3||8};this.R=function(a,b,c){C="rgb("+a+","+b+","+c+")"};this.g=function(){Q();return!!V.length};this.f=function(){Q();if("edit"===w)if(S&&S.length)k=S,S=null,W();else if(k.length){var a=k.pop();V.push([a]);W()}};this.L=function(){Q();"edit"===w&&V.length&&(k=k.concat(V.pop()),W())};this.O=function(){Q();0!=k.length&&("play"==w?(w=Y,clearTimeout(T),W()): +(Y=w,w="play",f.clearRect(0,0,n.width,n.height),f.beginPath(),K=0,ra()))};this.D=function(){return 0!=k.length&&"play"==w?!0:!1};this.h=function(){q+="_clear start \n";ea();q+="_clear end \n"};this.l=function(){Q();q+="_getHandWritingData start \n";if(0>=k.length)return null;var a=navigator.userAgent.match(/\([^\)]*\)[^\(]*\([^\)]*\)\s(.*)/);a&&0A&&(h[0]|=128),A=h):A=null;g.push.apply(g,A)}c.push.apply(c,b);c.push.apply(c,a);c.push.apply(c,g)}q+="_getHandWritingData end \n";return c};this.b=function(){Q(); +q+="_getHandWritingPng start \n";if(0>=k.length)return null;sa(f.canvas.width,f.canvas.height);for(var a=f.getImageData(e[0],e[2],e[1]-e[0],e[3]-e[2]),b,c=b=0;cb)return null;q+="_getHandWritingPng end(callback == null) \n";q+="convertImgToBase64URL start \n";b=document.createElement("CANVAS");ctx=b.getContext("2d");fa(b,ctx,a.width,a.height);ctx.putImageData(a,0,0);dataURL=b.toDataURL("image/png"); +q+="convertImgToBase64URL end \n";return dataURL};this.w=function(a,b,c){if(!(0>=a||0>=b)){var d=this.b();if(2!==(d?d.split(","):"").length)c?c(null):null;else{sa(f.canvas.width,f.canvas.height);var g=[e[1]-e[0],e[3]-e[2]],k=document.createElement("CANVAS"),h=k.getContext("2d");fa(k,h,a,b);var n=new Image;n.src=d;n.onload=function(){var d,e,f,l;g[0]>Math.round(a/b*g[1])?(f=a,l=Math.round(g[1]/g[0]*a),d=0,e=Math.round((b-l)/2)):(l=b,f=Math.round(g[0]/g[1]*b),d=Math.round((a-f)/2),e=0);h.drawImage(n, +d/p,e/p,f/p,l/p);d=k.toDataURL("image/png");c?c(d):null}}}};this.F=function(a,b,c,d){if(!(0>=a||0>=b||0>=c.length)){var e=document.createElement("CANVAS"),f=e.getContext("2d");fa(e,f,a,b);a=Math.floor(a/d);b=Math.floor(b/Math.ceil(c.length/d));for(var h=1;h<=c.length;h++)f.drawImage(c[h-1],(h-1)%d*a/p,(Math.ceil(h/d)*b-b)/p,a/p,b/p);return e.toDataURL("image/png")}};this.A=function(){var a=q+="userAgent \u4fe1\u606f:"+navigator.userAgent+"\n";q="";return a};this.H=function(a){if(a){var b=0,c=t(v(a, +b,2)),d=0;4101z?z=3:18 + + + 手写笔迹 + + + + + + +
+ +
+ + + diff --git a/src/api/ebiz/allowance/allowance.js b/src/api/ebiz/allowance/allowance.js index 8f8f26add..98b06fc93 100644 --- a/src/api/ebiz/allowance/allowance.js +++ b/src/api/ebiz/allowance/allowance.js @@ -99,6 +99,14 @@ export function revokerApprove(data) { data }) } +// 津贴-提交审批初始化接口 +export function approveInit(data) { + return request({ + url: getUrl('/agent/allowance/approve/init', 1), + method: 'post', + data + }) +} // <-- zhangqi 津贴申请与我的资料使用到的接口 begin --> diff --git a/src/router/ebiz/allowance.js b/src/router/ebiz/allowance.js index 309be0f90..dc9726ee2 100644 --- a/src/router/ebiz/allowance.js +++ b/src/router/ebiz/allowance.js @@ -3,7 +3,7 @@ const applicationList = () => import('@/views/ebiz/allowance/application/List') const applicationBaseInfo = () => import('@/views/ebiz/allowance/application/BaseInfo') const applicationAccountInfo = () => import('@/views/ebiz/allowance/application/AccountInfo') const applicationAttachmentManagement = () => import('@/views/ebiz/allowance/application/AttachmentManagement') -const applicationSignatureConfirmation = () => import('@/views/ebiz/allowance/application/SignatureConfirmation') +const applicationSignatureConfirmation = () => import('@/views/ebiz/allowance/application/SignatureConfirmation/SignatureConfirmation') const applicationProcess = () => import('@/views/ebiz/allowance/application/process') const myInfoBaseInfo = () => import('@/views/ebiz/allowance/myInfo/BaseInfo') diff --git a/src/views/ebiz/allowance/Detail.vue b/src/views/ebiz/allowance/Detail.vue index 2e55abab4..d87c730d3 100644 --- a/src/views/ebiz/allowance/Detail.vue +++ b/src/views/ebiz/allowance/Detail.vue @@ -180,7 +180,6 @@ export default { } }, created() { - this.orderNo = localStorage.orderNo this.getAllowanceDetail() // 获取订单详情 }, mounted() {}, diff --git a/src/views/ebiz/allowance/application/SignatureConfirmation.vue b/src/views/ebiz/allowance/application/SignatureConfirmation.vue deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/views/ebiz/allowance/application/SignatureConfirmation/SignatureConfirmation.vue b/src/views/ebiz/allowance/application/SignatureConfirmation/SignatureConfirmation.vue new file mode 100644 index 000000000..4e0cfba6d --- /dev/null +++ b/src/views/ebiz/allowance/application/SignatureConfirmation/SignatureConfirmation.vue @@ -0,0 +1,187 @@ + + + diff --git a/src/views/ebiz/allowance/application/SignatureConfirmation/component/SignTure.vue b/src/views/ebiz/allowance/application/SignatureConfirmation/component/SignTure.vue new file mode 100644 index 000000000..bec28ee6c --- /dev/null +++ b/src/views/ebiz/allowance/application/SignatureConfirmation/component/SignTure.vue @@ -0,0 +1,327 @@ + + + diff --git a/src/views/ebiz/allowance/application/SignatureConfirmation/component/js/EPaper.min.js b/src/views/ebiz/allowance/application/SignatureConfirmation/component/js/EPaper.min.js new file mode 100644 index 000000000..b85e92063 --- /dev/null +++ b/src/views/ebiz/allowance/application/SignatureConfirmation/component/js/EPaper.min.js @@ -0,0 +1,35 @@ +/* eslint-disable */'use strict';var goog=goog||{};goog.global={};goog.exportPath_=function(name,opt_object,opt_objectToExportTo){var parts=name.split(".");var cur=opt_objectToExportTo||goog.global;if(!(parts[0]in cur)&&cur.execScript)cur.execScript("var "+parts[0]);for(var part;parts.length&&(part=parts.shift());)if(!parts.length&&opt_object!==undefined)cur[part]=opt_object;else if(cur[part])cur=cur[part];else cur=cur[part]={}}; +goog.exportSymbol=function(publicPath,object,opt_objectToExportTo){goog.exportPath_(publicPath,object,opt_objectToExportTo)};goog.exportProperty=function(object,publicName,symbol){object[publicName]=symbol};var oa="function"==typeof Object.defineProperties?Object.defineProperty:function(k,E,t){k!=Array.prototype&&k!=Object.prototype&&(k[E]=t.value)},pa="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:"undefined"!=typeof self&&null!=self?self:this; +function La(k,E){if(E){var t=pa;k=k.split(".");for(var x=0;xt&&(t=Math.max(0,K+t));if(null==x||x>K)x=K;x=Number(x);0>x&&(x=Math.max(0,K+x));for(t=Number(t||0);t3*f.a){e/=4;var g=1}qa=1;b||(b=Da(e));la=b;if(g)for(g=1;3>=g;g++)Ea(c+g/3*(M.x-c),d+g/3*(M.y-d),e)}Ea(c,d,e);M=a}}function Da(a){var b=O/320*R;return.65*(a<.003125*O?1.2*b:a<.00625*O?1.15*b:a<.009375*O?1.1*b:a<.015625*O?1.05*b:a<.021875*O?b:a<.028125*O?.95*b:a<.034375*O?.9*b:a<.046875*O?.85*b:a<.0625*O?.8*b:.75*b)}function Ea(a,b,c){var d={x:a,y:b},e=L;m.fillStyle=P;m.strokeStyle=P;if(M){a=Math.floor(Math.abs(c)/(L/3));if(1O/320*R*.025&&(e=L-(L-la)/8);a=Math.abs(L-e);1<=a&&(e=L>e?e+.4*a:e-.4*a);a=null;if(0=a.length?da=null:da=a[1]}else 2<=v.length&&((e=v[1].a)&&(L=Da(e)),L+=2),m.beginPath(),m.fillStyle=P,m.arc(a,b,L,0,2*Math.PI),m.fill(),m.closePath()}function Fa(a,b){return Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2))}function ea(){Q&&W(null)}function ra(a){Ma(a);Na(a);ea();if("edit"===H){if("touchstart"==a.type){if(2<=a.touches.length)return;var b=a.touches[0].pageX;var c= +a.touches[0].pageY;U(u,"mousedown",ra)}else a.pageX?(b=a.pageX,c=a.pageY):(b=a.clientX,c=a.clientY);Ga()||(Y=u.getBoundingClientRect(),Y={left:Y.left+(window.scrollX||window.pageXOffset),top:Y.top+(window.scrollY||window.pageYOffset)},b-=Y.left,c-=Y.top,Q={time:new Date,points:[{x:b,y:c,t:0}],color:P,penSize:R},sa&&!ta()&&sa(),t(b,c,a.type))}}function ba(a){Ma(a);Na(a);if("edit"===H){if("touchmove"==a.type){if(2<=a.touches.length)return;var b=a.touches[0].pageX;a=a.touches[0].pageY}else a.pageX?(b= +a.pageX,a=a.pageY):(b=a.clientX,a=a.clientY);b-=Y.left;a-=Y.top;Ga()?W(null):(Q.points.push({x:b,y:a,t:new Date-Q.time}),x(b,a))}}function W(a){ua&&!ta()&&ua();Ma(a);Na(a);"edit"===H&&(ia(),q.length?Q.time-=Ha:(Ha=Q.time,Q.time=Q.time.getTime()),q.push(Q),fa=null,ja=[],Q=null)}function Ga(){var a=0;Q&&(a+=Q.points.length);for(var b=0;bPa?!0:!1}function va(){"play"==H&&(H=ma,clearTimeout(ha),ka());"edit"===H&&(M=null,l=[-1,-1,-1,-1],Ca=0,q.length&&(fa=q), +q=[],m.beginPath(),m.clearRect(0,0,u.width,u.height),m.closePath())}function ia(){U(document,"mousemove",ba);U(document,"touchmove",ba);U(document,"mouseup",W);U(document,"touchend",W);for(var a;v.length;)a=v.shift(),K(a,O/320*R/8)}function Ia(){function a(){P=b;R=c;V>=q.length?H=ma:(clearTimeout(ha),ha=setTimeout(function(){Ia()},300))}var b=P,c=R,d=q[V];if(d&&"play"==H){P=d.color;R=d.penSize;t(d.points[0].x,d.points[0].y);1==d.points.length&&(ia(),a());var e=1,f=0;var g=d.points[e];var n=function(){g&& +(x(g.x,g.y),e>=d.points.length-1&&(ia(),a()),e++,g=d.points[e])&&(clearTimeout(ha),ha=setTimeout(n,g.t-f),f=g.t)};n();V++}}function ka(){function a(){P=b;R=c;V>=q.length&&(H="edit")}var b=P,c=R;m.clearRect(0,0,u.width,u.height);m.beginPath();V=0;for(var d=q[V];d;){P=d.color;R=d.penSize;t(d.points[0].x,d.points[0].y);1==d.points.length&&(ia(),a());for(var e=1,f=1;e=d.points.length&&(ia(),a())}V++;d=q[V]}}function wa(a,b,c,d,e){e=void 0===e?!1: +e;a.height=d;a.width=c;a.style.height=d/A+"px";a.style.width=c/A+"px";b.scale(A,A);e&&(b.fillStyle="white",b.fillRect(0,0,c,d))}function Ja(a,b){G+="getWritingRect start \n";l=[-1,-1,-1,-1];for(var c=0;cf-16?0:f-16,n=0>e-16?0:e-16;l[0]=0>l[0]?g:l[0];l[0]=l[0]>g?g:l[0];l[1]=l[1]l[2]?n:l[2];l[2]=l[2]>n?n:l[2];l[3]=l[3]a?a:l[1];l[3]=l[3]>b?b:l[3];for(c=0;ca)return null;var b=Math.floor(a/4294967295);a%=4294967295;var c=[],d=[];if(b){do c.push(b&255),b>>>=8;while(b);d.push.apply(d,c.reverse())}c=[];do c.push(a&255),a>>>=8;while(a);d.push.apply(d,c.reverse());return d}function B(a){if(!a||0==a.length)return null;var b=4a.W||0>b?null:a.slice(b,c)}function N(a,b){var c=[];a=ya(a);if(null==a)return null;if(a.length> +b){for(var d=0;d=a&&.9<=b&&1.1>=b||(E(),G+="[window-resize canvas.width + canvas.height] ="+u.width/A+"_"+u.height/A,va(),G+="[window-resize function] end \n")});var A=window.devicePixelRatio||1,q=[],ja=[],L=1,la=1,P="rgb(0,0,0)",R=8,O=320,Ca=0,Q=null,fa=null,H="edit",l=[-1,-1,-1,-1],Oa=.4,M=null,da=null,v=[],qa=0,Ha=null,V=0,ma="edit",ha=null,m=u.getContext("2d"),Pa=5E4,G="",sa=null,ua=null;(function(){E();va();u.getContext&&(m.strokeStyle=P,m.fillStyle=P,ca(u,"selectstart",function(){return!1}), +ca(u,"touchstart",ra),ca(u,"mousedown",ra))})();this.s=function(){for(var a="6.1.0.0";0<=a.indexOf(".");)a=a.replace(".","");return N(parseInt(a),2)};this.o=function(a){var b=a.match(/(\d+)/g);a=[];if(b)for(var c=0;cb;b++)a.push(0);return a};this.h=function(a){R=1==a&&18||2==a&&12||3==a&&8||4==a&&6||5==a&&3||8};this.g=function(a,b,c){P="rgb("+a+","+b+","+c+")"};this.j=function(){ea();return!!ja.length};this.i=function(){ea();if("edit"===H)if(fa&& +fa.length)q=fa,fa=null,ka();else if(q.length){var a=q.pop();ja.push([a]);ka()}};this.N=function(){ea();"edit"===H&&ja.length&&(q=q.concat(ja.pop()),ka())};this.T=function(){ea();0!=q.length&&("play"==H?(H=ma,clearTimeout(ha),ka()):(ma=H,H="play",m.clearRect(0,0,u.width,u.height),m.beginPath(),V=0,Ia()))};this.H=function(){return ta()};this.l=function(){G+="_clear start \n";va();G+="_clear end \n"};this.C=function(){ea();G+="_getHandWritingData start \n";if(0>=q.length)return null;var a=navigator.userAgent.match(/\([^\)]*\)[^\(]*\([^\)]*\)\s(.*)/); +a&&0p&&(g[0]|=128),p=g):p=null;e.push.apply(e,p)}c.push.apply(c,b);c.push.apply(c,a);c.push.apply(c,e)}G+="_getHandWritingData end \n";return c};this.b=function(){ea();G+="_getHandWritingPng start \n";if(0>=q.length)return null;Ja(m.canvas.width,m.canvas.height);for(var a=m.getImageData(l[0],l[2],l[1]-l[0],l[3]-l[2]),b,c=b=0;cb)return null;G+="_getHandWritingPng end(callback == null) \n"; +b=void 0;b=void 0===b?!1:b;G+="convertImgToBase64URL start \n";c=document.createElement("CANVAS");var d=c.getContext("2d");wa(c,d,a.width,a.height,b);d.putImageData(a,0,0);a=c.toDataURL("image/png");G+="convertImgToBase64URL end \n";return a};this.D=function(a,b,c,d){d=void 0===d?!1:d;if(!(0>=a||0>=b)){var e=this.b();if(2!==(e?e.split(","):"").length)c?c(null):null;else{Ja(m.canvas.width,m.canvas.height);var f=[l[1]-l[0],l[3]-l[2]],g=document.createElement("CANVAS"),n=g.getContext("2d");wa(g,n, +a,b,d);var p=new Image;p.src=e;p.onload=function(){if(f[0]>Math.round(a/b*f[1])){var y=a;var F=Math.round(f[1]/f[0]*a);var D=0;var r=Math.round((b-F)/2)}else F=b,y=Math.round(f[0]/f[1]*b),D=Math.round((a-y)/2),r=0;n.drawImage(p,D/A,r/A,y/A,F/A);D=g.toDataURL("image/png");c?c(D):null}}}};this.I=function(a,b,c,d,e){e=void 0===e?!1:e;if(!(0>=a||0>=b||0>=c.length)){var f=document.createElement("CANVAS"),g=f.getContext("2d");wa(f,g,a,b,e);a=Math.floor(a/d);b=Math.floor(b/Math.ceil(c.length/d));for(e=1;e<= +c.length;e++)g.drawImage(c[e-1],(e-1)%d*a/A,(Math.ceil(e/d)*b-b)/A,a/A,b/A);return f.toDataURL("image/png")}};this.G=function(){var a=G+="userAgent \u4fe1\u606f:"+navigator.userAgent+"\n";G="";return a};this.K=function(a){if(a){var b=0,c=B(w(a,b,2)),d=0;4101J?J=3: +18