/*============================================================================= * KFIT 閲戣瘉鍩洪噾缃戜笂浜ゆ槗绯荤粺 V3.0 * Copyright(c) 1998-2012 SZKingdom Co. Ltd. * All right reserved. *----------------------------------------------------------------------------- * 鐧诲綍椤甸潰锛圠ogin.html锛夋帶鍒? * * 淇敼鍘嗗彶锛? *---------------------------------------------------------------------------- * 淇敼鏃堕棿 淇敼浜? 淇敼鍐呭 * 2012-03-01 00:00 river 鍒涘缓 *============================================================================*/ function Login() { // 鍒濆鍖朌OM鍙橀噺 var $LoginMode = null; // 鐧诲綍绫诲瀷 var $Account = null; // 璇佷欢鍙? var $Password = null; // 鐧诲綍瀵嗙爜 var $VerifyCode = null; // 楠岃瘉鐮? var $ImgVerifyCode = null; // 鍥剧墖楠岃瘉鐮? var oUrlParam = new URL().params; // 褰撳墠url淇℃伅 var lastCheckTime = null; var PerCertType, OrgCertType; var webTradeSpan, acctQrySpan, tradeImgLink, qryImgLink; var _this, timerID = -1; /** * 鍒濆鍖栭〉闈OM瀵硅薄 */ this.initialize = function() { // session杩囨湡灏辫烦鍑篿frame妗嗘灦 if (window != top) top.location.href = location.href; // KDlg.waiting(false, false); // 鎵ц鐖剁被涓殑initialize鏂规硶 this.$Super.initialize.apply(this, arguments); $('#invtp0Select').addClass('nocurSelect'); $('#invtp1Select').addClass('currentSelect'); // 鍒濆鍖朌OM鍙橀噺 $LoginMode = $("#slMode"); $Account = $("#txtAccount"); $Password = $("#txtPassword"); $VerifyCode = $("#txtVerifyCode"); $ImgVerifyCode = $("#imgVerifyCode"); PerCertType = new ListMap(); PerCertType.set('0','灞呮皯韬唤璇?); PerCertType.set('2','鍐涘畼璇?); PerCertType.set('3','澹叺璇?); PerCertType.set('4','娓境灞呮皯鏉ュ線鍐呭湴閫氳璇?); PerCertType.set('A','鍙拌優璇?); PerCertType.set('7','鍏跺畠'); OrgCertType = new ListMap(); //OrgCertType.set('0','缁勭粐鏈烘瀯浠g爜璇?); OrgCertType.set('1','钀ヤ笟鎵х収'); OrgCertType.set('2','琛屾斂鏈哄叧'); OrgCertType.set('3','绀句細鍥綋'); OrgCertType.set('4','鍐涢槦'); OrgCertType.set('5','姝﹁'); OrgCertType.set('6','涓嬪睘鏈烘瀯'); OrgCertType.set('7','鍩洪噾浼?); OrgCertType.set('8','鍏跺畠鏈烘瀯'); // QryPerCertType = new ListMap(); // QryPerCertType.set('0','韬唤璇?); // webTradeSpan = document.getElementById("webTrade"); acctQrySpan = document.getElementById("acctQry"); tradeImgLink = document.getElementById("tradeIcon"); qryImgLink = document.getElementById("qryIcon"); //璇佷欢绫诲瀷 KDom.addSelectOption("slMode", KGD.PerCertType, ["value"], ["key"], false, "0"); // 鍒濆鍖朌OM浜嬩欢 $("#btnLogin").click($.proxy(this.onLoginClick, this)); $("#btnOpenAccount").click($.proxy(this.onOpenAccountClick, this)); $("#KeyBoardForgest").click($.proxy(this.onForgotPwd, this)); //$("#aLoadImage").attr("href", "javascript:oLogin.onLoadImageClick();"); $("#aLoadImage").click(function(){ oLogin.onLoadImageClick(); }); // 鑾峰彇楠岃瘉鐮? this.onLoadImageClick(); document.onkeydown = function(e){ var currKey = 0,ev = e || event; currKey = ev.keyCode || ev.which || ev.charCode;//鏀寔IE銆丗F if (document.activeElement.id!='btnLogin'&&currKey == 13) { oLogin.onLoginClick(ev); } }; _this = $('#ulNote'); _this.hover(function() { clearInterval(timerID); }, function() { timerID = setInterval("scrollUp()", 2000); }).mouseout(); scrollUp = function() { var $second = _this.find("li:first"); var $last = _this.find("li:last"); $last.insertBefore($second); }; }; this.finalize = function() { this.$Super.finalize.apply(this, arguments); // KDlg.waiting(false, false); }; this.onForgotPwd = function() { KGF.gotoPage("../../page/frame/MainFrame.html?type=2"); }; /**缃戜笂浜ゆ槗涓庤处鎴锋煡璇㈠悎骞? this.switchContent = function(type){ if(type == "0"){//缃戜笂浜ゆ槗Tab $("#btnOpenAccount").show(); //$("#forgetPwdSpan").show(); webTradeSpan.className = "selectedTab"; acctQrySpan.className = "unSelectedTab"; tradeImgLink.style.display = ''; qryImgLink.style.display = 'none'; KDom.clearSelectOption("slMode"); KDom.addSelectOneOption('slMode', '00', '鍩洪噾璐﹀彿') KDom.addSelectOption('slMode', PerCertType, ["value"], ["key"], false, "0"); }else if(type == "1"){//璐︽埛鏌ヨTab $("#btnOpenAccount").hide(); //$("#forgetPwdSpan").hide(); webTradeSpan.className = "unSelectedTab"; acctQrySpan.className = "selectedTab"; tradeImgLink.style.display = 'none'; qryImgLink.style.display = ''; KDom.clearSelectOption("slMode"); KDom.addSelectOneOption('slMode', '00', '鍩洪噾璐﹀彿') KDom.addSelectOption('slMode', QryPerCertType, ["value"], ["key"], false, "00"); } }**/ /** * 鐐瑰嚮鍒锋柊閲嶈幏鏍¢獙鐮佸浘鐗? */ this.onLoadImageClick = function() { var iHeight = Math.ceil($VerifyCode.outerHeight()); $ImgVerifyCode.attr("src", "../../authImg?width=64&count=4" + "&height=" + iHeight + "&time=" + (new Date()).getTime()); $VerifyCode.val(""); }; /** * 楠岃瘉鐧诲綍杈撳叆鏁版嵁鏄惁鍚堟硶 */ this.validate = function() { if (KGF.isEmpty($Account.val())) { KDlg.info("鐧诲綍璐﹀彿涓嶈兘涓虹┖銆?); $Account.focus(); return false; } if ($.trim($Account.val()).length != $Account.val().length) { KDlg.info("鐧诲綍璐﹀彿涓嶈兘鍖呭惈绌烘牸銆?); $Account.focus(); return false; } if ($LoginMode.val() == "0"&&$('#invtp1')[0].checked) { if (KGF.isValidIDCardNo($Account.val()) != "true") { KDlg.info("韬唤璇佽緭鍏ヤ笉姝g‘銆?); $Account.focus(); return false; } } if (KGF.isEmpty($.trim($Password.val()))) { KDlg.info("瀵嗙爜涓嶈兘涓虹┖銆?); $Password.focus(); return false; } else if (!KGF.isValidPwd($Password.val())) { KDlg.info("瀵嗙爜杈撳叆鏍煎紡涓嶅悎娉曘€?); $Password.focus(); return false; } if ($('#isFtLg')[0].value=="1"&&KGF.isEmpty($.trim($VerifyCode.val()))) { KDlg.info("楠岃瘉鐮佷笉鑳戒负绌恒€?); $VerifyCode.focus(); return false; } return true; }; /** * 鐐瑰嚮鐧诲綍鎸夐挳楠岃瘉鐧诲綍 */ this.onLoginClick = function(event) { // 楠岃瘉杈撳叆鏁版嵁 if (!this.validate()) return; var sInvtp = getCheckedRadioValue("invtp"); var sAccttype; var sLoginMode = $("#slMode").val(); var sAccount = $("#txtAccount").val(); var sPassword = encData($("#txtPassword").val()); var sVerifyCode = $("#txtVerifyCode").val(); if(sInvtp=="1"&&sLoginMode=='0'){ sAccount= sAccount.replace('x', 'X'); } if (sLoginMode == '00') {// 鍩洪噾甯愬彿鐧诲綍锛岃浆鎹? sAccttype = '2'; sLoginMode = '0'; if (sAccount.length > 12) { KDlg.info("鍩洪噾璐﹀彿鏍煎紡涓嶆纭紒"); $("#txtAccount").val()=""; $("#txtPassword").val=""; return; } } else { sAccttype = '7'; if (sLoginMode == '07') { sAccount = 'VIP' + sLoginId; sLoginMode = '7'; } else if (sLoginMode == '007') { sAccount = 'WEB' + sLoginId; sLoginMode = '7'; } } // 浠ヨ〃鍗曟柟寮忔彁浜? var oParam = new ListMap(); oParam.set("accttype", sAccttype); oParam.set("certificateno", sAccount); oParam.set("lpasswd", sPassword); oParam.set("verifycode", sVerifyCode); oParam.set("certificatetype", sLoginMode); oParam.set("invtp", sInvtp); //KDom.initPostForm(null,KGF.getRootPath()+"j_spring_security_check", oParam, false, true); KDom.initPostForm(null,"j_spring_security_check", oParam, false, true); }; this.changeTp = function(t){ document.getElementById("slMode").options.length = 1; if("0"== t){ $('#txtAccount').val(''); $('#txtPassword').val(''); $('#txtVerifyCode').val(''); $('#invtp0Select').removeClass(); $('#invtp0Select').addClass('currentSelect'); $('#invtp1Select').removeClass(); $('#invtp1Select').addClass('nocurSelect'); $("#invtp0").attr("checked","checked"); KDom.addSelectOption("slMode", KGD.OrgCertType, ["value"], ["key"], false, "1"); $("#btnOpenAccount").attr("class","login-open-disabled"); $("#btnOpenAccount").attr("disabled",true); }else{ $('#txtAccount').val(''); $('#txtPassword').val(''); $('#txtVerifyCode').val(''); $('#invtp1Select').removeClass(); $('#invtp1Select').addClass('currentSelect'); $('#invtp0Select').removeClass(); $('#invtp0Select').addClass('nocurSelect'); $("#invtp1").attr("checked","checked"); KDom.addSelectOption("slMode", KGD.PerCertType, ["value"], ["key"], false, "0"); $("#btnOpenAccount").attr("class","login-open"); $("#btnOpenAccount").attr("disabled",false); } }; /** * 寮€鎴? */ this.onOpenAccountClick = function (event) { KGF.gotoPage("../../page/frame/MainFrame.html?type=1"); //KGF.gotoPage("../../page/openAcct/OpenAcct1.html"); }; this.blurCheck = function(){ var curTime = new Date().getTime(); var befTime = lastCheckTime!=null?lastCheckTime:curTime; if(curTime-befTime<30000&&curTime-befTime>0) return; lastCheckTime = curTime; Ajax.request("isRefreshCode.action",{},function(ajaxResult){ if(!ajaxResult.isSuccess()){ KDom.display("TrtxtVerifyCode",true); $('#isFtLg')[0].value="1"; oLogin.onLoadImageClick(); }else{ KDom.display("TrtxtVerifyCode",false); $('#isFtLg')[0].value="0"; } },true,"json",false); }; } ; // 鍔犺浇Javascript椤甸潰鎺у埗绫? loadJsPageClass("Login");