锘?(function () { $(".wh-btn").click(function () { location.href = "download.aspx?s=" + $("#Series").val(); }); $(".btn-go").click(function () { window.location.href = $(this).attr("ref") + "pg=" + $("#ipt_pageindex").val(); }); $(".wh-close").click(function () { $(this).parents(".wh-shadowBox").addClass("hide"); $(".m-shadow").addClass("hide"); $("#form1")[0].reset(); }); InitLogin(); InitLoginOut(); }); function InitLogin() { $(".top-login").click(function () { $(".wh-Login").removeClass("hide"); $(".m-shadow").removeClass("hide"); }); }; function InitLoginOut() { $(".top-loginout").click(function () { $.post("/ajax/getdata.aspx", { FAction: "doLoginOut" }, function (data, textstatus) { switch (parseInt(data.Code)) { case 200: $(".userinfo").html("鐧诲綍"); InitLogin(); break; } }, "json"); }); }; function isIE() { if (!!window.ActiveXObject || "ActiveXObject" in window) return true; else return false; }; function SaveAs5(url) { var obj_target = document.createElementNS('http://www.w3.org/1999/xhtml', 'a'); url = "" + url; if (!isIE())//闈瀒e { obj_target.href = url; obj_target.download = url; var event = document.createEvent('MouseEvents'); event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); obj_target.dispatchEvent(event); } else { //var w = window.open('about:blank'); //w.document.write(url); //w.document.execCommand('Saveas',false,url); //w.close(); var oPop = window.open(url, "", "width=1, height=1, top=5000, left=5000"); for (; oPop.document.readyState != "complete";) { if (oPop.document.readyState == "complete") break; } oPop.document.execCommand("Saveas"); oPop.close(); } }; function doDownload(id, type, lang) { $.post("/ajax/getdata.aspx", { FAction: "doDownload", id: id, type: type, lang: lang }, function (data, textstatus) { switch (parseInt(data.Code)) { case 200: var files = data.Data; SaveAs5(files); //var openLink = $(""); //openLink.attr('href', files).attr("target", "_blank"); //openLink[0].click(); break; case 201: $(".wh-Login").removeClass("hide"); $(".m-shadow").removeClass("hide"); break; case 202: alert("濡傛€ラ渶鐩稿叧浜у搧璧勬枡锛岃鑷寸數+86 755 3323 9899 鍒嗘満3709涓庢垜浠仈缁溿€?); break; } }, "json"); }; function showSignUp() { $(".wh-Login").addClass("hide"); $(".wh-signUpBox").removeClass("hide"); }; function showLogin() { $(".wh-signUpBox").addClass("hide"); $(".wh-Login").removeClass("hide"); }; function doLogin(obj) { var username = $("#UserName").val(); var password = $("#Password").val(); if (username == '') { alert("璇疯緭鍏ョ敤鎴峰悕绉?); $("#UserName").focus(); return false; } if (password == '') { alert("璇疯緭鍏ョ櫥褰曞瘑鐮?); $("#Password").focus(); return false; } $.post("/ajax/getdata.aspx", { FAction: "doLogin", username: username, password: password }, function (data, textstatus) { console.log(data); switch (parseInt(data.Code)) { case 200: $(".m-shadow").addClass("hide"); $(".wh-Login").addClass("hide"); $("#form1")[0].reset(); $(".userinfo").html(""+data.Data+"锛屾杩庢偍! 閫€鍑裹/a>"); InitLoginOut(); break; case 202: alert("浣犵殑璐﹀彿姝e湪瀹℃牳涓? 璇疯€愬績绛夊緟! 濡傛€ラ渶瑕佺浉鍏崇殑浜у搧鏁版嵁, 璇疯嚧鐢?86 755 3323 9899 鍒嗘満3709涓庢垜浠仈缁?"); break; case 203: alert("璇锋鏌ユ偍鐨勮处鍙峰瘑鐮佹槸鍚﹀~鍐欏畬鏁?); break; case 204: alert("璐﹀彿涓嶅瓨鍦?); break; case 205: alert("瀵逛笉璧凤紝鎮ㄧ殑瀵嗙爜閿欒"); break; } }, "json"); }; function doSingUp(obj) { var username = $("#LoginName").val(); var password = $("#LoginPassword").val(); var confirmpassword = $("#ConfirmPassword").val(); var companyname = $("#CompanyName").val(); var tel = $("#CompanyTelephone").val(); var name = $("#Name").val(); var department = $("#Department").val(); var position = $("#Position").val(); var phone = $("#MobilePhone").val(); var email = $("#Email").val(); var request = $("#Request").val(); if (username == '') { alert("璇疯緭鍏ョ敤鎴峰悕绉?); $("#LoginName").focus(); return false; } if (password == '') { alert("璇疯緭鍏ョ櫥褰曞瘑鐮?); $("#LoginPassword").focus(); return false; } if (confirmpassword == '') { alert("璇峰啀娆¤緭鍏ョ‘璁ゅ瘑鐮?); $("#ConfirmPassword").focus(); return false; } if (password != confirmpassword) { alert("涓ゆ杈撳叆鐨勫瘑鐮佷笉涓€鑷?); $("#ConfirmPassword").focus(); return false; } if (companyname == '') { alert("璇疯緭鍏ュ叕鍙稿悕绉?); $("#CompanyName").focus(); return false; } if (tel == '') { alert("璇疯緭鍏ュ叕鍙哥數璇?); $("#CompanyTelephone").focus(); return false; } //if (!CheckPhone(tel)) { alert("The company telephone is not in the correct format."); $("#CompanyTelephone").focus(); return false; } if (name == '') { alert("璇疯緭鍏ュ鍚?); $("#Name").focus(); return false; } if (department == '') { alert("璇疯緭鍏ユ墍灞為儴闂?); $("#Department").focus(); return false; } if (position == '') { alert("璇疯緭鍏ユ偍鐨勮亴鍔?); $("#Position").focus(); return false; } if (phone == '') { alert("璇疯緭鍏ユ墜鏈哄彿鐮?); $("#MobilePhone").focus(); return false; } //if (!CheckMobile(phone)) { alert("Phone mobile phone format is not correct."); $("#MobilePhone").focus(); return false; } if (email == '') { alert("璇疯緭鍏ラ偖绠?); $("#Email").focus(); return false; } if (!CheckEmail(email)) { alert("鎮ㄨ緭鍏ョ殑閭鍦板潃涓嶅悎娉?); $("#Email").focus(); return false; } if (request == '') { alert("璇疯緭鍏ユ偍鐨勮姹?); $("#Request").focus(); return false; } $.post("/ajax/getdata.aspx", { FAction: "doSingUp", username: username, password: password, companyname: companyname, tel: tel, name: name, department: department, position: position, phone: phone, email: email, request: request }, function (data, textstatus) { switch (parseInt(data.Code)) { case 200: $(".wh-signUpBox").addClass("hide"); $(".wh-successfully").removeClass("hide"); $("#form1")[0].reset(); break; default : alert(data.Message); break; } }, "json"); }; function CheckEmail(email) { if (!email.match(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)) { return false; } else { return true;} }; function CheckMobile(number) { var isMobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(14[0-9]{1}))+\d{8})$/; if (!isMobile.exec(number) && number.length != 11) { return false; } return true; }; function CheckPhone(number) { var isPhone = /^(?:(?:0\d{2,3})-)?(?:\d{7,8})(-(?:\d{3,}))?$/;; if (!isPhone.test(number)) { return false; } return true; }; function CheckContactNumber(number) { var mobile = number; var isMobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1})|(14[0-9]{1}))+\d{8})$/; var isPhone = /^(?:(?:0\d{2,3})-)?(?:\d{7,8})(-(?:\d{3,}))?$/;; //濡傛灉涓?寮€澶村垯楠岃瘉鎵嬫満鍙风爜 if (mobile.substring(0, 1) == 1) { if (!isMobile.exec(mobile) && mobile.length != 11) { return false; } } //濡傛灉涓?寮€澶村垯楠岃瘉鍥哄畾鐢佃瘽鍙风爜 else if (mobile.substring(0, 1) == 0) { if (!isPhone.test(mobile)) { return false; } } //鍚﹀垯鍏ㄩ儴涓嶉€氳繃 else { return false; } return true; };