function jump(url){ var tmpForm = $("
"); $(tmpForm).attr("action",url); tmpForm.appendTo(document.body).submit(); } $(document).ready(function() { $("#loginCheck").click(function() { if(!CookieEnable()) { alert("Sorry, your browser Cookie feature is disable. Please enable it!"); return ; } var userType = $("#userType").val(); var autelId = $("#autelId").val(); var password = $("#password").val(); var imagenum = $("#imagenum").val(); var $form = $("#loginCustomerInfo"); var regEmail = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; var userTypeErrorInfoTip = $("#userTypeErrorInfoTip"); var autelIdErrorInfoTip = $("#autelIdErrorInfoTip"); var passwordErrorInfoTip = $("#passwordErrorInfoTip"); var imagenumErrorInfoTip = $("#imagenumErrorInfoTip"); clearAllErrorInfo(); if(userType == -1) { $("#userTypeErrorInfo").show(); $("#userTypeImg").show(); userTypeErrorInfoTip.html("Select a user type"); return; } if(autelId == null || autelId == "") { $("#autelIdErrorInfo").show(); $("#autelIdImg").show(); autelIdErrorInfoTip.html("Please enter an Email."); return; } if(password == null || password == "") { $("#passwordErrorInfo").show(); $("#passwordImg").show(); passwordErrorInfoTip.html("Please specify a password."); return; } if(imagenum == null || imagenum == "") { $("#imagenumErrorInfo").show(); $("#imagenumImg").show(); imagenumErrorInfoTip.html("Please enter the characters you see to continue."); return; } var resultCode = true; $.ajax({ url:'front/user/checkUserLogin.do', type:"post", async:false, data:{"userInfoVo.userType":userType,"userInfoVo.autelId":autelId,"userInfoVo.userPwd":password,"userInfoVo.imageCode":imagenum}, dataType:'JSON', success :function(data) { var jsonData = eval(data); var autelId1 = jsonData[0].autelId; var userPwd = jsonData[0].userPwd; var actCode = jsonData[0].actCode; var imageCode = jsonData[0].imageCode; var systemError = jsonData[0].systemError; if(imageCode == "false") { $("#imagenumErrorInfo").show(); $("#imagenumImg").show(); imagenumErrorInfoTip.html("The entered verification code is incorrect."); resultCode = false; buildRandom(); return; } if(systemError == "false") { $("#imagenumErrorInfo").show(); $("#imagenumImg").show(); imagenumErrorInfoTip.html("System error, please mail to support@autelrobotics.com. "); resultCode = false; buildRandom(); return; } if(autelId1 == "false") { $("#autelIdErrorInfo").show(); $("#autelIdImg").show(); autelIdErrorInfoTip.html("Please enter a valid Autelrobotics ID."); resultCode = false; return; } if(userPwd == "false") { $("#passwordErrorInfo").show(); $("#passwordImg").show(); passwordErrorInfoTip.html("The entered password is incorrect."); resultCode = false; return; } if(actCode == "false") { $("#autelIdErrorInfo").show(); $("#autelIdImg").show(); autelIdErrorInfoTip.html("The Autelrobotics ID you input is not activated. Please login your email "+autelId+" to activate"); resultCode = false; return; } }, error :function(){ $("#imagenumErrorInfo").show(); imagenumErrorInfoTip.html("Network error, please try again later!"); resultCode=false; } }); if(resultCode == false) { return; } $("#returnUrl").val(location.href); $form.action="loginCustomerInfoResult.html?operationType=4"; $form.submit(); }); $("#imageField").click(function() { //window.location.href="regCustomerInfo.html?operationType=1"; //jump("regCustomerInfo.html?operationType=1"); window.open("https://dtznen.ctmon.com.cn/login/pro_register.html"); }); }); function enterkey(e) { if (e==13) { $("#loginCheck").click(); } } function clearAllErrorInfo(){ var userTypeErrorInfoTip = $("#userTypeErrorInfoTip"); var autelIdErrorInfoTip = $("#autelIdErrorInfoTip"); var passwordErrorInfoTip = $("#passwordErrorInfoTip"); var imagenumErrorInfoTip = $("#imagenumErrorInfoTip"); userTypeErrorInfoTip.html(""); autelIdErrorInfoTip.html(""); passwordErrorInfoTip.html(""); imagenumErrorInfoTip.html(""); $("#userTypeErrorInfo").hide(); $("#userTypeImg").hide(); $("#autelIdErrorInfo").hide(); $("#autelIdImg").hide(); $("#passwordErrorInfo").hide(); $("#passwordImg").hide(); $("#imagenumErrorInfo").hide(); $("#imagenumImg").hide(); } function clearUserTypeErrorInfo(){ $("#userTypeErrorInfo").hide(); $("#userTypeImg").hide(); } function clearAutelIdErrorInfo(){ $("#autelIdErrorInfo").hide(); $("#autelIdImg").hide(); } function clearPasswordErrorInfo(){ $("#passwordErrorInfo").hide(); $("#passwordImg").hide(); } function clearImagenumErrorInfo(){ $("#imagenumErrorInfo").hide(); $("#imagenumImg").hide(); } function CookieEnable() { var result=false; if(navigator.cookiesEnabled){ return true; } document.cookie = "testcookie=yes;"; var cookieSet = document.cookie; if (cookieSet.indexOf("testcookie=yes") > -1){ result=true; } document.cookie = ""; return result; } function fawordUrl(){ var autelId=$("#autelId").val(); jump("goForgotPassword.html?operationType=10&autelId="+autelId); }