filesbox/web/dist/design/designstatic/newJS/home/home.js
2024-07-26 14:10:54 +08:00

12 lines
33 KiB
JavaScript

window.tsnfors=getPar("targetServerNameForOverride")||getPar("host")?"?targetServerNameForOverride="+(getPar("targetServerNameForOverride")||getPar("host")):"";function getPar(y,I){var S=I||document.location.href,v=S.indexOf(y+"=");if(v==-1)return"";var f=S.slice(y.length+v+1),p=f.indexOf("&");return p!=-1&&(f=f.slice(0,p)),f}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?my_version="></script>');else{let y=function(o,d){var t=document.createElement("script");t.type="text/javascript",t.readyState?t.onreadystatechange=function(){(t.readyState=="loaded"||t.readyState=="complete")&&(t.onreadystatechange=null,d(window.wxFocus))}:t.onload=function(){d(window.wxFocus)},t.src=o,document.body.appendChild(t)},I=function(o){var d=document.createElement("div"),t=document.createTextNode(o);return d.appendChild(t),d.innerHTML},S=function(o,d){switch(o){case 0:return d?"\u661F\u671F\u5929":"sunday";case 1:return d?"\u661F\u671F\u4E00":"monday";case 2:return d?"\u661F\u671F\u4E8C":"Tuesday";case 3:return d?"\u661F\u671F\u4E09":"Wednesday";case 4:return d?"\u661F\u671F\u56DB":"Thursday";case 5:return d?"\u661F\u671F\u4E94":"Friday";case 6:return d?"\u661F\u671F\u516D":"saturday"}},v=function(o,d){if(new Date(parseInt(o))=="Invalid Date"&&new Date(parseInt(o)*1e3)=="Invalid Date")return"--";new Date(parseInt(d))=="Invalid Date"&&new Date(parseInt(d)*1e3)=="Invalid Date"&&(d=Date.parse(new Date));var t=d-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 n=new Date(parseInt(o)),e=parseInt(n.getMonth()+1)<10?"0"+(n.getMonth()+1):n.getMonth()+1,a=parseInt(n.getDate())<10?"0"+n.getDate():n.getDate(),i=parseInt(n.getHours())<10?"0"+n.getHours():n.getHours(),r=parseInt(n.getMinutes())<10?"0"+n.getMinutes():n.getMinutes();return n.getFullYear()+"-"+e+"-"+a+"-"+i+"-"+r},f=function(o,d,t){var n=this,e=document.createElement("script");e.type="text/javascript",e.readyState?e.onreadystatechange=function(){(e.readyState=="loaded"||e.readyState=="complete")&&(e.onreadystatechange=null,d.bind(n)(t))}:e.onload=function(){d.bind(n)(t)},e.src=o,document.body.appendChild(e)},p=function(o){for(var d=window.location.search.substring(1),t=d.split("&"),n=0;n<t.length;n++){var e=t[n].split("=");if(e[0]==o)return e[1]}return!1},h=function(){var o=!!$("#bgVideoBox").html();if(o){var d=$("#recordNumber"),t=d.find("p");d.css({position:"fixed",bottom:0,height:"auto",width:"100%",backgroundColor:"#fff"}),t.css({marginBottom:0,lineHeight:"16px"})}};var loadWxFocusScript=y,escape=I,getWeek=S,getTimeZhCN=v,loadScriptmin=f,getQueryVariable=p,bgVideoBox=h;-[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/common/css/user.css?my_version=">'),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('<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?my_version=",wxFocusUrl="/design/designstatic/common/js/wxFocus.js";f(scriptUrl,function(){var o=window.user,d={loginCount:0,init:function(){if(p("errorCode")){var t=parseInt(p("errorCode")),n="";switch(t){case 602:n="\u975E\u7F51\u6821\u7528\u6237\u7981\u6B62\u767B\u5F55";break;case 606:n="\u5F53\u524D\u8D26\u53F7\u4E0D\u5B58\u5728";break;case 509:n="\u5DF2\u5F00\u542F\u8BBE\u5907\u9650\u5236\uFF0C\u60A8\u53EA\u80FD\u5728\u56FA\u5B9A\u8BBE\u5907\u4E0A\u8FDB\u884C\u767B\u5F55";break;case 601:n="\u5DF2\u7ED1\u5B9A\u5176\u4ED6\u8D26\u53F7";break;case 602:n="\u7528\u6237\u8D26\u53F7\u88AB\u9501\u5B9A";break;case 606:n="\u7528\u6237\u8D26\u53F7\u88AB\u5220\u9664";break;case 707:n="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break;case 709:n="\u975E\u7F51\u6821\u7528\u6237\u4E0D\u80FD\u8FDB\u5165";break}n&&(window.layer?window.layer.msg(n,{icon:5}):alert(n)),window.history.replaceState&&window.history.replaceState(null,null,"/")}var e=this,a=localStorage.getItem("ap");if(a&&JSON.parse(unescape(a)).time-Date.parse(new Date)<1e4){var i=JSON.parse(unescape(a));o.login(i.a,i.p,function(r){r.success&&e.getLoginUser()})}else e.getLoginUser();e.handleBtn(),e.handleClickHref(),e.bindGoBuyCar()},getLoginUser:function(t,n){var e=this;getCookie("token")?o.isLogin(function(a){if(a.success){e.loginUserData=a.data,window.loginUserResponse=a,e.login(a.data,a.timeStamp);var i=window.location;if(t)if(p("redirect"))$("body").append('<div style="position: fixed;top:0;left:0;width:100%;height: 100%;background-color: rgba(0,0,0,.65); z-index: 1000;"><div style="position: absolute;top: 50%;left: 50%;width:200px;height:32px;margin-left: -100px;margin-top: -16px;line-height:32px;color:#efefef;text-align:center;">\u6B63\u5728\u8DF3\u8F6C\u4E2D\u3002\u3002\u3002</div></div>'),setTimeout(function(){i.href=p("redirect")},100);else if(i.pathname=="/"){var r=$('.module[data-jump="1"]').length>0;r?i.reload():($("body").append('<div style="position: fixed;top:0;left:0;width:100%;height: 100%;background-color: rgba(0,0,0,.65); z-index: 1000;"><div style="position: absolute;top: 50%;left: 50%;width:200px;height:32px;margin-left: -100px;margin-top: -16px;line-height:32px;color:#efefef;text-align:center;">\u6B63\u5728\u8DF3\u8F6C\u4E2D\u3002\u3002\u3002</div></div>'),a.data.userTypeExact=="STUDENT"?setTimeout(function(){i.href=window.basePath?"/"+window.basePath+"#/":"/#/"},100):setTimeout(function(){i.href=window.basePath?"/"+window.basePath+"#/":"/#/"},100))}else i.reload()}else e.unlogin(!0);e.realName(a.timeStamp)}):(e.unlogin(),e.realName())},carryStorageLogin:function(){var t=this;if(localStorage.isSaveAPWordKey&&window.CryptoJS&&window.decrypt&&t.loginCount<2){t.loginCount++;var n=decrypt(localStorage.isSaveAPWordKey),e=JSON.parse(n),a=e.a,i=e.b,r=+e.t;Date.now()-r<3600*1e3*24*10&&o.login(a,i,function(c){if(c.success)t.getLoginUser(!0);else{var s=c.message;switch(parseInt(c.code)){case 200:s="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165";break;case 400:s="\u8BE5\u7F51\u6821\u9700\u8981\u4F7F\u7528\u9501\u5C4F\u6D4F\u89C8\u5668\u767B\u5F55";break;case 403:s="\u8D26\u53F7\u7C7B\u578B\u4E0D\u6B63\u786E";break;case 503:s="\u5DF2\u88AB\u9650\u5236\u767B\u5F55";break;case 707:s="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break}if(c.success){var l=c.data;if(l){var u=l.errCode;u=="4012"?s="\u8D85\u8FC7\u9650\u5236\u6B21\u6570"+l.limitCount+"\u6B21\uFF0C\u8BF7"+l.denyTime/60+"\u5206\u949F\u540E\u91CD\u8BD5":s="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}else s="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}window.layer?layer.msg(s,{icon:1}):alert(s)}})}},realName:function(t){var n=this,e=t?parseInt(t):Date.parse(new Date),a;n.nowTime(e);var i=new Date(e).getMinutes(),r=(60-i)*1e3;setTimeout(function(){e=e+r,n.nowTime(e),a=setInterval(function(){e=e+6e4,n.nowTime(e),n.minutes||clearInterval(a)},6e4)},r),a=setInterval(function(){e=e+6e4,n.nowTime(e),n.minutes||clearInterval(a)},6e4)},nowTime:function(t){for(var n=this,e=$(".module[data-type=time]"),a=0,i=e.length;a<i;a++)n.renderTime(t,e.eq(a))},renderTime:function(t,n){var e=this,a=$.parseJSON(n.attr("data-time")),i=new Date(t),r=i.getFullYear(),c=i.getMonth()+1,s=i.getDate(),l=i.getDay(),u=i.getHours()<10?"0"+i.getHours():i.getHours(),g=i.getMinutes()<10?"0"+i.getMinutes():i.getMinutes(),m="";switch(a.timeStyle){case"dayweek":m=r+"\u5E74"+c+"\u6708"+s+"\u65E5"+S(l,!0);break;case"dayhm":m=r+"\u5E74"+c+"\u6708"+s+"\u65E5 "+u+":"+g,e.minutes=!0;break;case"dayweekhm":m=r+"\u5E74"+c+"\u6708"+s+"\u65E5 "+S(l,!0)+" "+u+":"+g,e.minutes=!0;break;case"day":m=r+"-"+c+"-"+s;break;case"ndayhm":m=r+"-"+c+"-"+s+" "+u+":"+g,e.minutes=!0;break;case"endayweek":m=s+"/"+c+"/"+r+" "+S(l,!1);break;case"endayhm":m=s+"/"+c+"/"+r+" "+u+":"+g,e.minutes=!0;break;case"endayweekhm":m=s+"/"+c+"/"+r+" "+S(l,!1)+" "+u+":"+g,e.minutes=!0;break;default:}n.find(".box").html(m)},login:function(t,n){for(var e=this,a=(t==null?void 0:t.user)||{},i=$(".module[data-type=login]"),r=0,c=i.length;r<c;r++){var s=i.eq(r);if(s.attr("data-version")=="freelogin"){e.newLogin(s,t,n);continue}var l=s.attr("data-login")||"",u='<div class="userInfo">'+(l.indexOf("headImg")>-1?'<div class="head"><img src="'+I(a.headPortrait.indexOf("http")>-1?a.headPortrait:(window.cdnPath||"")+a.headPortrait)+'"></div>':"")+(l.indexOf("username")>-1?'<div class="realName">'+I(a.name||a.nickname||"\u4F5A\u540D")+"</div>":"")+(l.indexOf("account")>-1?'<div class="loginname">'+I(a.name)+"</div>":"")+(l.indexOf("lasttime")>-1?'<div class="lastLogin">'+v(a.lastLogin,n)+"</div>":"")+'</div><a href="'+(window.basePath?"/"+window.basePath+"#/":"/#/")+'"><div class="submit" style="margin-top:15px;">\u7ACB\u5373\u8FDB\u5165</div></a><div class="submit quitBtn" style="margin-top:15px;webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);background-color:#fff;color: rgba(0, 0, 0, 0.65); border: 1px solid #d9d9d9;">\u9000\u51FA\u8D26\u53F7</div>';s.html(u)}for(var g=$(".module[data-type=registerLogin]"),m=0,b=g.length;m<b;m++){var s=g.eq(m),C='<div class="box"><a href="'+(window.basePath?"/"+window.basePath+"#/":"/#/")+'" style="margin-right: 5px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;color: inherit;">'+I(a.nickname||t.name||"\u4F5A\u540D")+'</a> | <span style="margin-left: 5px;white-space: nowrap;" class="quitBtn">\u9000\u51FA</span></div>';s.html(C)}$(".quitBtn").on("click",function(){o.loginout(function(w){if(w.success){localStorage.ap="";try{myextension.delphicallback(1401,"")}catch(x){console.log("\u975E\u65E0\u6781\u6D4F\u89C8\u5668")}window.location.reload()}})})},newLogin:function(t,n,e){var a,i=(n==null?void 0:n.user)||{};t.attr("data-after")?a=t.attr("data-after"):a='<div class="head"><img src="'+I(i.headPortrait.indexOf("http")>-1?i.headPortrait:(window.cdnPath||"")+i.headPortrait)+'"></div><div class="realName">\u4F5A\u540D</div><div class="loginname">\u8D26\u53F7</div><div class="lastLogin">1 \u5206\u949F\u524D</div><div class="submit going" style="bottom: 65px;">\u7ACB\u5373\u8FDB\u5165</div><div class="submit quitBtn">\u9000\u51FA\u8D26\u53F7</div>',t.html(a),t.find(".head img").attr("src",i.headPortrait.indexOf("http")>-1?i.headPortrait:(window.cdnPath||"")+i.headPortrait),t.find(".realName").text(i.nickname||i.name||"\u4F5A\u540D"),t.find(".loginname").text(i.name),t.find(".lastLogin").text(v(i.lastLogin,e)),t.find(".going").on("click",function(){$(this).text("\u6B63\u5728\u8FDB\u5165"),window.location.href=n.userTypeExact=="STUDENT"?"/myroom/#/":"/aroom/#/"})},unlogin:function(t){var n=this;clearTimeout(n.storageLoginTime),n.storageLoginTime=setTimeout(function(){n.carryStorageLogin()},300);for(var e=$(".module[data-type=login]"),a=0,i=e.length;a<i;a++){var r=e.eq(a);r.attr("data-version")=="freelogin"?n.bindNewLoginEvent(r):n.bindLoginEvent(r)}for(var c=$(".module[data-type=registerLogin]"),s=0,l=c.length;s<l;s++){var r=c.eq(s),u='<a class="box"><span class="loginEvent">\u767B\u5F55</span></a>';if(r.html(u),t){for(var g=r.find(".loginEvent"),a=0,i=g.length;a<i;a++)n.bindLoginBtnEvent(g.eq(a));for(var m=r.find(".registerEvent"),a=0,i=m.length;a<i;a++)n.bindRegisterEvent(m.eq(a))}}var b=setInterval(function(){window.roominfo&&(n.loginBoxs(),clearInterval(b))},500)},loginBoxs:function(){var t=this,n=window.roominfo.isGraphicCode==1;if(!!n)for(var e=$(".module[data-type=loginBox]"),a=0,i=e.length;a<i;a++){var r=e.eq(a);t.addLoginImageCode(r)}},addLoginImageCode:function(t){var n=this,e=t.find(".submit"),a=window.roominfo.isGraphicCode==1,i='<div class="codeBox"> <div class="rbox newrbox"> <input class="yantess istertxts" title="\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801" placeholder="\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801" type="text"> <div class="logIcoNew logIcoYang" style="background-image: url(/design/designstatic/home/image/login_icon.png)"></div> </div> <img class="yaned" src="/api/user/getVerifyImageCode?cType=2&amp;height=36&amp;width=98" id="vContainer" href="javascript:void(0)"> <div class="form-explain" style="clear: both;"></div></div>';e.before(i);var r=t.find(".codeBox"),c=e.css("top"),s=e.css("left"),l=e.width(),u=t.height();t.find(".yaned").on("click",function(){$(this).attr("src","/api/user/getVerifyImageCode?cType=2&height=36&width=98&v="+parseInt(Math.random()*100))}),t.css({height:u+50}),r.css({left:s,top:parseInt(c)-15,width:l}),e.css({top:parseInt(c)+55})},bindNewLoginEvent:function(t){var n=this;t.html(t.attr("data-before"));var e=t.find(".eyesModule"),a=t.find("input.account"),i=t.find("input.password"),r=t.find(".submit");e.css("backgroundImage","url(/design/designstatic/home/image/login_icon.png)"),e.on("click",function(){e.hasClass("open")?(e.removeClass("open"),i.attr("type","password")):(e.addClass("open"),i.attr("type","text"))}),t.on("keydown",function(c){c.keyCode==13&&r.click()}),r.on("click",function(){var c=a.val(),s=i.val();if(r.find(".tip").remove(),!c)return r.append('<span class="tip" >\u8BF7\u8F93\u5165\u8D26\u53F7</span>'),!1;if(!s)return r.append('<span class="tip" >\u8BF7\u8F93\u5165\u5BC6\u7801</span>'),!1;o.login(c,s,function(l){if(l.success)n.getLoginUser(!0);else{var u=l.message;switch(parseInt(l.code)){case 200:u="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165";break;case 400:u="\u8BE5\u7F51\u6821\u9700\u8981\u4F7F\u7528\u9501\u5C4F\u6D4F\u89C8\u5668\u767B\u5F55";break;case 403:u="\u8D26\u53F7\u7C7B\u578B\u4E0D\u6B63\u786E";break;case 503:u="\u5DF2\u88AB\u9650\u5236\u767B\u5F55";break;case 707:u="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break}if(l.success){var g=l.data;if(g){var m=g.errCode;m=="4012"?u="\u8D85\u8FC7\u9650\u5236\u6B21\u6570"+g.limitCount+"\u6B21\uFF0C\u8BF7"+g.denyTime/60+"\u5206\u949F\u540E\u91CD\u8BD5":u="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}else u="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}r.append('<span class="tip" >'+u+"</span>")}})})},bindLoginEvent:function(t){var n=this,e=t.find(".account"),a=t.find(".password"),i=t.find(".eyesModule"),r=t.find(".accountRemoveModule"),c=t.find(".checkboxDiv"),s=t.find(".logindrag");if(i.css("backgroundImage","url(/design/designstatic/home/image/login_icon.png)"),i.on("click",function(){i.hasClass("open")?(i.removeClass("open"),a.attr("type","password")):(i.addClass("open"),a.attr("type","text"))}),r.on("click",function(){e.val("")}),s.length&&$.getScript("/design/designstatic/design/js/drag.js",function(){s.html(""),setTimeout(function(){s.drag()},200)}),localStorage.isSaveAPWordKeyNoOn&&c.removeClass("on"),c.on("click",function(){c.hasClass("on")?(c.removeClass("on"),localStorage.removeItem("isSaveAPWordKey")):c.addClass("on")}),localStorage.isSaveAPWordKey&&window.CryptoJS&&window.decrypt){var l=decrypt(localStorage.isSaveAPWordKey),u=JSON.parse(l),g=u.a,m=u.b;e.val(g),a.val(m)}$(".languageBox").length&&$.getScript("/design/designstatic/design/js/select2.min.js",function(){setTimeout(function(){$(".languageBox").html(`<select name="language" class="language">
<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 b=$(".languageBox .language").select2({minimumResultsForSearch:-1,width:"100%"});b.val([localStorage.getItem("umi_locale")||"zh-CN"]).trigger("change")},200)}),t.on("keydown",function(b){b.keyCode==13&&t.find(".submit").click()}),t.find(".submit").on("click",function(){var b=e.find("input").val(),C=a.find("input").val();if(e.find(".tip").remove(),a.find(".tip").remove(),!b)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(!C)return a.append('<span class="tip" style="margin-left: 39px;display: block;color: red;font-size: 14px;">\u8BF7\u8F93\u5165\u5BC6\u7801</span>'),!1;o.login(b,C,function(w){if(w.success)n.getLoginUser(!0);else{var x=t.find(".password"),k=w.message;switch(parseInt(w.code)){case 200:k="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165";break;case 400:k="\u8BE5\u7F51\u6821\u9700\u8981\u4F7F\u7528\u9501\u5C4F\u6D4F\u89C8\u5668\u767B\u5F55";break;case 403:k="\u8D26\u53F7\u7C7B\u578B\u4E0D\u6B63\u786E";break;case 503:k="\u5DF2\u88AB\u9650\u5236\u767B\u5F55";break;case 707:k="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break}if(w.success){var E=w.data;if(E){var P=E.errCode;P=="4012"?k="\u8D85\u8FC7\u9650\u5236\u6B21\u6570"+E.limitCount+"\u6B21\uFF0C\u8BF7"+E.denyTime/60+"\u5206\u949F\u540E\u91CD\u8BD5":k="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}else k="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}x.append('<span class="tip" style="margin-left: 39px;color: red;font-size: 12px;clear:both; line-height: 15px;text-align: center;height: 30px;display: flex;justify-content: center;align-items: center;">'+k+"</span>")}})})},handleClickHref:function(){var t=this,n=$(".module[data-clickhref][data-type=group]");n.on("click",function(e){designUploadPoint($(this));for(var a=$(e.target),i=a.parents(),r=!0,c=0,s=i.length;c<s;c++){var l=i.eq(c);if(a.attr("href")||l.attr("href")||l.attr("data-handle")){r=!1;break}}if(r){var u=$(this),g=u.attr("data-clickhref");if(g.indexOf("/aroom/#")>-1||g.indexOf("/myroom/#")>-1||g.indexOf("/pay/#")>-1){var m=window.user,b=function(w){w=="STUDENT"?g.indexOf("/pay/#")>-1?window.location.href=g.indexOf("/pay/#/")>-1?g:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=g.indexOf("/myroom/#/")>-1?g:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=g.indexOf("/aroom/#/")>-1?g:window.basePath?"/"+window.basePath+"#/":"/#/"},C=function(){m.loginLayer(function(w){w.success&&m.isLogin(function(x){x.success&&b(x.data.userTypeExact)})})};getCookie("token")||getCookie("stoken")?m.isLogin(function(w){w.success?b(w.data.userTypeExact):C()}):C()}else u.attr("data-clicktarget")=="_blank"?location.open=g:location.href=g}})},handleBtn:function(){for(var t=this,n=$(".module[data-handle=login]"),e=0,a=n.length;e<a;e++){var i=n.eq(e);t.bindLoginBtnEvent(i)}for(var r=$(".module[data-type=registerLogin] .loginEvent"),e=0,a=r.length;e<a;e++){var i=r.eq(e);t.bindLoginBtnEvent(i)}for(var c=$(".module[data-handle=register]"),e=0,a=c.length;e<a;e++){var i=c.eq(e);t.bindRegisterEvent(i)}for(var s=$(".module[data-type=registerLogin] .registerEvent"),e=0,a=s.length;e<a;e++){var i=s.eq(e);t.bindRegisterEvent(i)}for(var l=$(".module[data-handle=registerSchool]"),e=0,a=l.length;e<a;e++){var i=l.eq(e);t.bindRegisterSchoolEvent(i)}for(var u=$(".module[data-handle=QQlogin]"),e=0,a=u.length;e<a;e++){var i=u.eq(e);t.bindQQloginEvent(i)}for(var g=$(".module[data-handle=wechatLogin]"),e=0,a=g.length;e<a;e++){var i=g.eq(e);t.bindWechatLoginEvent(i)}for(var m=$(".module[data-handle=enwechatLogin]"),e=0,a=m.length;e<a;e++){var i=m.eq(e);t.bindenWechatLoginEvent(i)}for(var b=$(".module[data-handle=dingdingLogin]"),e=0,a=b.length;e<a;e++){var i=b.eq(e);t.binddingdingLoginEvent(i)}for(var C=$(".module[data-handle=appLogin]"),e=0,a=C.length;e<a;e++){var i=C.eq(e);t.bindappLoginEvent(i)}for(var w=$(".module[data-handle=dialogBtn]"),e=0,a=w.length;e<a;e++){var i=w.eq(e);t.binddialogEvent(i)}for(var x=$(".module[data-handle=weiboLogin]"),e=0,a=x.length;e<a;e++){var i=x.eq(e);t.bindWeiboLoginEvent(i)}for(var k=$(".module[data-handle=alipayLogin]"),e=0,a=k.length;e<a;e++){var i=k.eq(e);t.bindAlipayLoginEvent(i)}for(var E=$(".module[data-handle=getPasswod]"),e=0,a=E.length;e<a;e++){var i=E.eq(e);t.bindGetPasswodEvent(i)}for(var P=$(".module[data-handle=getUsername]"),e=0,a=P.length;e<a;e++){var i=P.eq(e),T=P.eq(e).attr("data-designId");t.bindGetUsernameEvent(i,T)}for(var L=$(".module[data-handle=exchangeCoupon]"),e=0,a=L.length;e<a;e++){var i=L.eq(e);t.bindGetExchangecouponEvent(i)}for(var B=$(".module[data-handle=goBack]"),e=0,a=B.length;e<a;e++){var i=B.eq(e);t.bindGoBack(i)}for(var j=$(".module[data-handle=QRcodeEvent]"),e=0,a=j.length;e<a;e++){var i=j.eq(e);t.BindQRcode(i)}for(var O=$(".module[data-handle=collectionCoupon]"),e=0,a=O.length;e<a;e++){var i=O.eq(e);t.BindCollectionCoupon(i)}t.addHrefClick()},addHrefClick:function(){$("a").click(function(){var t=$(this),n=t.attr("href")||"",e=t.parents(".module");n.length>0&&e.length>0&&designUploadPoint(e)})},bindBeforeEvent:function(t,n){return designUploadPoint(n,!0),t.stopPropagation(),!($(t.target).attr("href")&&n.attr("data-type")=="group")},bindLoginBtnEvent:function(t){var n=t.parents(".module[data-type=registerLogin]").attr("data-login");n&&(n=JSON.parse(n));var e=this;t.on("click",function(a){if(e.bindBeforeEvent(a,$(this))){window.location=location.origin+(window.basePath?"/"+window.basePath+"#/":"/#/")+"login";return}})},bindRegisterEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.registerLayer(function(a){a.success&&n.getLoginUser(!0)})})},bindRegisterSchoolEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.registerSchoolLayer()})},bindQQloginEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.loginQQ()})},bindWechatLoginEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.qrcodeloginWeChat()})},bindenWechatLoginEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.qrcodeloginenWeChat()})},binddingdingLoginEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.qrcodelogindingding()})},bindappLoginEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.qrcodeloginapp()})},binddialogEvent:function(t){var n=this;t.on("click",function(e){if(n.bindBeforeEvent(e,$(this))){var a=t.attr("data-href")?JSON.parse(t.attr("data-href")):{};o.dialogBtnx(a)}})},bindWeiboLoginEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.loginWeiBo()})},bindAlipayLoginEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.loginAlipay()})},bindGetPasswodEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.getPasswordLayer()})},bindGetUsernameEvent:function(t,n){var e=this;t.on("click",function(a){e.bindBeforeEvent(a,$(this))&&o.getUsernameLayer(n)})},bindGetExchangecouponEvent:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.isLogin(function(a){a.success?o.getExchangecoupon():o.loginLayer()})})},bindGoBack:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&window.history.go(-1)})},BindQRcode:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&o.getQRcodeLayer()})},BindCollectionCoupon:function(t){var n=this;t.on("click",function(e){n.bindBeforeEvent(e,$(this))&&(window.user.useInfo?n.carryCouponEvent(t):o.loginLayer(function(){n.carryCouponEvent(t,!0)}))})},carryCouponEvent:function(t,n){var e=this,a=JSON.parse(t.attr("data-href")),i=a.data.couponKeys.join(","),r=void 0;if(window.decrypt&&localStorage.encryptId){var c=window.decrypt(localStorage.encryptId).split(",");n?c.length>0&&(r=c[0]):c.length>1&&(r=c[1])}o.getDressUpCouponShareList({couponIds:i,shareId:r},function(s){s.success&&o.getCouponLayer(s.data,{couponIds:i,shareId:r})})},bindGoBuyCar:function(){var t=this;$("[data-event=goBuyCar]").on("click",function(){var n=$(this).parent().attr("data-href");t.loginUserData?t.goBuyCarEvent(n):o.loginLayer(function(e){e.success&&t.goBuyCarEvent(n)})})},goBuyCarEvent:function(t){var n=this,e=isJSON(t)?JSON.parse(t):!1;if(!e)return!1;var a=e.data,i="",r=[""],c=n.getParam("diliater")||"";window.base64&&(i=n.getParam("shareId")?base64.decode(n.getParam("shareId")):""),window.decrypt&&(r=decrypt(c).split(","));var s=[{goodsId:a.vipId,price:a.price,goodsUrl:location.origin+"/pages/memberDetail.html?vipId="+a.vipId,goodsType:"7",goodsName:a.vipName,cover:a.cover,introduce:a.remark,endTime:a.deadline}];$.ajax({type:"POST",headers:{token:getCookie("token")},url:"/api/order/shoppingCart"+window.tsnfors,contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:s,clientType:n.getclueChannel(),shareUserId:i||(r.length>1?r[1]:""),pvid:sessionStorage.pvid,uvcid:localStorage.uvcid}),async:!0,success:function(l){l.success&&(location.href="/pay/#/shopping")}})},setclueChannel:function(){var t=this,n=localStorage.appAdapt===!0||localStorage.appAdapt==="true";if(localStorage.uvcid||(localStorage.uvcid=t.getNum()+""+new Date().valueOf()),getCookie("returnreport")!="1"&&!sessionStorage.getItem("pvid")&&sessionStorage.setItem("pvid",t.getNum()+""+new Date().valueOf()),!n){var e=getCookie("Referer")?decodeURIComponent(getCookie("Referer")):document.referrer,a=window.location.origin,i=window.location.href,r=!sessionStorage.getItem("cluechannel"),c=e.indexOf(a)!=0;if(c||r){var s=t.getclueChannel(),l=t.getcluesourceType(),u=l.sourceType,g=l.sourceId,m=new Date().valueOf(),b={desc:"",refer:e.indexOf(a)!=0&&e.indexOf(window.location.host)!=8&&e.indexOf(window.location.host)!=7?encodeURIComponent(e):"",type:t.getParam("channel")||"",internalUrl:encodeURIComponent(i)},C={channel:s,sourceJson:JSON.stringify(b),sourceType:u,sourceId:g,gmtStart:m},w="",x=[""],k=t.getParam("diliater")||"",E=new Base64;E.decode&&(w=t.getParam("shareId")?parseInt(E.decode(t.getParam("shareId"))):""),window.decrypt&&(x=decrypt(k).split(",")),(w||(x.length>1?x[1]:"")||(x.length>0?x[0]:""))&&(C.shareUserId=w||(x.length>1?x[1]:"")||(x.length>0?x[0]:"")),sessionStorage.setItem("cluechannel",JSON.stringify(C)),setCookie("Referer","")}}},getNum:function(){for(var t=["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"],n="",e=0;e<32;e++){var a=parseInt(Math.random()*61);n+=t[a]}return n},getcluesourceType:function(){var t=this,n=t.getParam("sourceType")||window.information_sourceType||"",e=t.getParam("sourceId")||window.information_sourceId||0,a=window.location.href;return a.indexOf("shop/item.html")>=0&&(n="4",e=t.getParam("itemid")||0),(a.indexOf("designschool/form/answer.html")>=0||a.indexOf("pages/company/answer.html")>=0||a.indexOf("/portal/form.html")>=0)&&(n="5",e=t.getParam("formId")||0),location.pathname.indexOf("pubinfo")>=0&&location.pathname.indexOf("html")>=0&&(n="1",e=e),(a.indexOf("pages/info.html")>=0||a.indexOf("pages/wap/info.html")>=0)&&(n="3",e=t.getParam("cid")||0),(a.indexOf("pages/bundle.html")>=0||a.indexOf("pages/wap/bundle.html")>=0)&&(n="C",e=t.getParam("cid")||0),(a.indexOf("pages/memberDetail.html")>=0||a.indexOf("shop/vipItem.html")>=0)&&(n="D",e=t.getParam("vipId")||t.getParam("itemid")||0),(a.indexOf("pages/ware.html")>=0||a.indexOf("pages/wap/ware.html")>=0)&&(n="B",e=t.getParam("rid")||0),{sourceType:n,sourceId:e}},getclueChannel:function(){var t=this,n=navigator.userAgent.toLowerCase(),e;if(window.__wxjs_environment==="miniprogram")e=4;else if(n.match(/MicroMessenger/i)=="micromessenger"){var a={win:!1,mac:!1},i=navigator.platform;a.win=i.indexOf("Win")==0,a.mac=i.indexOf("Mac")==0,a.win||a.mac?e=9:e=1}else localStorage.appAdapt===!0||localStorage.appAdapt==="true"?e=t.getParam("channel")||5:t.getParam("channel")?e=t.getParam("channel"):/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?e=2:e=3;return e},getClientInfo:function(){var t=this;$.ajax({type:"get",url:"/api/common/getClientInfo"+window.tsnfors,data:{},contentType:"application/json;charset=utf-8",dataType:"json",success:function(n){if(n.success){var e=n.data||{},a=e.ip||"";sessionStorage.setItem("sourceip",a)}},error:function(n){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})},getParam:function(t,n){var e=n||document.location.href,a=e.indexOf(t+"=");if(a==-1)return"";var i=e.slice(t.length+a+1),r=i.indexOf("&");return r!=-1&&(i=i.slice(0,r)),i}};window.mainHome=d,d.init()}),Function.prototype.bind||(Function.prototype.bind=function(o){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var d=Array.prototype.slice.call(arguments,1),t=this,n=function(){},e=function(){return t.apply(this instanceof n&&o?this:o,d.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,e.prototype=new n,e}),setTimeout(function(){h()},1200),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/newJS/home/main.js?my_version="></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/scrollanim.min.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/chatroom/js/reconnecting-websocket.min.js"></script>'),$(".module[data-type=search").length>0&&document.write('<script type="text/javascript" charset="utf-8" src="/designschool/index/js/main.js?my_version="></script>'),$(".module[data-type=carousel").length>0&&document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/canousel.js?my_version="></script>'),$(".module[data-type=loginBox]").length>0&&document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/pc/components/loginBox/index.js?my_version="></script>'),$(".module[data-type=article]").length>0&&document.write('<script type="text/javascript" charset="utf-8" src="/design/index/component/article/index.js?my_version="></script>'),$(".module[data-menuopenstyle]").length>0&&document.write('<script type="text/javascript" charset="utf-8" src="/design/index/component/dropdown/index.js"></script>'),($(".module[data-type=player]").length>0||$(".module[data-handle=audition]").length>0)&&document.write('<script type="text/javascript" charset="utf-8" src="/design/index/component/player/index.js?my_version="></script>'),$(".module[data-type=MP3]").length>0&&(document.write('<link rel="stylesheet" href="/design/index/component/music/index.css?my_version=">'),document.write('<script type="text/javascript" charset="utf-8" src="/design/index/component/music/index.js?my_version="></script>')),!window.getPage&&!window.secondShareHtml&&document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/setPage.js?my_version="></script>')}function designUploadPoint(y,I){try{var S=y.data("mid")||"",v=y.data("type")||"",f=y.data("handle")||"",p=y.find("a"),h=p.attr("href")||"",o=y.clone();o.find("style").remove();var d=o.text()||"";d=d.replace(/[\r\n]/g,""),d=d.replace(/\ +/g,"");var t=window.location.hostname,n=window.location.pathname,e={id:S,type:v,text:d,handle:f,pageTo:h,hostname:t}}catch(a){console.log("designUploadPoint:",a)}}function Base64(){var y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";this.encode=function(v){var f="",p,h,o,d,t,n,e,a=0;for(v=I(v);a<v.length;)p=v.charCodeAt(a++),h=v.charCodeAt(a++),o=v.charCodeAt(a++),d=p>>2,t=(p&3)<<4|h>>4,n=(h&15)<<2|o>>6,e=o&63,isNaN(h)?n=e=64:isNaN(o)&&(e=64),f=f+y.charAt(d)+y.charAt(t)+y.charAt(n)+y.charAt(e);return f},this.decode=function(v){var f="",p,h,o,d,t,n,e,a=0;for(v=v.replace(/[^A-Za-z0-9\+\/\=]/g,"");a<v.length;)d=y.indexOf(v.charAt(a++)),t=y.indexOf(v.charAt(a++)),n=y.indexOf(v.charAt(a++)),e=y.indexOf(v.charAt(a++)),p=d<<2|t>>4,h=(t&15)<<4|n>>2,o=(n&3)<<6|e,f=f+String.fromCharCode(p),n!=64&&(f=f+String.fromCharCode(h)),e!=64&&(f=f+String.fromCharCode(o));return f=S(f),f};var I=function(v){v=v.replace(/\r\n/g,`
`);for(var f="",p=0;p<v.length;p++){var h=v.charCodeAt(p);h<128?f+=String.fromCharCode(h):h>127&&h<2048?(f+=String.fromCharCode(h>>6|192),f+=String.fromCharCode(h&63|128)):(f+=String.fromCharCode(h>>12|224),f+=String.fromCharCode(h>>6&63|128),f+=String.fromCharCode(h&63|128))}return f},S=function(v){for(var f="",p=0,h=0,o=0,d=0,t=0;p<v.length;)h=v.charCodeAt(p),h<128?(f+=String.fromCharCode(h),p++):h>191&&h<224?(d=v.charCodeAt(p+1),f+=String.fromCharCode((h&31)<<6|d&63),p+=2):(d=v.charCodeAt(p+1),t=v.charCodeAt(p+2),f+=String.fromCharCode((h&15)<<12|(d&63)<<6|t&63),p+=3);return f}}