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

12 lines
31 KiB
JavaScript

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.handleClickHref(),e.bindGoBuyCar()},getLoginUser:function(t){var a=this;getCookie("token")?o.isLogin(function(e){if(e.success){a.loginUserData=e.data,window.loginUserResponse=e,a.login(e.data,e.timeStamp);var n=window.location;if(t)if(g("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(){n.href=g("redirect")},100);else if(n.pathname=="/"){var i=$('.module[data-jump="1"]').length>0;i?n.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>'),e.data.userTypeExact=="STUDENT"?setTimeout(function(){n.href=window.basePath?"/"+window.basePath+"#/":"/#/"},100):setTimeout(function(){n.href=window.basePath?"/"+window.basePath+"#/":"/#/"},100))}else n.reload()}else a.unlogin(!0);a.realName(e.timeStamp)}):(a.unlogin(),a.realName())},carryStorageLogin:function(){var t=this;if(console.log(localStorage.isSaveAPWordKey,window.CryptoJS,window.decrypt,t.loginCount),localStorage.isSaveAPWordKey&&window.CryptoJS&&window.decrypt&&t.loginCount<2){t.loginCount++;var a=decrypt(localStorage.isSaveAPWordKey),e=JSON.parse(a),n=e.a,i=e.b,r=+e.t;Date.now()-r<3600*1e3*24*10&&o.login(n,i,function(d){if(d.success)t.getLoginUser(!0);else{var c=d.message;switch(parseInt(d.code)){case 200:c="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165";break;case 400:c="\u8BE5\u7F51\u6821\u9700\u8981\u4F7F\u7528\u9501\u5C4F\u6D4F\u89C8\u5668\u767B\u5F55";break;case 403:c="\u8D26\u53F7\u7C7B\u578B\u4E0D\u6B63\u786E";break;case 503:c="\u5DF2\u88AB\u9650\u5236\u767B\u5F55";break;case 707:c="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break}if(d.success){var f=d.data;if(f){var u=f.errCode;u=="4012"?c="\u8D85\u8FC7\u9650\u5236\u6B21\u6570"+f.limitCount+"\u6B21\uFF0C\u8BF7"+f.denyTime/60+"\u5206\u949F\u540E\u91CD\u8BD5":c="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}else c="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}window.layer?layer.msg(c,{icon:1}):alert(c)}})}},realName:function(t){var a=this,e=t?parseInt(t):Date.parse(new Date),n;a.nowTime(e);var i=new Date(e).getMinutes(),r=(60-i)*1e3;setTimeout(function(){e=e+r,a.nowTime(e),n=setInterval(function(){e=e+6e4,a.nowTime(e),a.minutes||clearInterval(n)},6e4)},r),n=setInterval(function(){e=e+6e4,a.nowTime(e),a.minutes||clearInterval(n)},6e4)},nowTime:function(t){for(var a=this,e=$(".module[data-type=time]"),n=0,i=e.length;n<i;n++)a.renderTime(t,e.eq(n))},renderTime:function(t,a){var e=this,n=$.parseJSON(a.attr("data-time")),i=new Date(t),r=i.getFullYear(),d=i.getMonth()+1,c=i.getDate(),f=i.getDay(),u=i.getHours()<10?"0"+i.getHours():i.getHours(),l=i.getMinutes()<10?"0"+i.getMinutes():i.getMinutes(),p="";switch(n.timeStyle){case"dayweek":p=r+"\u5E74"+d+"\u6708"+c+"\u65E5"+C(f,!0);break;case"dayhm":p=r+"\u5E74"+d+"\u6708"+c+"\u65E5 "+u+":"+l,e.minutes=!0;break;case"dayweekhm":p=r+"\u5E74"+d+"\u6708"+c+"\u65E5 "+C(f,!0)+" "+u+":"+l,e.minutes=!0;break;case"day":p=r+"-"+d+"-"+c;break;case"ndayhm":p=r+"-"+d+"-"+c+" "+u+":"+l,e.minutes=!0;break;case"endayweek":p=c+"/"+d+"/"+r+" "+C(f,!1);break;case"endayhm":p=c+"/"+d+"/"+r+" "+u+":"+l,e.minutes=!0;break;case"endayweekhm":p=c+"/"+d+"/"+r+" "+C(f,!1)+" "+u+":"+l,e.minutes=!0;break;default:}a.find(".box").html(p)},login:function(t,a){for(var e=this,n=$(".module[data-type=login]"),i=(t==null?void 0:t.user)||{},r=0,d=n.length;r<d;r++){var c=n.eq(r);if(c.attr("data-version")=="freelogin"){e.newLogin(c,t,a);continue}var f=c.attr("data-login")||"",u='<div class="userInfo">'+(f.indexOf("headImg")>-1?'<div class="head"><img src="'+h(i.headPortrait.indexOf("http")>-1?i.headPortrait:(window.cdnPath||"")+i.headPortrait)+'"></div>':"")+(f.indexOf("username")>-1?'<div class="realName">'+h(i.nickname||i.name||"\u4F5A\u540D")+"</div>":"")+(f.indexOf("account")>-1?'<div class="loginname">'+h(i.name)+"</div>":"")+(f.indexOf("lasttime")>-1?'<div class="lastLogin">'+S(i.lastLogin,a)+"</div>":"")+'</div><a href="'+(t.userTypeExact=="STUDENT",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>';c.html(u)}for(var l=$(".module[data-type=registerLogin]"),p=0,y=l.length;p<y;p++){var c=l.eq(p),x='<div class="box"><a href="'+(t.userTypeExact=="STUDENT",window.basePath?"/"+window.basePath+"#/":"/#/")+'" style="margin-right: 5px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;color: inherit;">'+h(i.realName||i.nickname||"\u4F5A\u540D")+'</a> | <span style="margin-left: 5px;white-space: nowrap;" class="quitBtn">\u9000\u51FA</span></div>';c.html(x)}$(".quitBtn").on("click",function(){o.loginout(function(m){if(m.success){localStorage.ap="";try{myextension.delphicallback(1401,"")}catch(w){console.log("\u975E\u65E0\u6781\u6D4F\u89C8\u5668")}window.location.reload()}})})},newLogin:function(t,a,e){var n,i=(a==null?void 0:a.user)||{};t.attr("data-after")?n=t.attr("data-after"):n='<div class="head"><img src="'+h(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(n),t.find(".head img").attr("src",i.headPortrait.indexOf("http")>-1?i.headPortrait:(window.cdnPath||"")+i.headPortrait),t.find(".realName").text(i.nickname||a.name||"\u4F5A\u540D"),t.find(".loginname").text(a.name),t.find(".lastLogin").text(S(a.lastLogin,e)),t.find(".going").on("click",function(){$(this).text("\u6B63\u5728\u8FDB\u5165"),window.location.href=window.basePath?"/"+window.basePath+"#/":"/#/"})},unlogin:function(t){var a=this;clearTimeout(a.storageLoginTime),a.storageLoginTime=setTimeout(function(){a.carryStorageLogin()},300);for(var e=$(".module[data-type=login]"),n=0,i=e.length;n<i;n++){var r=e.eq(n);r.attr("data-version")=="freelogin"?a.bindNewLoginEvent(r):a.bindLoginEvent(r)}for(var d=$(".module[data-type=registerLogin]"),c=0,f=d.length;c<f;c++){var r=d.eq(c),u='<a class="box"><span class="loginEvent">\u767B\u5F55</span></a>';if(r.html(u),t){for(var l=r.find(".loginEvent"),n=0,i=l.length;n<i;n++)a.bindLoginBtnEvent(l.eq(n));for(var p=r.find(".registerEvent"),n=0,i=p.length;n<i;n++)a.bindRegisterEvent(p.eq(n))}}},bindNewLoginEvent:function(t){var a=this;t.html(t.attr("data-before"));var e=t.find(".eyesModule"),n=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(d){d.keyCode==13&&r.click()}),r.on("click",function(){var d=n.val(),c=i.val();if(r.find(".tip").remove(),!d)return r.append('<span class="tip" >\u8BF7\u8F93\u5165\u8D26\u53F7</span>'),!1;if(!c)return r.append('<span class="tip" >\u8BF7\u8F93\u5165\u5BC6\u7801</span>'),!1;o.login(d,c,function(f){if(f.success)a.getLoginUser(!0);else{var u=f.message;switch(parseInt(f.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(f.success){var l=f.data;if(l){var p=l.errCode;p=="4012"?u="\u8D85\u8FC7\u9650\u5236\u6B21\u6570"+l.limitCount+"\u6B21\uFF0C\u8BF7"+l.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 a=this,e=t.find(".account"),n=t.find(".password"),i=t.find(".eyesModule"),r=t.find(".accountRemoveModule"),d=t.find(".checkboxDiv"),c=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"),n.attr("type","password")):(i.addClass("open"),n.attr("type","text"))}),r.on("click",function(){e.val("")}),c.length&&$.getScript("/design/designstatic/design/js/drag.js",function(){c.html(""),setTimeout(function(){c.drag()},200)}),localStorage.isSaveAPWordKeyNoOn&&d.removeClass("on"),d.on("click",function(){d.hasClass("on")?(d.removeClass("on"),localStorage.removeItem("isSaveAPWordKey")):d.addClass("on")}),localStorage.isSaveAPWordKey&&window.CryptoJS&&window.decrypt){var f=decrypt(localStorage.isSaveAPWordKey),u=JSON.parse(f),l=u.a,p=u.b;e.val(l),n.val(p)}$(".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 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=weiboLogin]"),e=0,n=w.length;e<n;e++){var i=w.eq(e);t.bindWeiboLoginEvent(i)}for(var b=$(".module[data-handle=alipayLogin]"),e=0,n=b.length;e<n;e++){var i=b.eq(e);t.bindAlipayLoginEvent(i)}for(var k=$(".module[data-handle=getPasswod]"),e=0,n=k.length;e<n;e++){var i=k.eq(e);t.bindGetPasswodEvent(i)}for(var E=$(".module[data-handle=getUsername]"),e=0,n=E.length;e<n;e++){var i=E.eq(e),B=E.eq(e).attr("data-designId");t.bindGetUsernameEvent(i,B)}for(var P=$(".module[data-handle=exchangeCoupon]"),e=0,n=P.length;e<n;e++){var i=P.eq(e);t.bindGetExchangecouponEvent(i)}for(var I=$(".module[data-handle=goBack]"),e=0,n=I.length;e<n;e++){var i=I.eq(e);t.bindGoBack(i)}for(var L=$(".module[data-handle=QRcodeEvent]"),e=0,n=L.length;e<n;e++){var i=L.eq(e);t.BindQRcode(i)}for(var j=$(".module[data-handle=collectionCoupon]"),e=0,n=j.length;e<n;e++){var i=j.eq(e);t.BindCollectionCoupon(i)}t.addHrefClick()},addHrefClick:function(){$("a").click(function(){var t=$(this),a=t.attr("href")||"",e=t.parents(".module");a.length>0&&e.length>0&&designUploadPoint(e)})},bindBeforeEvent:function(t,a){return designUploadPoint(a,!0),t.stopPropagation(),!($(t.target).attr("href")&&a.attr("data-type")=="group")},bindLoginBtnEvent:function(t){var a=t.parents(".module[data-type=registerLogin]").attr("data-login");a&&(a=JSON.parse(a));var e=this;t.on("click",function(n){if(e.bindBeforeEvent(n,$(this))){window.location=location.origin+(window.basePath?"/"+window.basePath+"#/":"/#/")+"login";return}})},bindRegisterEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.registerLayer(function(n){n.success&&a.getLoginUser(!0)})})},bindRegisterSchoolEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.registerSchoolLayer()})},bindQQloginEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.loginQQ()})},bindWechatLoginEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.qrcodeloginWeChat()})},bindenWechatLoginEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.qrcodeloginenWeChat()})},binddingdingLoginEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.qrcodelogindingding()})},bindappLoginEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.qrcodeloginapp()})},binddialogEvent:function(t){var a=this;t.on("click",function(e){if(a.bindBeforeEvent(e,$(this))){var n=t.attr("data-href")?JSON.parse(t.attr("data-href")):{};o.dialogBtnx(n)}})},bindWeiboLoginEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.loginWeiBo()})},bindAlipayLoginEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.loginAlipay()})},bindGetPasswodEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.getPasswordLayer()})},bindGetUsernameEvent:function(t,a){var e=this;t.on("click",function(n){e.bindBeforeEvent(n,$(this))&&o.getUsernameLayer(a)})},bindGetExchangecouponEvent:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.isLogin(function(n){n.success?o.getExchangecoupon():o.loginLayer()})})},bindGoBack:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&window.history.go(-1)})},BindQRcode:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&o.getQRcodeLayer()})},BindCollectionCoupon:function(t){var a=this;t.on("click",function(e){a.bindBeforeEvent(e,$(this))&&(window.user.useInfo?a.carryCouponEvent(t):o.loginLayer(function(){a.carryCouponEvent(t,!0)}))})},carryCouponEvent:function(t,a){var e=this,n=JSON.parse(t.attr("data-href")),i=n.data.couponKeys.join(","),r=void 0;if(window.decrypt&&localStorage.encryptId){var d=window.decrypt(localStorage.encryptId).split(",");a?d.length>0&&(r=d[0]):d.length>1&&(r=d[1])}o.getDressUpCouponShareList({couponIds:i,shareId:r},function(c){c.success&&o.getCouponLayer(c.data,{couponIds:i,shareId:r})})},bindGoBuyCar:function(){var t=this;$("[data-event=goBuyCar]").on("click",function(){var a=$(this).parent().attr("data-href");t.loginUserData?t.goBuyCarEvent(a):o.loginLayer(function(e){e.success&&t.goBuyCarEvent(a)})})},goBuyCarEvent:function(t){var a=this,e=isJSON(t)?JSON.parse(t):!1;if(!e)return!1;var n=e.data,i="",r=[""],d=a.getParam("diliater")||"";window.base64&&(i=a.getParam("shareId")?base64.decode(a.getParam("shareId")):""),window.decrypt&&(r=decrypt(d).split(","));var c=[{goodsId:n.vipId,price:n.price,goodsUrl:location.origin+"/pages/memberDetail.html?vipId="+n.vipId,goodsType:"7",goodsName:n.vipName,cover:n.cover,introduce:n.remark,endTime:n.deadline}];$.ajax({type:"POST",headers:{token:getCookie("token")},url:"/api/order/shoppingCart",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:c,clientType:a.getclueChannel(),shareUserId:i||(r.length>1?r[1]:""),pvid:sessionStorage.pvid,uvcid:localStorage.uvcid}),async:!0,success:function(f){f.success&&(location.href="/pay/#/shopping")}})},setclueChannel:function(){var t=this,a=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()),!a){var e=getCookie("Referer")?decodeURIComponent(getCookie("Referer")):document.referrer,n=window.location.origin,i=window.location.href,r=!sessionStorage.getItem("cluechannel"),d=e.indexOf(n)!=0;if(d||r){var c=t.getclueChannel(),f=t.getcluesourceType(),u=f.sourceType,l=f.sourceId,p=new Date().valueOf(),y={desc:"",refer:e.indexOf(n)!=0&&e.indexOf(window.location.host)!=8&&e.indexOf(window.location.host)!=7?encodeURIComponent(e):"",type:t.getParam("channel")||"",internalUrl:encodeURIComponent(i)},x={channel:c,sourceJson:JSON.stringify(y),sourceType:u,sourceId:l,gmtStart:p},m="",w=[""],b=t.getParam("diliater")||"",k=new Base64;k.decode&&(m=t.getParam("shareId")?parseInt(k.decode(t.getParam("shareId"))):""),window.decrypt&&(w=decrypt(b).split(",")),(m||(w.length>1?w[1]:"")||(w.length>0?w[0]:""))&&(x.shareUserId=m||(w.length>1?w[1]:"")||(w.length>0?w[0]:"")),sessionStorage.setItem("cluechannel",JSON.stringify(x)),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"],a="",e=0;e<32;e++){var n=parseInt(Math.random()*61);a+=t[n]}return a},getcluesourceType:function(){var t=this,a=t.getParam("sourceType")||window.information_sourceType||"",e=t.getParam("sourceId")||window.information_sourceId||0,n=window.location.href;return n.indexOf("shop/item.html")>=0&&(a="4",e=t.getParam("itemid")||0),(n.indexOf("designschool/form/answer.html")>=0||n.indexOf("pages/company/answer.html")>=0||n.indexOf("/portal/form.html")>=0)&&(a="5",e=t.getParam("formId")||0),location.pathname.indexOf("pubinfo")>=0&&location.pathname.indexOf("html")>=0&&(a="1",e=e),(n.indexOf("pages/info.html")>=0||n.indexOf("pages/wap/info.html")>=0)&&(a="3",e=t.getParam("cid")||0),(n.indexOf("pages/bundle.html")>=0||n.indexOf("pages/wap/bundle.html")>=0)&&(a="C",e=t.getParam("cid")||0),(n.indexOf("pages/memberDetail.html")>=0||n.indexOf("shop/vipItem.html")>=0)&&(a="D",e=t.getParam("vipId")||t.getParam("itemid")||0),(n.indexOf("pages/ware.html")>=0||n.indexOf("pages/wap/ware.html")>=0)&&(a="B",e=t.getParam("rid")||0),{sourceType:a,sourceId:e}},getclueChannel:function(){var t=this,a=navigator.userAgent.toLowerCase(),e;if(window.__wxjs_environment==="miniprogram")e=4;else if(a.match(/MicroMessenger/i)=="micromessenger"){var n={win:!1,mac:!1},i=navigator.platform;n.win=i.indexOf("Win")==0,n.mac=i.indexOf("Mac")==0,n.win||n.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",data:{},contentType:"application/json;charset=utf-8",dataType:"json",success:function(a){if(a.success){var e=a.data||{},n=e.ip||"";sessionStorage.setItem("sourceip",n)}},error:function(a){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})},getParam:function(t,a){var e=a||document.location.href,n=e.indexOf(t+"=");if(n==-1)return"";var i=e.slice(t.length+n+1),r=i.indexOf("&");return r!=-1&&(i=i.slice(0,r)),i}};window.mainHome=s,s.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 s=Array.prototype.slice.call(arguments,1),t=this,a=function(){},e=function(){return t.apply(this instanceof a&&o?this:o,s.concat(Array.prototype.slice.call(arguments)))};return a.prototype=this.prototype,e.prototype=new a,e}),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/main.js"></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"></script>'),$(".module[data-type=carousel").length>0&&document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/canousel.js"></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"></script>'),$(".module[data-type=article]").length>0&&document.write('<script type="text/javascript" charset="utf-8" src="/design/index/component/article/index.js"></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"></script>'),$(".module[data-type=MP3]").length>0&&(document.write('<link rel="stylesheet" href="/design/designstatic/home/pc/components/music/index.css">'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/pc/components/music/index.js"></script>')),!window.getPage&&!window.secondShareHtml&&document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/setPage.js"></script>')}function designUploadPoint(h,C){try{var S=h.data("mid")||"",v=h.data("type")||"",g=h.data("handle")||"",o=h.find("a"),s=o.attr("href")||"",t=h.clone();t.find("style").remove();var a=t.text()||"";a=a.replace(/[\r\n]/g,""),a=a.replace(/\ +/g,"");var e=window.location.hostname,n=window.location.pathname,i={id:S,type:v,text:a,handle:g,pageTo:s,hostname:e}}catch(r){console.log("designUploadPoint:",r)}}function Base64(){var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";this.encode=function(v){var g="",o,s,t,a,e,n,i,r=0;for(v=C(v);r<v.length;)o=v.charCodeAt(r++),s=v.charCodeAt(r++),t=v.charCodeAt(r++),a=o>>2,e=(o&3)<<4|s>>4,n=(s&15)<<2|t>>6,i=t&63,isNaN(s)?n=i=64:isNaN(t)&&(i=64),g=g+h.charAt(a)+h.charAt(e)+h.charAt(n)+h.charAt(i);return g},this.decode=function(v){var g="",o,s,t,a,e,n,i,r=0;for(v=v.replace(/[^A-Za-z0-9\+\/\=]/g,"");r<v.length;)a=h.indexOf(v.charAt(r++)),e=h.indexOf(v.charAt(r++)),n=h.indexOf(v.charAt(r++)),i=h.indexOf(v.charAt(r++)),o=a<<2|e>>4,s=(e&15)<<4|n>>2,t=(n&3)<<6|i,g=g+String.fromCharCode(o),n!=64&&(g=g+String.fromCharCode(s)),i!=64&&(g=g+String.fromCharCode(t));return g=S(g),g};var C=function(v){v=v.replace(/\r\n/g,`
`);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}}