passport = new Object(); passport.siteRootURL = "http://www.kbl-shop.cn/__passport/"; passport.appID = 0; passport.User = function(instanceNameString, loginStatusHtmlContainerID) { this.instanceNameString = instanceNameString; this.loginStatusHtmlContainerID = loginStatusHtmlContainerID; this.visitorID = 0; this.userID = 0; this.userName = null; this.isLogin = false; this.authString = null; /*是否用弹出面板登录*/ this.isLoginInPopPanel = false; /*获取用户状态HTML*/ this.getStatusHtml = function() { var html = ""; var returnURL = document.URL; if (this.isLogin) { html += ''; html += '您好!' + this.userName + ''; html += '退出'; html += '|我的帐户'; html += '|订单查询'; html += ''; } else { if (this.userName != null) { html += ''; //html += '您好!' + this.userName + ''; if (this.isLoginInPopPanel) { html += '您还未登录'; } else { html += '您还未登录'; } html += '新注册'; html += '|我的帐户'; html += '|订单查询'; html += ''; } else { html += ''; html += '注册'; if (this.isLoginInPopPanel) { html += '您还未登录'; } else { html += '您还未登录'; } html += '|我的帐户'; html += '|订单查询'; html += ''; } } /*自动跳转同步登录状态*/; var sysLoginStatusInIframeURL = '/_sso/passport-access.aspx?passportaction=syn-login-status'; html += ''; return html; }; /*写用户状态HTML*/ this.writeStatusHtml = function(htmlContainerID) { this.loginStatusHtmlContainerID = htmlContainerID; document.write(this.getStatusHtml()); }; this.callbackJS = ""; /*检查是否登录,如果没有登录则显示登录框或者提示登录*/ this.checkLoginStatus = function(callbackJS) { this.callbackJS = callbackJS; var obj = document.createElement("div"); obj.style.display = "none"; var sysLoginStatusInIframeURL = '/_sso/passport-access.aspx?passportaction=syn-login-status'; obj.innerHTML = ''; document.body.appendChild(obj); }; /*显示登录面板*/ this.showLoginPanel = function() { cn.liusoft.importJS("cn.liusoft.dom.window"); cn.liusoft.dom.window.Mask.show(null,null,"#000",60); var loginInIframeURL = passport.siteRootURL + 'login-in-iframe.aspx?appid='+passport.appID+'&topurl='+encodeURIComponent(window.top.location.href); var html = ''; html += '