(function(e){function a(a){for(var o,i,c=a[0],s=a[1],g=a[2],p=0,u=[];p0&&t<=127)a.push(e.charAt(o));else if(t>=128&&t<=2047){var r=192|t>>6&31,i=128|63&t;a.push(String.fromCharCode(r),String.fromCharCode(i))}else if(t>=2048&&t<=65535){r=224|t>>12&15,i=128|t>>6&63;var c=128|63&t;a.push(String.fromCharCode(r),String.fromCharCode(i),String.fromCharCode(c))}}return a.join("")},UTF8ToUTF16:function(e){var a=[],n=e.length,o=0;for(o=0;o>7&255))a.push(e.charAt(o));else if(6==(t>>5&255)){var r=e.charCodeAt(++o),i=(31&t)<<6,c=63&r,s=i|c;a.push(Sting.fromCharCode(s))}else if(14==(t>>4&255)){r=e.charCodeAt(++o);var g=e.charCodeAt(++o);i=t<<4|r>>2&15,c=(3&r)<<6|63&g;s=(255&i)<<8|c,a.push(String.fromCharCode(s))}}return a.join("")},encode:function(e){if(!e)return"";var a=this.UTF16ToUTF8(e),n=0,o=a.length,t=[];while(n>2]),n==o){t.push(this.table[(3&r)<<4]),t.push("==");break}var i=a.charCodeAt(n++);if(n==o){t.push(this.table[(3&r)<<4|i>>4&15]),t.push(this.table[(15&i)<<2]),t.push("=");break}var c=a.charCodeAt(n++);t.push(this.table[(3&r)<<4|i>>4&15]),t.push(this.table[(15&i)<<2|(192&c)>>6]),t.push(this.table[63&c])}return t.join("")},decode:function(e){if(!e)return"";var a=e.length,n=0,o=[];while(n>4,g=(15&r)<<4|i>>2,d=(3&i)<<6|c;o.push(String.fromCharCode(s)),64!=i&&o.push(String.fromCharCode(g)),64!=c&&o.push(String.fromCharCode(d))}return this.UTF8ToUTF16(o.join(""))}};e.exports={HOST:r,formatTime:function(e){var a=e.getFullYear(),n=e.getMonth()+1,o=e.getDate();return[a,n,o].map(i).join("-")},formatTimeAll:function(e){var a=e.getFullYear(),n=e.getMonth()+1,o=e.getDate(),t=e.getHours(),r=e.getMinutes(),c=e.getSeconds();return[a,n,o].map(i).join("-")+" "+[t,r,c].map(i).join(":")},formatNumber:i,alert:c,getfile:function(e,a,n){var o=uni.getStorageSync("userInfo").access_token,t=r+"manager/get-attachment/"+e+"?token="+o;a(t)},request:s,uploadFormID:function(e){Math.floor((new Date).getTime()/1e3);s({api:"WeChat/SaveFormID",method:"POST",data:{FormIDs:e},utilSuccess:function(e){console.log("上传formID成功")},utilFail:function(e){console.log("上传formID失败")}})},payOrder:function(e,a,n,o){uni.request({url:r+"WxPay/ToPay?openId="+uni.getStorageSync("userInfo").WeChatOpenID+"&orderId="+e+"&OrderType="+a,method:"GET",header:{"content-type":"application/json"},success:function(t){if(""!=t.data){var r=t.data.replace(/\\/g,"");t.data=JSON.parse(r);var i=t.data.package.indexOf("=")+1,c=t.data.package.substring(i);uni.requestPayment({timeStamp:t.data.timeStamp,nonceStr:t.data.nonceStr,package:t.data.package,signType:t.data.signType,paySign:t.data.paySign,success:function(o){n(o),s({api:"WxPay/PayTemplateMsg",data:{prepay_id:c,orderId:e,isSuccess:1,failMsg:"",xType:a}})},fail:function(n){o(n);var t="requestPayment:fail cancel"==n?"用户取消支付":n;s({api:"WxPay/PayTemplateMsg",data:{prepay_id:c,orderId:e,isSuccess:0,failMsg:t,xType:a}})}})}else o("当前网络状况不好")},fail:function(e){o("当前网络状况不好")}})},scanPay:function(e,a,n,o,t,i){var s=uni.getStorageSync("userInfo").access_token;console.log("1.支付进入");var g={token:s,order_id:e,money:a,auth_code:n,type:o};console.log("2.参数"),console.log(g),uni.showLoading({title:"正在加载"}),uni.request({url:r+"manager/scan-pay/"+e,method:"POST",data:{token:s,order_id:e,money:a,auth_code:n,type:o},header:{"content-type":"application/json"},success:function(e){uni.hideLoading(),d(e.data.errorcode)?(t(e),console.log("3.支付成功"),console.log(e)):(c("支付失败:"+e.data.errormsg),console.log("4.支付失败"),console.log(e))},fail:function(e){i("当前网络状况不好"),console.log("4.支付失败"),console.log(res)}})},isLogin:g,isNull:d,phoneRegex:/^1\d{10}$/,idCardRegex:p,filterSpecialChars:function(e){return e.replace(/[^\u4e00-\u9fa5a-zA-Z0-9\w]/g,"")},randomStr:function(e){for(var a="",n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],o=0;o>16)+(a>>16)+(n>>16)<<16|65535&n}function i(e,a,n,o,t,i){return r(function(e,a){return e<>>32-a}(r(r(a,e),r(o,i)),t),n)}function c(e,a,n,o,t,r,c){return i(a&n|~a&o,e,a,t,r,c)}function s(e,a,n,o,t,r,c){return i(a&o|n&~o,e,a,t,r,c)}function g(e,a,n,o,t,r,c){return i(a^n^o,e,a,t,r,c)}function d(e,a,n,o,t,r,c){return i(n^(a|~o),e,a,t,r,c)}function p(e,a){e[a>>5]|=128<>>9<<4)]=a;var n,o,t,i,p,u=1732584193,l=-271733879,f=-1732584194,m=271733878;for(n=0;n>5]>>>a%32&255);return n}function l(e){var a,n=[];for(n[(e.length>>2)-1]=void 0,a=0;a>5]|=(255&e.charCodeAt(a/8))<>>4&15)+"0123456789abcdef".charAt(15&a);return o}function m(e){return unescape(encodeURIComponent(e))}function b(e){return function(e){return u(p(l(e),8*e.length))}(m(e))}function y(e,a){return function(e,a){var n,o,t=l(e),r=[],i=[];for(r[15]=i[15]=void 0,t.length>16&&(t=p(t,8*e.length)),n=0;n<16;n+=1)r[n]=909522486^t[n],i[n]=1549556828^t[n];return o=p(r.concat(l(a)),512+8*a.length),u(p(i.concat(o),640))}(m(e),m(a))}function h(e,a,n){return a?n?y(a,e):function(e,a){return f(y(e,a))}(a,e):n?b(e):function(e){return f(b(e))}(e)}o=function(){return h}.call(a,n,a,e),void 0===o||(e.exports=o)}()}});