锘縡unction layeralert(title, text) { layui.use('layer', function () { var layer = layui.layer; layer.open({ title: title, content: text }) }) } function layeralert2(title, text, url) { layui.use('layer', function () { var layer = layui.layer; layer.open({ title: title, content: text, yes: function () { linkto(url); } }) }) } function layeralerte(title, text) { layui.use('layer', function () { var layer = layui.layer; layer.open({ title: title, content: text, btn: ['OK'] }) }) } var emailRule = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; var phoneRule = /^(13|14|15|16|17|18|19)[0-9]{9}$/; var telRule = /^0\d{2,3}-?\d{7,8}$/; function linkto(url) { location.href = url; } function buildding() { layeralert("鎻愮ず", "姝ら」鏆傛湭涓婁紶闄勪欢锛?); } function buildding1() { layeralert("鎻愮ず", "姝e湪瀹屽杽涓紒"); } function ebuildding1() { layeralert("Tips", "Under improvement!"); } //浜у搧寮圭獥鐣欒█鍜ㄨ function adprodmsg(sourec,names) { var name = $("#name").val(); var company = $("#company").val(); var bm = $("#bm").val(); var zhiwei = $("#zhiwei").val(); var yjfx = $("#yjfx").val(); var youxi = $("#youxi").val(); var tels = $("#tels").val(); var nums = $("#nums").val(); var lynr = $("#lynr").val(); if (name == "") { document.getElementById("name").setAttribute("placeholder", "璇疯緭鍏ュ鍚?); return } if (company == "") { document.getElementById("company").setAttribute("placeholder", "璇疯緭鍏ュ叕鍙稿悕绉?); return } if (bm == "") { document.getElementById("bm").setAttribute("placeholder", "璇疯緭鍏ラ儴闂?); return } if (zhiwei == "") { document.getElementById("zhiwei").setAttribute("placeholder", "璇疯緭鍏ヨ亴浣?); return } if (yjfx == "") { document.getElementById("yjfx").setAttribute("placeholder", "璇疯緭鍏ョ爺绌舵柟鍚?); return } if (youxi == "") { document.getElementById("youxi").setAttribute("placeholder", "璇疯緭鍏ラ偖绠?); return } if (!emailRule.test(youxi)) { document.getElementById('youxi').placeholder = ''; document.getElementById("youxi").value = ""; document.getElementById("youxi").setAttribute("placeholder", "鎮ㄨ緭鍏ョ殑閭鏍煎紡鏈夎"); return } if (tels == "") { document.getElementById("tels").setAttribute("placeholder", "璇疯緭鍏ョ數璇?); return } if (!phoneRule.test(tels) && !telRule.test(tels)) { document.getElementById('tels').placeholder = ''; document.getElementById("tels").value = ""; document.getElementById("tels").setAttribute("placeholder", "鎮ㄨ緭鍏ョ殑鐢佃瘽鏍煎紡鏈夎"); return } if (nums == "") { document.getElementById("nums").setAttribute("placeholder", "璇疯緭鍏ヨ揣鍙?); return } $.ajax({ type: "post", url: "/AjaxAction/tj.ashx?action=prolyb&m=" + names + "&sourec=" + sourec + "&name=" + name + "&company=" + company + "&bm=" + bm + "&zhiwei=" + zhiwei + "&yjfx=" + yjfx + "&youxi=" + youxi + "&tels=" + tels + "&nums=" + nums + "&lynr=" + lynr, data: "", success: function (data) { if (data == "1") { layeralert("鎻愮ず", "鎭枩锛屾偍鐨勭暀瑷€宸叉彁浜ゆ垚鍔燂紝鎴戜滑浼氬敖蹇仈绯绘偍"); // setTimeout(function () { window.location.href = document.URL; }, 3000);//寤舵椂3绉 setTimeout("location.href = document.URL", 3000);//寤舵椂3绉 } else { layeralert("鎻愮ず", "鎶辨瓑锛屾偍鐨勭暀瑷€鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯锛?); } } }); } //浜у搧鑱旂郴淇$ function adproinfomsg(strm) { var shuoming = $("#shuoming").val(); var name = $("#name").val(); var tels = $("#tels").val(); var youxi = $("#youxi").val(); var gsname = $("#gsname").val(); var dizhi = $("#dizhi").val(); var code = $("#code").val(); if (shuoming == "") { document.getElementById("shuoming").setAttribute("placeholder", "璇环璇存槑涓嶈兘涓虹┖"); return } if (name == "") { document.getElementById("name").setAttribute("placeholder", "璇疯緭鍏ヨ仈绯讳汉"); return } if (tels == "") { document.getElementById("tels").setAttribute("placeholder", "璇疯緭鍏ユ墜鏈哄彿鐮?); return } if (!phoneRule.test(tels) && !telRule.test(tels)) { document.getElementById('tels').placeholder = ''; document.getElementById("tels").value = ""; document.getElementById("tels").setAttribute("placeholder", "鎮ㄨ緭鍏ョ殑鎵嬫満鍙风爜鏍煎紡鏈夎"); return } if (youxi == "") { document.getElementById("youxi").setAttribute("placeholder", "璇疯緭鍏ラ偖绠卞彿鐮?); return } if (!emailRule.test(youxi)) { document.getElementById('youxi').placeholder = ''; document.getElementById("youxi").value = ""; document.getElementById("youxi").setAttribute("placeholder", "鎮ㄨ緭鍏ョ殑閭鏍煎紡鏈夎"); return } if (gsname == "") { document.getElementById("gsname").setAttribute("placeholder", "璇疯緭鍏ヤ紒涓氬悕绉?); return } if (dizhi == "") { document.getElementById("dizhi").setAttribute("placeholder", "璇疯緭鍏ヨ缁嗗湴鍧€"); return } if (code == "") { document.getElementById("zhiwei").setAttribute("placeholder", "璇疯緭鍏ラ獙璇佺爜"); return } if (code == "" || code == "楠岃瘉鐮佷笉姝g‘") { document.getElementById("zhiwei").setAttribute("placeholder", "璇疯緭鍏ラ獙璇佺爜"); return } if (!(code == getCookie("CheckCode"))) { document.getElementById('code').placeholder = ''; document.getElementById("code").value = ""; document.getElementById("code").setAttribute("placeholder", "楠岃瘉鐮佷笉姝g‘"); return false; } //$.ajax({ // type: "post", // url: "/AjaxAction/tj.ashx?action=prolyb&m=" + names + "&sourec=" + sourec + "&name=" + name + "&company=" + company + "&bm=" + bm + "&zhiwei=" + zhiwei + "&yjfx=" + yjfx + "&youxi=" + youxi + "&tels=" + tels + "&nums=" + nums + "&lynr=" + lynr, // data: "", // success: function (data) { // if (data == "1") { // layeralert("鎻愮ず", "鎭枩锛屾偍鐨勭暀瑷€宸叉彁浜ゆ垚鍔燂紝鎴戜滑浼氬敖蹇仈绯绘偍"); // // setTimeout(function () { window.location.href = document.URL; }, 3000);//寤舵椂3绉 // setTimeout("location.href = document.URL", 3000);//寤舵椂3绉 // } // else { // layeralert("鎻愮ず", "鎶辨瓑锛屾偍鐨勭暀瑷€鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯锛?); // } // } //}); } //鐣欒█鍜ㄨ function addmsg(strname) { var name = $("#name").val(); var jigou = $("#institution").val(); var bm = $("#department").val(); var yjfx = $("#direction").val(); var tels = $("#Tel").val(); var youxi = $("#EMail").val(); var ly = $('#lytypes option:selected').text(); var lynr = $("#Intro").val(); if (name == "") { layeralert("鎻愮ず", "璇疯緭鍏ユ偍鐨勫鍚?); return } if (ly == "" || ly == "璇烽€夋嫨鐣欒█绫诲埆") { layeralert("鎻愮ず", "璇烽€夋嫨鐣欒█绫诲埆"); return } if (tels != "") { if (!phoneRule.test(tels) && !telRule.test(tels)) { layeralert("鎻愮ず", "鎮ㄨ緭鍏ョ殑鐢佃瘽鍙风爜鏈夎"); return } } if (youxi != "") { if (!emailRule.test(youxi)) { layeralert("鎻愮ず", "鎮ㄨ緭鍏ョ殑鐨勯偖绠辨牸寮忔湁璇?); return } } if (lynr == "") { layeralert("鎻愮ず", "璇疯緭鍏ユ偍鐨勭暀瑷€鍐呭"); return } $.ajax({ type: "post", url: "/AjaxAction/tj.ashx?action=lyb&sourec=" + strname + "&name=" + name + "&jigou=" + jigou + "&bm=" + bm + "&yjfx=" + yjfx + "&tels=" + tels + "&youxi=" + youxi + "&ly=" + ly + "&lynr=" + lynr, data: "", success: function (data) { if (data == "1") { layeralert("鎻愮ず", "鎭枩锛屾偍鐨勭暀瑷€宸叉彁浜ゆ垚鍔燂紝鎴戜滑浼氬敖蹇仈绯绘偍"); // setTimeout(function () { window.location.href = document.URL; }, 3000);//寤舵椂3绉 setTimeout("location.href = document.URL", 3000);//寤舵椂3绉 } else { layeralert("鎻愮ず", "鎶辨瓑锛屾偍鐨勭暀瑷€鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯锛?); } } }); } //搴曢儴鐣欒█鍜ㄨ function addmsgfoot(strname) { var name = $("#namef").val(); var jigou = $("#institutionf").val(); var bm = $("#departmentf").val(); var yjfx = $("#directionf").val(); var tels = $("#Telf").val(); var youxi = $("#EMailf").val(); var ly = $('#lytypestwo option:selected').text(); var lynr = $("#Introf").val(); if (name == "") { layeralert("鎻愮ず", "璇疯緭鍏ユ偍鐨勫鍚?); return } if (ly == "" || ly == "璇烽€夋嫨鐣欒█绫诲埆") { layeralert("鎻愮ず", "璇烽€夋嫨鐣欒█绫诲埆"); return } if (tels != "") { if (!phoneRule.test(tels) && !telRule.test(tels)) { layeralert("鎻愮ず", "鎮ㄨ緭鍏ョ殑鐢佃瘽鍙风爜鏈夎"); return } } if (youxi != "") { if (!emailRule.test(youxi)) { layeralert("鎻愮ず", "鎮ㄨ緭鍏ョ殑鐨勯偖绠辨牸寮忔湁璇?); return } } if (lynr == "") { layeralert("鎻愮ず", "璇疯緭鍏ユ偍鐨勭暀瑷€鍐呭"); return } $.ajax({ type: "post", url: "/AjaxAction/tj.ashx?action=lyb&sourec=" + strname + "&name=" + name + "&jigou=" + jigou + "&bm=" + bm + "&yjfx=" + yjfx + "&tels=" + tels + "&youxi=" + youxi + "&ly=" + ly + "&lynr=" + lynr, data: "", success: function (data) { if (data == "1") { layeralert("鎻愮ず", "鎭枩锛屾偍鐨勭暀瑷€宸叉彁浜ゆ垚鍔燂紝鎴戜滑浼氬敖蹇仈绯绘偍"); // setTimeout(function () { window.location.href = document.URL; }, 3000);//寤舵椂3绉 setTimeout("location.href = document.URL", 3000);//寤舵椂3绉 } else { layeralert("鎻愮ず", "鎶辨瓑锛屾偍鐨勭暀瑷€鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯锛?); } } }); } //COA鏌ヨ //function serchernum(m) { // var huonum = $("#huonum").val(); // var picinum = $("#picinum").val(); // //if (huonum == "" ) { // // layeralert("鎻愮ず", "璇疯緭鍏ヤ骇鍝佽揣鍙?); // // return // //} // //if (layeralert == "") { // // layeralert("鎻愮ず", "璇疯緭鍏ヤ骇鍝佹壒娆″彿"); // // return // //} // if (huonum == "" && picinum == "") { // layeralert("鎻愮ず", "璇疯緭鍏ヤ骇鍝佽揣鍙锋垨鑰呬骇鍝佹壒娆″彿"); // return // } // $.ajax({ // url: "/AjaxAction/jz.ashx?action=coa&m=" + m + "&huonum=" + huonum + "&picinum=" + picinum, // type: "get", // data: "", // dataType: "json", // success: function (data) { // if (data.code == "1") { // //var hreflj = data.f; // //window.open(hreflj, '_blank') // var hreflj = data.f; // var timestamp = new Date().getTime(); // var index = hreflj.lastIndexOf("\."); // var hzm = hreflj.substring(index + 1, hreflj.length); // //download("COA涓嬭浇" + "." + hzm, hreflj); // download("" + data.mingchen + "" + "." + hzm, hreflj); // } // else if (data.code == "2") { // layeralert("鎻愮ず", "璇ヤ骇鍝佽揣鍙峰拰鎵规鍙锋湭涓婁紶鐩稿叧闄勪欢"); // } // else if (data.code == "3") { // layeralert("鎻愮ず", "鏈煡璇㈠埌璇ヤ骇鍝佽揣鍙峰拰鎵规鍙风浉鍏冲唴瀹癸紒"); // } // else { // layeralert("鎻愮ず", "鏌ヨ澶辫触锛?); // } // }, // error: function (xhr, type) { // layeralert("鎻愮ず", "鏁版嵁鎿嶄綔寮傚父锛?); // } // }); //} function download(name, href) { var a = document.createElement("a"), //鍒涘缓a鏍囩 e = document.createEvent("MouseEvents"); //鍒涘缓榧犳爣浜嬩欢瀵硅薄 e.initEvent("click", false, false); //鍒濆鍖栦簨浠跺璞 //window.open(a.href, '_blank') a.href = href; //璁剧疆涓嬭浇鍦板潃 a.download = name; //璁剧疆涓嬭浇鏂囦欢鍚 a.dispatchEvent(e); //缁欐寚瀹氱殑鍏冪礌锛屾墽琛屼簨浠禼lick浜嬩欢 } //鎼滅储 function search1() { if (document.getElementById("searchkey").value.replace(/(^\s*)|(\s*$)/g, "") == "") { layeralert("鎻愮ず", "璇疯緭鍏ュ叧閿瓧"); return; } else { window.location.href = "/search.html?k=" + $("#searchkey").val(); } } $(function () { $("#searchkey").keyup(function (event) { if (event.keyCode == 13) { //鐐瑰嚮鍥炶溅瑕佹墽琛岀殑浜嬩欢 if (document.getElementById("searchkey").value.replace(/(^\s*)|(\s*$)/g, "") == "") { layeralert("鎻愮ず", "璇疯緭鍏ュ叧閿瓧"); return; } else { window.location.href = "/search.html?k=" + $("#searchkey").val(); } } }) })