1 |
- function y(l){let e=new Date(l),i=e.getFullYear(),r=("0"+(e.getMonth()+1)).slice(-2),a=("0"+e.getDate()).slice(-2),c=("0"+e.getHours()).slice(-2),t=("0"+e.getMinutes()).slice(-2),n=("0"+e.getSeconds()).slice(-2);return i+"-"+r+"-"+a+" "+c+":"+t+":"+n}function E(l){var e=new Date(l*1e3);console.log(e);let i=e.getFullYear(),r=("0"+(e.getMonth()+1)).slice(-2),a=("0"+e.getDate()).slice(-2),c=("0"+e.getHours()).slice(-2),t=("0"+e.getMinutes()).slice(-2),n=("0"+e.getSeconds()).slice(-2);return i+"-"+r+"-"+a+" "+c+":"+t+":"+n}function F(l,e){if(l){const i=new Date(l),r={"M+":i.getMonth()+1,"d+":i.getDate(),"H+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:i.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(i.getFullYear()+"").substr(4-RegExp.$1.length)));for(const a in r)new RegExp("("+a+")").test(e)&&(e=e.replace(RegExp.$1,RegExp.$1.length===1?r[a]:("00"+r[a]).substr((""+r[a]).length)));return e}else return""}(function(l,e){var i=l.document,r=i.documentElement,a=i.querySelector('meta[name="viewport"]'),c=i.querySelector('meta[name="flexible"]'),t=0,n=0,d,m=e.flexible||(e.flexible={});if(a){console.warn("将根据已有的meta标签来设置缩放比例");var p=a.getAttribute("content").match(/initial-scale=([d.]+)/);p&&(n=parseFloat(p[1]),t=parseInt(1/n))}else if(c){var f=c.getAttribute("content");if(f){var g=f.match(/initial-dpr=([d.]+)/),h=f.match(/maximum-dpr=([d.]+)/);g&&(t=parseFloat(g[1]),n=parseFloat((1/t).toFixed(2))),h&&(t=parseFloat(h[1]),n=parseFloat((1/t).toFixed(2)))}}if(!t&&!n){var b=l.navigator.appVersion.match(/iphone/gi),v=l.devicePixelRatio;b?v>=3&&(!t||t>=3)?t=3:v>=2&&(!t||t>=2)?t=2:t=1:t=1,n=1/t}if(r.setAttribute("data-dpr",t),!a)if(a=i.createElement("meta"),a.setAttribute("name","viewport"),a.setAttribute("content","initial-scale="+n+", maximum-scale="+n+", minimum-scale="+n+", user-scalable=no"),r.firstElementChild)r.firstElementChild.appendChild(a);else{var x=i.createElement("div");x.appendChild(a),i.write(x.innerHTML)}function u(){var s=r.getBoundingClientRect().width;s/t>1920&&(s=r.clientWidth/1920*1920);var o=s/10;r.style.fontSize=o+"px",m.rem=l.rem=o}l.addEventListener("resize",function(){clearTimeout(d),d=setTimeout(u,300)},!1),l.addEventListener("pageshow",function(s){s.persisted&&(clearTimeout(d),d=setTimeout(u,300))},!1),i.readyState==="complete"?i.body.style.fontSize=12*t+"px":i.addEventListener("DOMContentLoaded",function(){i.body.style.fontSize=12*t+"px"},!1),u(),m.dpr=l.dpr=t,m.refreshRem=u,m.rem2px=function(s){var o=parseFloat(s)*this.rem;return typeof s=="string"&&s.match(/rem$/)&&(o+="px"),o},m.px2rem=function(s){var o=parseFloat(s)/this.rem;return typeof s=="string"&&s.match(/px$/)&&(o+="rem"),o}})(window,window.lib||(window.lib={}));const M=""+new URL("Group1317-4cf88ce2.png",import.meta.url).href;export{y as a,M as d,F as f,E as t};
|