|
|
|
@@ -12,4 +12,4 @@
|
|
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
***************************************************************************** */var e,i=function(){return(i=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function o(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{h(o.next(t))}catch(t){n(t)}}function a(t){try{h(o.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}h((o=o.apply(t,e||[])).next())}))}function r(t,e){var i,o,r,n,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,o&&(r=2&n[0]?o.return:n[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,n[1])).done)return r;switch(o=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){s.label=n[1];break}if(6===n[0]&&s.label<r[1]){s.label=r[1],r=n;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(n);break}r[2]&&s.ops.pop(),s.trys.pop();continue}n=e.call(t,s)}catch(t){n=[6,t],o=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}var n={upx2px:function(t){return window.innerWidth/750*t},getSystemInfoSync:function(){return{screenWidth:window.innerWidth}},getImageInfo:function(t){var e=t.src,i=t.success,o=t.fail,r=new Image;r.onload=function(){i({width:this.naturalWidth,height:this.naturalHeight,path:this.src,src:e})},r.onerror=o,r.src=e}},s="object"==typeof swan?"mp-baidu":"object"==typeof tt?"mp-toutao":"object"==typeof plus?"plus":"object"==typeof window?"undefined"==typeof uni||"undefined"!=typeof uni&&!(null===uni||void 0===uni?void 0:uni.addInterceptor)?"web":"h5":"mp-weixin",a="mp-weixin"==s?wx:"mp-toutao"==s?tt:"undefined"!=typeof uni?uni.upx2px?uni:Object.assign(uni,n):"undefined"!=typeof window?n:uni;if(!a.upx2px){var h=(null!==(e=a.getSystemInfoSync().screenWidth)&&void 0!==e?e:375)/750;a.upx2px=function(t){return h*t}}function d(t){return/^-?\d+(\.\d+)?$/.test(t)}function l(t,e,i){if("number"==typeof t)return t;if(d(t))return 1*t;if("string"==typeof t){var o=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g.exec(t);if(!t||!o)return 0;var r=o[3];t=parseFloat(t);var n=0;return"rpx"===r?n=a.upx2px(t):"px"===r?n=1*t:"%"===r&&e?n=t*l(e)/100:"em"===r&&e&&(n=t*l(e||14)),i?1*n.toFixed(2):Math.round(n)}return 0}function c(t){var e=this;return new Promise((function(i,n){return o(e,void 0,void 0,(function(){var e,o;return r(this,(function(r){switch(r.label){case 0:if(e=t,"plus"!=s&&!/^mp/.test(s)||!/data:image\/(\w+);base64,(.*)/.test(t))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(h=t,new Promise((function(t,e){var i=/data:image\/(\w+);base64,(.*)/.exec(h)||[],o=i[1];if(i[2],/^mp/.test(s)){var r=a.getFileSystemManager();o||(console.error("ERROR_BASE64SRC_PARSE"),e(new Error("ERROR_BASE64SRC_PARSE")));var n=(new Date).getTime(),d=a.env.USER_DATA_PATH+"/"+n+"."+o;r.writeFile({filePath:d,data:h.replace(/^data:\S+\/\S+;base64,/,""),encoding:"base64",success:function(){t(d)},fail:function(t){console.error("获取base64图片失败",JSON.stringify(t)),e(t)}})}else if("plus"!=s)e(new Error("not support"));else{var l=h.split(",")[0].match(/data\:\S+\/(\S+);/);l?l=l[1]:e(new Error("base64 error"));var c=Date.now()+"."+l,u="_doc",f="uniapp_temp",g="_doc/uniapp_temp/"+c;if(!function(t,e){for(var i=t.split("."),o=e.split("."),r=!1,n=0;n<o.length;n++){var s=i[n]-o[n];if(0!==s){r=s>0;break}}return r}("Android"===plus.os.name?"1.9.9.80627":"1.9.9.80472",plus.runtime.innerVersion))return void plus.io.resolveLocalFileSystemURL(u,(function(i){i.getDirectory(f,{create:!0,exclusive:!1},(function(i){i.getFile(c,{create:!0,exclusive:!1},(function(i){i.createWriter((function(i){var o;i.onwrite=function(){t(g)},i.onerror=e,i.seek(0),i.writeAsBinary((o=h.split(","))[o.length-1])}),e)}),e)}),e)}),e);var v=new plus.nativeObj.Bitmap(c);v.loadBase64Data(h,(function(){v.save(g,{},(function(){v.clear(),t(g)}),(function(t){v.clear(),e(t)}))}),(function(t){v.clear(),e(t)}))}})))];case 2:return e=r.sent(),[3,4];case 3:return o=r.sent(),console.log(o),[3,4];case 4:return a.getImageInfo({src:e,success:function(t){return i(t)},fail:function(t){return n(t)}}),[2]}var h}))}))}))}var u=function(t){return!(!t||!t.startsWith("linear")&&!t.startsWith("radial"))},f=function(t,e,i,o,r,n){t.startsWith("linear")?function(t,e,i,o,r,n){for(var s=function(t,e,i,o,r){void 0===o&&(o=0);void 0===r&&(r=0);var n=t.match(/([-]?\d{1,3})deg/),s=n&&n[1]?Line truncated
|
|
|
|
|
***************************************************************************** */var e,i=function(){return(i=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function o(t,e,i,o){return new(i||(i=Promise))((function(r,n){function s(t){try{h(o.next(t))}catch(t){n(t)}}function a(t){try{h(o.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}h((o=o.apply(t,e||[])).next())}))}function r(t,e){var i,o,r,n,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function a(n){return function(a){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,o&&(r=2&n[0]?o.return:n[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,n[1])).done)return r;switch(o=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){s.label=n[1];break}if(6===n[0]&&s.label<r[1]){s.label=r[1],r=n;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(n);break}r[2]&&s.ops.pop(),s.trys.pop();continue}n=e.call(t,s)}catch(t){n=[6,t],o=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,a])}}}var n={upx2px:function(t){return window.innerWidth/750*t},getSystemInfoSync:function(){return{screenWidth:window.innerWidth}},getImageInfo:function(t){var e=t.src,i=t.success,o=t.fail,r=new Image;r.onload=function(){i({width:this.naturalWidth,height:this.naturalHeight,path:this.src,src:e})},r.onerror=o,r.src=e}},s="object"==typeof swan?"mp-baidu":"object"==typeof tt?"mp-toutao":"object"==typeof plus?"plus":"object"==typeof window?"undefined"==typeof uni||"undefined"!=typeof uni&&!(null===uni||void 0===uni?void 0:uni.addInterceptor)?"web":"h5":"mp-weixin",a="mp-weixin"==s?wx:"mp-toutao"==s?tt:"undefined"!=typeof uni?uni.upx2px?uni:Object.assign(uni,n):"undefined"!=typeof window?n:uni;if(!a.upx2px){var h=(null!==(e=a.getSystemInfoSync().screenWidth)&&void 0!==e?e:375)/750;a.upx2px=function(t){return h*t}}function d(t){return/^-?\d+(\.\d+)?$/.test(t)}function l(t,e,i){if("number"==typeof t)return t;if(d(t))return 1*t;if("string"==typeof t){var o=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g.exec(t);if(!t||!o)return 0;var r=o[3];t=parseFloat(t);var n=0;return"rpx"===r?n=a.upx2px(t):"px"===r?n=1*t:"%"===r&&e?n=t*l(e)/100:"em"===r&&e&&(n=t*l(e||14)),i?1*n.toFixed(2):Math.round(n)}return 0}function c(t){var e=this;return new Promise((function(i,n){return o(e,void 0,void 0,(function(){var e,o;return r(this,(function(r){switch(r.label){case 0:if(e=t,"plus"!=s&&!/^mp/.test(s)||!/data:image\/(\w+);base64,(.*)/.test(t))return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,(h=t,new Promise((function(t,e){var i=/data:image\/(\w+);base64,(.*)/.exec(h)||[],o=i[1];if(i[2],/^mp/.test(s)){var r=a.getFileSystemManager();o||(console.error("ERROR_BASE64SRC_PARSE"),e(new Error("ERROR_BASE64SRC_PARSE")));var n=(new Date).getTime(),d=a.env.USER_DATA_PATH+"/"+n+"."+o;r.writeFile({filePath:d,data:h.replace(/^data:\S+\/\S+;base64,/,""),encoding:"base64",success:function(){t(d)},fail:function(t){console.error("获取base64图片失败",JSON.stringify(t)),e(t)}})}else if("plus"!=s)e(new Error("not support"));else{var l=h.split(",")[0].match(/data\:\S+\/(\S+);/);l?l=l[1]:e(new Error("base64 error"));var c=Date.now()+"."+l,u="_doc",f="uniapp_temp",g="_doc/uniapp_temp/"+c;if(!function(t,e){for(var i=t.split("."),o=e.split("."),r=!1,n=0;n<o.length;n++){var s=i[n]-o[n];if(0!==s){r=s>0;break}}return r}("Android"===plus.os.name?"1.9.9.80627":"1.9.9.80472",plus.runtime.innerVersion))return void plus.io.resolveLocalFileSystemURL(u,(function(i){i.getDirectory(f,{create:!0,exclusive:!1},(function(i){i.getFile(c,{create:!0,exclusive:!1},(function(i){i.createWriter((function(i){var o;i.onwrite=function(){t(g)},i.onerror=e,i.seek(0),i.writeAsBinary((o=h.split(","))[o.length-1])}),e)}),e)}),e)}),e);var v=new plus.nativeObj.Bitmap(c);v.loadBase64Data(h,(function(){v.save(g,{},(function(){v.clear(),t(g)}),(function(t){v.clear(),e(t)}))}),(function(t){v.clear(),e(t)}))}})))];case 2:return e=r.sent(),[3,4];case 3:return o=r.sent(),console.log(o),[3,4];case 4:return a.getImageInfo({src:e,success:function(t){return i(t)},fail:function(t){return n(t)}}),[2]}var h}))}))}))}var u=function(t){return!(!t||!t.startsWith("linear")&&!t.startsWith("radial"))},f=function(t,e,i,o,r,n){t.startsWith("linear")?function(t,e,i,o,r,n){for(var s=function(t,e,i,o,r){void 0===o&&(o=0);void 0===r&&(r=0);var n=t.match(/([-]?\d{1,3})deg/),s=n&&n[1]?Line truncated
|