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

2 lines
24 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
var comFun={};(function(s,m){var i={init:function(){var t=this;t.getValue("token")&&(t.setCookie("token",t.getValue("token")),t.setCookie("openid",t.getValue("openid"))),m.location.href.indexOf("/mp/index.shtml")>-1||m.location.href.indexOf("/pages/routine/")>-1?(t.miniprogram=!0,localStorage.miniprogram=!0):(t.miniprogram=!1,localStorage.miniprogram=!1)},getValue:function(t){var e=e||window.location.href,n=e.split("?");if(n.length==1)return null;for(var a=n[1].split("&"),r={},l=0;l<a.length;l++){var d=a[l].split("=");r[d[0]]=d[1]}return r[t]?r[t]:!1},setCookie:function(t,e){var n=30,a=new Date;a.setTime(a.getTime()+n*24*60*60*1e3);var r=t+"="+e+";path=/;expires="+a.toGMTString();document.cookie=r}};i.init(),comFun=i})(jQuery,window),document.write('<link rel="stylesheet" href="/design/designstatic/common/css/userMobile.css">'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/waphome/js/layerMobile/layer.js"></script>'),window.wx||document.write('<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>');var scriptUrl="/design/designstatic/common/js/userMobile.js";loadScriptmin(scriptUrl,function(){var s=window.user,m={init:function(){var i=this;i.getLoginUser(),i.handleBtn(),$(document).scrollTop(0)},getLoginUser:function(i){var t=this;getCookie("token")&&s.isLogin(function(e){e.success&&(t.login(e.data,e.timeStamp),i&&(e.data.userTypeExact=="STUDENT",window.location.href=window.basePath?"/"+window.basePath+"#/":"/#/"))})},login:function(i,t){for(var e=this,n=$(".module[data-type=registerLogin]"),a=(i==null?void 0:i.user)||{},r=0,l=n.length;r<l;r++){var d=n.eq(r),u='<a href="'+(window.basePath?"/"+window.basePath+"#/":"/#/")+'" style="margin-right: 5px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;width: 55%;text-align: right;">'+(a.nickname||a.name||"")+'</a> | <span style="margin-left: 5px;white-space: nowrap;" class="quitBtn">\u9000\u51FA</span>';d.find(".box").html(u)}$(".quitBtn").on("click",function(){s.loginout(function(c){c.success&&(window.location.href="/")})})},handleBtn:function(){for(var i=this,t=$(".module[data-handle=login]"),e=0,n=t.length;e<n;e++){var a=t.eq(e);i.bindLoginBtnEvent(a)}for(var r=$(".module[data-type=registerLogin] .loginEvent"),e=0,n=r.length;e<n;e++){var a=r.eq(e);i.bindLoginBtnEvent(a)}for(var l=$(".module[data-handle=register]"),e=0,n=l.length;e<n;e++){var a=l.eq(e);i.bindRegisterEvent(a)}for(var d=$(".module[data-type=registerLogin] .registerEvent"),e=0,n=d.length;e<n;e++){var a=d.eq(e);i.bindRegisterEvent(a)}for(var u=$(".module[data-handle=registerSchool]"),e=0,n=u.length;e<n;e++){var a=u.eq(e);i.bindRegisterSchoolEvent(a)}for(var c=$(".module[data-handle=QQlogin]"),e=0,n=c.length;e<n;e++){var a=c.eq(e);i.bindQQloginEvent(a)}for(var p=$(".module[data-handle=wechatLogin]"),e=0,n=p.length;e<n;e++){var a=p.eq(e);i.bindWechatLoginEvent(a)}for(var o=$(".module[data-handle=enwechatLogin]"),e=0,n=o.length;e<n;e++){var a=o.eq(e);i.bindenWechatLoginEvent(a)}for(var f=$(".module[data-handle=dingdingLogin]"),e=0,n=f.length;e<n;e++){var a=f.eq(e);i.binddingdingLoginEvent(a)}for(var h=$(".module[data-handle=appLogin]"),e=0,n=h.length;e<n;e++){var a=h.eq(e);i.bindappLoginEvent(a)}for(var I=$(".module[data-handle=dialogBtn]"),e=0,n=I.length;e<n;e++){var a=I.eq(e);i.binddialogEvent(a)}for(var w=$(".module[data-handle=weiboLogin]"),e=0,n=w.length;e<n;e++){var a=w.eq(e);i.bindWeiboLoginEvent(a)}for(var v=$(".module[data-handle=alipayLogin]"),e=0,n=v.length;e<n;e++){var a=v.eq(e);i.bindAlipayLoginEvent(a)}for(var g=$(".module[data-handle=getPasswod]"),e=0,n=g.length;e<n;e++){var a=g.eq(e);i.bindGetPasswodEvent(a)}for(var j=$(".module[data-handle=getUsername]"),e=0,n=j.length;e<n;e++){var a=j.eq(e);i.bindGetUsernameEvent(a)}for(var x=$(".module[data-handle=exchangeCoupon]"),e=0,n=x.length;e<n;e++){var a=x.eq(e);i.bindGetExchangecouponEvent(a)}},bindLoginBtnEvent:function(i){var t=this;i.on("click",function(){window.location=location.origin+(window.basePath?"/"+window.basePath+"#/":"/#/")+"login"})},bindRegi