function fontsize() { let doc = document.documentelement, resizeevt = "orientationchange" in window ? "orientationchange" : "resize", recalc = function () { let winw = doc.clientwidth, size; if (!winw) return; if(winw <= 480){ size = math.round(winw / 7.5); }else if (winw <= 768) { size = math.round(winw / 10.5); if (size > 65) { size = 65; } } else if(winw <= 1200){ size = math.round(winw / 13); } else if (winw <= 1800) { size = math.round(winw / 16); } else { size = 100; }; doc.style.fontsize = size + 'px'; }; if (!document.addeventlistener) return; window.addeventlistener(resizeevt, recalc, false); document.addeventlistener("domcontentloaded", recalc, false); }; fontsize(); const userbrowser = (function () { const ua = navigator.useragent; const testua = function (regexp) { return regexp.test(ua.tolowercase()) }; let userbrowserclient = function () { let client = ''; if (/(iphone|ipad|ipod|ios)/i.test(ua)) { client = 'ios'; } else if (/(android)/i.test(ua)) { client = 'android'; } else { client = 'pc'; } return client; }; let userbrowsertype = function () { let shell = "none"; let shellvs = "unknow"; if (testua(/micromessenger/g)) { shell = "wechat"; // 微信浏览器 } else if (testua(/qqbrowser/g)) { shell = "qq"; // qq浏览器 } else if (testua(/ubrowser/g)) { shell = "uc"; // uc浏览器 } else if (testua(/qihu 360se/g)) { shell = "360"; // 360浏览器 } else if (testua(/2345explorer/g)) { shell = "2345"; // 2345浏览器 } else if (testua(/metasr/g)) { shell = "sougou"; // 搜狗浏览器 } else if (testua(/lbbrowser/g)) { shell = "liebao"; // 猎豹浏览器 } else if (testua(/maxthon/g)) { shell = "maxthon"; // 遨游浏览器 } return shell }; return { userbrowserclient: userbrowserclient, userbrowsertype: userbrowsertype } })(); function dynamicloadjs(url, callback) { var head = document.getelementsbytagname('head')[0]; var script = document.createelement('script'); script.type = 'text/javascript'; script.src = url; script.defer = 'defer'; if (typeof (callback) === 'function') { script.onload = script.onreadystatechange = function () { if (!this.readystate || this.readystate === 'loaded' || this.readystate === 'complete') { callback(); script.onload = script.onreadystatechange = null; } } } head.appendchild(script); } if (userbrowser.userbrowserclient() == 'pc') { try { eval('()=>{}'); } catch (eo) { dynamicloadjs("js/polyfill/polyfill.min.js"); }; };