filesbox/web/dist/design/designstatic/home/js/home.js

12 lines
31 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent))document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/waphome/js/module.js"></script>');else{let h=function(o){var s=document.createElement("div"),t=document.createTextNode(o);return s.appendChild(t),s.innerHTML},C=function(o,s){switch(o){case 0:return s?"\u661F\u671F\u5929":"sunday";case 1:return s?"\u661F\u671F\u4E00":"monday";case 2:return s?"\u661F\u671F\u4E8C":"Tuesday";case 3:return s?"\u661F\u671F\u4E09":"Wednesday";case 4:return s?"\u661F\u671F\u56DB":"Thursday";case 5:return s?"\u661F\u671F\u4E94":"Friday";case 6:return s?"\u661F\u671F\u516D":"saturday"}},S=function(o,s){if(new Date(parseInt(o))=="Invalid Date"&&new Date(parseInt(o)*1e3)=="Invalid Date")return"--";new Date(parseInt(s))=="Invalid Date"&&new Date(parseInt(s)*1e3)=="Invalid Date"&&(s=Date.parse(new Date));var t=s-o;if(t<0)return"\u521A\u521A";if(t<6e4)return parseInt(t/1e3,10)+" \u79D2\u524D";if(t<3600*1e3)return parseInt(t/1e3/60,10)+" \u5206\u949F\u524D";if(t<24*3600*1e3)return parseInt(t/1e3/3600,10)+" \u5C0F\u65F6\u524D";if(t<30*24*3600*1e3)return parseInt(t/1e3/3600/24,10)+" \u5929\u524D";var a=new Date(parseInt(o)),e=parseInt(a.getMonth()+1)<10?"0"+(a.getMonth()+1):a.getMonth()+1,n=parseInt(a.getDate())<10?"0"+a.getDate():a.getDate(),i=parseInt(a.getHours())<10?"0"+a.getHours():a.getHours(),r=parseInt(a.getMinutes())<10?"0"+a.getMinutes():a.getMinutes();return a.getFullYear()+"-"+e+"-"+n+"-"+i+"-"+r},v=function(o,s,t){var a=this,e=document.createElement("script");e.type="text/javascript",e.readyState?e.onreadystatechange=function(){(e.readyState=="loaded"||e.readyState=="complete")&&(e.onreadystatechange=null,s.bind(a)(t))}:e.onload=function(){s.bind(a)(t)},e.src=o,document.body.appendChild(e)},g=function(o){for(var s=window.location.search.substring(1),t=s.split("&"),a=0;a<t.length;a++){var e=t[a].split("=");if(e[0]==o)return e[1]}return!1};var escape=h,getWeek=C,getTimeZhCN=S,loadScriptmin=v,getQueryVariable=g;-[1]||(location.href="/pages/nocompatible.html"),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/ase.min.js"></script>'),document.write('<link rel="stylesheet" href="/design/designstatic/design/css/select2.min.css">'),document.write('<script type="text/javascript" charset="utf-8" src="/js/ddlogin.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/js/wwlogin.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/js/wxlogin.js"></script>'),document.write('<link rel="stylesheet" href="/design/designstatic/common/css/user.css">'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/layer/layer.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/common/js/jquery.qrcode.min.js"></script>');var scriptUrl="/design/designstatic/common/js/user.js";v(scriptUrl,function(){var o=window.user,s={loginCount:0,init:function(){if(g("errorCode")){var t=parseInt(g("errorCode")),a="";switch(t){case 602:a="\u975E\u7F51\u6821\u7528\u6237\u7981\u6B62\u767B\u5F55";break;case 606:a="\u5F53\u524D\u8D26\u53F7\u4E0D\u5B58\u5728";break;case 509:a="\u5DF2\u5F00\u542F\u8BBE\u5907\u9650\u5236\uFF0C\u60A8\u53EA\u80FD\u5728\u56FA\u5B9A\u8BBE\u5907\u4E0A\u8FDB\u884C\u767B\u5F55";break;case 601:a="\u5DF2\u7ED1\u5B9A\u5176\u4ED6\u8D26\u53F7";break;case 602:a="\u7528\u6237\u8D26\u53F7\u88AB\u9501\u5B9A";break;case 606:a="\u7528\u6237\u8D26\u53F7\u88AB\u5220\u9664";break;case 707:a="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break;case 709:a="\u975E\u7F51\u6821\u7528\u6237\u4E0D\u80FD\u8FDB\u5165";break}a&&(window.layer?window.layer.msg(a,{icon:5}):alert(a)),window.history.replaceState&&window.history.replaceState(null,null,"/")}var e=this,n=localStorage.getItem("ap");if(n&&JSON.parse(unescape(n)).time-Date.parse(new Date)<1e4){var i=JSON.parse(unescape(n));o.login(i.a,i.p,function(r){r.success&&e.getLoginUser()})}else e.getLoginUser();e.handleBtn(),e.ha
<option value="zh-CN">CN \u7B80\u4F53\u4E2D\u6587</option>
<option value="zh-TW">HK \u7E41\u9AD4\u4E2D\u6587</option>
<option value="en-US">US English</option>
<option value="ja-JP">JP \u65E5\u672C\u8A9E</option>
<option value="fr-FR">FR Fran\xE7ais</option>
<option value="es-ES">ES Espa\xF1ol</option>
<option value="ru-RU">RU Ruso</option>
<option value="it-IT">IT Italia</option>
</select>`);var y=$(".languageBox .language").select2({minimumResultsForSearch:-1,width:"100%"});y.val([localStorage.getItem("umi_locale")||"zh-CN"]).trigger("change")},200)}),t.on("keydown",function(y){y.keyCode==13&&t.find(".submit").click()}),t.find(".submit").on("click",function(){var y=e.find("input").val(),x=n.find("input").val();if(e.find(".tip").remove(),n.find(".tip").remove(),!y)return e.append('<span class="tip" style="margin-left: 39px;display: block;color: red;font-size: 14px;">\u8BF7\u8F93\u5165\u8D26\u53F7</span>'),!1;if(!x)return n.append('<span class="tip" style="margin-left: 39px;display: block;color: red;font-size: 14px;">\u8BF7\u8F93\u5165\u5BC6\u7801</span>'),!1;o.login(y,x,function(m){if(m.success)a.getLoginUser(!0);else{var w=t.find(".password"),b=m.message;switch(parseInt(m.code)){case 200:b="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165";break;case 400:b="\u8BE5\u7F51\u6821\u9700\u8981\u4F7F\u7528\u9501\u5C4F\u6D4F\u89C8\u5668\u767B\u5F55";break;case 403:b="\u8D26\u53F7\u7C7B\u578B\u4E0D\u6B63\u786E";break;case 503:b="\u5DF2\u88AB\u9650\u5236\u767B\u5F55";break;case 707:b="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break}if(m.success){var k=m.data;if(k){var E=k.errCode;E=="4012"?b="\u8D85\u8FC7\u9650\u5236\u6B21\u6570"+k.limitCount+"\u6B21\uFF0C\u8BF7"+k.denyTime/60+"\u5206\u949F\u540E\u91CD\u8BD5":b="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}else b="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}w.append('<span class="tip" style="margin-left: 39px;display: block;color: red;font-size: 14px; float\uFF1Aleft; line-height: 30px;">'+b+"</span>")}})})},handleClickHref:function(){var t=this,a=$(".module[data-clickhref][data-type=group]");a.on("click",function(e){designUploadPoint($(this));for(var n=$(e.target),i=n.parents(),r=!0,d=0,c=i.length;d<c;d++){var f=i.eq(d);if(n.attr("href")||f.attr("href")||f.attr("data-handle")){r=!1;break}}if(r){var u=$(this),l=u.attr("data-clickhref");if(l.indexOf("/aroom/#")>-1||l.indexOf("/myroom/#")>-1||l.indexOf("/pay/#")>-1){var p=window.user,y=function(m){m=="STUDENT"?l.indexOf("/pay/#")>-1?window.location.href=l.indexOf("/pay/#/")>-1?l:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=l.indexOf("/myroom/#/")>-1?l:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=l.indexOf("/aroom/#/")>-1?l:window.basePath?"/"+window.basePath+"#/":"/#/"},x=function(){p.loginLayer(function(m){m.success&&p.isLogin(function(w){w.success&&y(w.data.userTypeExact)})})};getCookie("token")||getCookie("stoken")?p.isLogin(function(m){m.success?y(m.data.userTypeExact):x()}):x()}else u.attr("data-clicktarget")=="_blank"?location.open=l:location.href=l}})},handleBtn:function(){for(var t=this,a=$(".module[data-handle=login]"),e=0,n=a.length;e<n;e++){var i=a.eq(e);t.bindLoginBtnEvent(i)}for(var r=$(".module[data-type=registerLogin] .loginEvent"),e=0,n=r.length;e<n;e++){var i=r.eq(e);t.bindLoginBtnEvent(i)}for(var d=$(".module[data-handle=register]"),e=0,n=d.length;e<n;e++){var i=d.eq(e);t.bindRegisterEvent(i)}for(var c=$(".module[data-type=registerLogin] .registerEvent"),e=0,n=c.length;e<n;e++){var i=c.eq(e);t.bindRegisterEvent(i)}for(var f=$(".module[data-handle=registerSchool]"),e=0,n=f.length;e<n;e++){var i=f.eq(e);t.bindRegisterSchoolEvent(i)}for(var u=$(".module[data-handle=QQlogin]"),e=0,n=u.length;e<n;e++){var i=u.eq(e);t.bindQQloginEvent(i)}for(var l=$(".module[data-handle=wechatLogin]"),e=0,n=l.length;e<n;e++){var i=l.eq(e);t.bindWechatLoginEvent(i)}for(var p=$(".module[data-handle=enwechatLogin]"),e=0,n=p.length;e<n;e++){var i=p.eq(e);t.bindenWechatLoginEvent(i)}for(var y=$(".module[data-handle=dingdingLogin]"),e=0,n=y.length;e<n;e++){var i=y.eq(e);t.binddingdingLoginEvent(i)}for(var x=$(".module[data-handle=appLogin]"),e=0,n=x.length;e<n;e++){var i=x.eq(e);t.bindappLoginEvent(i)}for(var m=$(".module[data-handle=dialogBtn]"),e=0,n=m.length;e<n;e++){var i=m.eq(e);t.binddialogEvent(i)}for(var w=$(".module[data-handle=weiboL
`);for(var g="",o=0;o<v.length;o++){var s=v.charCodeAt(o);s<128?g+=String.fromCharCode(s):s>127&&s<2048?(g+=String.fromCharCode(s>>6|192),g+=String.fromCharCode(s&63|128)):(g+=String.fromCharCode(s>>12|224),g+=String.fromCharCode(s>>6&63|128),g+=String.fromCharCode(s&63|128))}return g},S=function(v){for(var g="",o=0,s=0,t=0,a=0,e=0;o<v.length;)s=v.charCodeAt(o),s<128?(g+=String.fromCharCode(s),o++):s>191&&s<224?(a=v.charCodeAt(o+1),g+=String.fromCharCode((s&31)<<6|a&63),o+=2):(a=v.charCodeAt(o+1),e=v.charCodeAt(o+2),g+=String.fromCharCode((s&15)<<12|(a&63)<<6|e&63),o+=3);return g}}