// 鏈珯鐐?鍏ㄧ綉涔嬮棿鍒囨崲 sitetype鍙橀噺鍒ゆ柇鏄惁涓烘湰绔
var sitetype = "only";
$(".js_zhandianxuanze").on("click", function () {
var $thisait = $(this).find(".op.cur");
$thisait.removeClass("cur").siblings(".op").addClass("cur");
if ($(".js_zhandianxuanze .op.cur").text() == "鏈珯") {
sitetype = "only";
} else {
sitetype = "all";
}
});
var widthpcphone = $(window).width();
// 鎵嬫満绔睍绀簆c鐨勬牱寮 閫氳繃濯掍綋鏌ヨ
function yidongShowpc() {
if ($(".js_zhanshipc").length > 0 && widthpcphone <= 750) {
if (!sessionStorage.getItem("ifShowphone")) {
sessionStorage.setItem("ifShowphone", "no");
$(".js_zhanshipc").addClass("showthis");
$(".js_zhanshiphone").removeClass("showthis");
}
$(".js_zhanshipc").on("touchend", function () {
sessionStorage.setItem("ifShowphone", "yes");
window.location.reload();
});
$(".js_zhanshiphone").on("touchend", function () {
sessionStorage.setItem("ifShowphone", "no");
window.location.reload();
});
}
}
// yidongShowpc();
function PhonePCresizeScreen() {
if (widthpcphone > 750) {
var phoneWidth = parseInt(window.screen.width);
var phoneScale = phoneWidth / 750;
var ua = navigator.userAgent;
if (phoneWidth > 750) {
$("meta[name='viewport']").attr(
"content",
"width=device-width, initial-scale=1, user-scalable=no, viewport-fit=cover"
);
} else {
$("meta[name='viewport']").attr(
"content",
"width=750, user-scalable=no, target-densitydpi=device-dpi"
);
}
if ($(".js_zhanshipc").length > 0) {
$(".js_zhanshipc").removeClass("showthis");
$(".js_zhanshiphone").removeClass("showthis");
}
} else {
var ifShowphone = sessionStorage.getItem("ifShowphone");
if ($(".js_zhanshipc").length > 0) {
if (ifShowphone == "no") {
var phoneWidth = parseInt(window.screen.width);
var phoneScale = phoneWidth / 750;
var ua = navigator.userAgent;
if (phoneWidth > 750) {
$("meta[name='viewport']").attr(
"content",
"width=device-width, initial-scale=1, user-scalable=no, viewport-fit=cover"
);
} else {
$("meta[name='viewport']").attr(
"content",
"width=750, user-scalable=no, target-densitydpi=device-dpi"
);
}
$(".js_zhanshipc").addClass("showthis");
$(".js_zhanshiphone").removeClass("showthis");
} else {
$(".js_zhanshiphone").addClass("showthis");
$(".js_zhanshipc").removeClass("showthis");
$("meta[name='viewport']").attr(
"content",
"width=1366, user-scalable=no, target-densitydpi=device-dpi"
);
}
}
}
}
function resizeScreen(screenwidth) {
var metaattr =
"width=" +
screenwidth +
", user-scalable=no, target-densitydpi=device-dpi";
var phoneWidth = parseInt(window.screen.width);
var phoneScale = phoneWidth / screenwidth;
var ua = navigator.userAgent;
if (phoneWidth > screenwidth) {
$("meta[name='viewport']").attr(
"content",
"width=device-width, initial-scale=1, user-scalable=no, viewport-fit=cover"
);
} else {
$("meta[name='viewport']").attr("content", metaattr);
}
}
if (widthpcphone < 751) {
$(".o_main").animate({ opacity: "1" }, 50);
}
$(window).resize(function () {
var widthwww = $(window).width();
if (widthwww < 751) {
$(".o_main").animate({ opacity: "1" }, 50);
}
});
// var bumen_list = [
// {"甯傛暀鑲插眬": 140121133703375766},
// {"甯傚叕瀹夊眬": 140121134008096621},
// {"甯備汉鍔涜祫婧愮ぞ浼氫繚闅滃眬": 140121134635416514},
// {"甯傛皯鏀垮眬": 140121134052634586},
// {"甯備綇鎴垮拰鍩庝埂寤鸿灞€": 140121134735618874},
// {"甯傝嚜鐒惰祫婧愬拰瑙勫垝灞€": 140121135256439264},
// {"甯傚煄甯傜鐞嗗眬": 140121135406639748},
// {"甯備氦閫氳繍杈撳眬": 140121135443830275},
// {"甯傚崼鐢熷仴搴峰": 140625091914826186},
// {"甯傜敓鎬佺幆澧冨眬": 140121140423109034},
// {"甯傚競鍦虹洃绠″眬": 190212143254236634},
// {"甯傚尰淇濆眬": 190212143316642648},
// {"甯傚彂灞曟敼闈╁": 140121133205008720},
// {"甯傚伐涓氬拰淇℃伅鍖栧眬": 140121133602285122},
// {"甯傜鎶€灞€": 140121133813435833},
// {"甯傚徃娉曞眬": 140121134215939541},
// {"甯傚啘涓氬啘鏉戝眬": 140121135527246668},
// {"甯傛按鍔$鐞嗗眬": 140121135614374230},
// {"甯傛捣娲嬪彂灞曞眬": 140121135703717601},
// {"甯傚洯鏋楀拰鏋椾笟灞€": 140121135821593188},
// {"甯傚晢鍔″眬": 140121135908330714},
// {"甯傛枃鍖栧拰鏃呮父灞€": 140121140051151006},
// {"甯備綋鑲插眬": 140121140746238236},
// {"甯傚簲鎬ョ鐞嗗眬": 140121141222719147},
// {"閮ㄩ棬鑱斿悎涓婄嚎": 150507140202653480},
// {"甯傛斂搴滃姙鍏巺": 140121123837866802},
// {"甯傝储鏀垮眬": 140121134336357716},
// {"甯傚璁″眬": 140121140328135034},
// {"甯傛斂搴滃鍔?: 140121140633230501},
// {"甯傜粺璁″眬": 140121141123267307},
// {"甯傛斂搴滃浗璧勫": 140121144519413557},
// {"闈掑矝淇濈◣娓尯绠″": 140121143528076725},
// {"甯備綇鎴垮叕绉噾绠$悊涓績": 140121142538484378},
// {"甯備緵閿€绀?: 140121142308908124},
// {"甯傞€€褰瑰啗浜哄眬": 190212144224082543},
// {"甯傛皯钀ョ粡娴庡眬": 190212144244580131},
// {"甯傚湴鏂归噾铻嶇洃绠″眬": 140121141946027040},
// {"甯傝鏀垮鎵瑰眬": 160115100259909766},
// {"甯傚浗璧勫": 190212144625439440},
// {"甯傚ぇ鏁版嵁灞€": 190212145911173700},
// {"甯傛斂搴滅爺绌跺": 190212145938861188},
// {"甯備俊璁垮眬": 190218145249689640},
// ];
// 浜掑姩澶撮儴 鑾峰彇鍙傛暟浜х敓閾炬帴
// 棣栭〉锛屽洖闊冲锛岄棶棰樻煡璇
function hudonglianjie() {
var hudongheader = window.location.href;
if (hudongheader.indexOf("hudong_header_zxwz3") != -1) {
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return false;
}
// var realid= getQueryVariable("bumenid");
var realname = decodeURIComponent(getQueryVariable("bumenname"));
// console.log(realname);
$(".header_sp .header_center .name").text(realname);
// $(".header_sp .nav_list a").eq(1).attr("href","http://zxwz.qingdao.gov.cn/Site/ListEchoWall.aspx?department="+realid);
// $(".header_sp .nav_list a").eq(2).attr("href","http://zxwz.qingdao.gov.cn/Site/ListQue.aspx?department="+realid);
}
}
hudonglianjie();
// 绻佺畝浣撳垏鎹
setTimeout(function () {
FanJianChange();
}, 300)
function FanJianChange() {
if ($.cookie('FanJianChange') == undefined) {
$.cookie('FanJianChange', 'jian', { path: '/', domain: 'qingdao.gov.cn' })
} else {
if ($.cookie('FanJianChange') == "jian") {
$(".js_fanjianchange").html("绻佷綋涓枃")
// textT_S();
} else {
$(".js_fanjianchange").html("绨¢珨涓枃");
textS_T();
}
}
$("body").off("click", ".js_fanjianchange");
$("body").on("click", ".js_fanjianchange", function (e) {
if (e && e.preventDefault) {
e.preventDefault();
} else {
window.event.returnValue = false; //鍏煎IE
}
if ($.cookie('FanJianChange') == "jian") {
$.cookie('FanJianChange', 'fan', { path: '/', domain: 'qingdao.gov.cn' });
$(".js_fanjianchange").html("绻侀珨涓枃")
// $(".js_fanjianchange").find("a").attr("title","绠€浣撲腑鏂?)
textT_S();
}
})
}
// 涓烘墍鏈 AJAX 璇锋眰璁剧疆榛樿閫夐」 璇锋眰瀹屾垚涔嬪悗 娣诲姞a鐨勭偣鍑籾rl鏇挎崲浜嬩欢
function AjaxDefaultSetting() {
$.ajaxSetup({
success: function (result) {
setTimeout(function () {
FanJianChange();
}, 300)
}
});
$.ajax();
}
AjaxDefaultSetting();
//鐧婚檰鍔熻兘
var USER_NAME = $.cookie("USER_NAME");
var USER_ID = $.cookie("USER_ID");
var USER_TOKEN = $.cookie("USER_TOKEN");//token
if (USER_NAME && USER_ID) {
//鐧婚檰
$(".js_login").show();
$(".js_nologin").hide();
var locUrl = window.location.href;
var loginInfo =
"鎮ㄥソ锛? +
USER_NAME +
"锛?/span>";
loginInfo +=
"閫€鍑裹/span>";
$(".js_login").html(loginInfo);
//鐧婚檰鍚庢斂鍔℃湇鍔¢摼鎺
// var loginZWFW='http://login.qingdao.gov.cn/auth/sso/oauth?goto=aHR0cDovL3Fkendmdy5zZC5nb3YuY24vcWQvcHVibGljL2luZGV4L3N0YXRpY2h0bWwvaW5kZXhfcWQ%3D&ticket=3bqOcN&utype=0&state=-1950457162&client_id=MNXCPU5AL';
var loginZWFW =
"http://qdzwfw.sd.gov.cn/qd/login?goto=http%3A%2F%2Fqdzwfw.sd.gov.cn%2Fqd%2Fpublic%2Findex%2Fstatichtml%2Findex_qd&loginType=login";
$(".js_showModel a,.js_youce a").each(function (index, item) {
if ($.trim($(this).text()) == "鏀垮姟鏈嶅姟") {
$(this).attr("href", loginZWFW);
}
});
//鐧婚檰鍚庝紒涓氬紑鍔?浼佷笟娉ㄩ攢閾炬帴
var loginQykb =
"http://amr-wsdj.qingdao.gov.cn/psout/jsp/gcloud/wsdj/callback.jsp";
$(".part_3 li a,.part_4_right .a_box a").each(function () {
if (
$.trim($(this).text()).indexOf("浼佷笟寮€鍔?) >= 0 ||
$.trim($(this).text()).indexOf("浼佷笟娉ㄩ攢") >= 0
) {
$(this).attr("href", loginQykb);
}
});
} else {
//鏈櫥褰
$(".js_nologin").show();
$(".js_login").hide();
var baseUrl = window.location.href;
if ($(".header_sp").length > 0) {
baseUrl = $.base64.btoa("/zmhd/");
} else {
baseUrl = $.base64.btoa(baseUrl);
}
$(".js_nologin a").attr(
"href",
"http://login.qingdao.gov.cn/auth/sso/login?utype=0&client_id=5BLDBAEPQ&goto=" +
baseUrl
);
}
if (USER_TOKEN) {
$(".js_zycf").off("click");
$(".js_zycf").on("click", function (e) {
var $this = $(this);
if (e && e.preventDefault) {
e.preventDefault();
} else {
window.event.returnValue = false; //鍏煎IE
}
var NewHref = $this.attr("href");
$.ajax({
type: "get",
url: "/common/auth/get/ticket?token=" + USER_TOKEN,
dataType: "json",
success: function (data) {
if (data.isSuccess) {
var ticket = data.data;
NewHref = "http://www.shandong.gov.cn/policyservices/#/home?ticket=" + ticket + "®ioncode=370200000000";
window.open(NewHref);
}
}
})
})
}
// 浜掑姩澶撮儴input 鎼滅储涓虹┖
$(".js_hudonginput").on("click", function () {
var $this = $(this).siblings("input");
var Searchtext = $this.val();
if (Searchtext == "") {
alert("璇疯緭鍏ユ悳绱㈠叧閿瘝锛?);
}
});
// 淇濆瓨 Cookie
function setCookie(name, value) {
document.cookie = name + "=" + escape(value) + ";path=/";
}
var maxDate = new Date("9999-12-31T23:59:59"); //鎴戝敖鍔涗簡 鍒颁簡鏃ュ瓙浠g爜杩樺湪杩愯鐨勮瘽~锛屽樋鍢垮樋~~~婧滄簻鏃
if (isIe8) {
maxDate = new Date("2030-12-31T23:59:59");
}
var cookieArr = [];
function setCookieArr(name, value) {
getCookieArr(name);
if (cookieArr.length > 0) {
var indexOfNum = -1;
for (var i = 0; i < cookieArr.length; i++) {
if (cookieArr[i] == value) {
indexOfNum = i;
}
}
if (indexOfNum == -1) {
if (cookieArr.length >= 5) {
//鏈寘鍚氨鍒ゆ柇闀垮害鏄惁涓烘渶澶э紝濡傛灉鏄垹鍘荤涓€涓紝濡傛灉涓嶆槸鐩存帴灏鹃儴娣诲姞
cookieArr = cookieArr.slice(0, 4);
}
} else {
cookieArr.splice(indexOfNum, 1);
}
}
cookieArr.unshift(value);
var cookieStr = cookieArr.join("&");
$.cookie(name, cookieStr, {
path: "/",
expires: maxDate,
// 'domain':window.location.host
});
}
// 鑾峰彇 Cookie
function getCookie(name) {
cookie_name = name + "=";
cookie_length = document.cookie.length;
cookie_begin = 0;
while (cookie_begin < cookie_length) {
value_begin = cookie_begin + cookie_name.length;
if (
document.cookie.substring(cookie_begin, value_begin) == cookie_name
) {
var value_end = document.cookie.indexOf(";", value_begin);
if (value_end == -1) {
value_end = cookie_length;
}
return unescape(document.cookie.substring(value_begin, value_end));
}
cookie_begin = document.cookie.indexOf(" ", cookie_begin) + 1;
if (cookie_begin == 0) {
break;
}
}
return "";
}
function getCookieArr(name) {
if (!$.cookie(name) || $.cookie(name) == "null" || $.cookie(name) == "") {
return false;
} else {
var cookieStr = $.cookie(name);
cookieArr = cookieStr.split("&");
return cookieArr;
}
}
// 娓呴櫎 Cookie
function delCookie(name) {
var expireNow = new Date();
document.cookie =
name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/";
}
// 鑾峰彇鍦板潃鏍忓弬鏁
function getParamFromUrl(paramName) {
paramValue = "";
isFound = false;
if (
this.location.search.indexOf("?") == 0 &&
this.location.search.indexOf("=") > 1
) {
arrSource = unescape(this.location.search)
.substring(1, this.location.search.length)
.split("&");
i = 0;
while (i < arrSource.length && !isFound) {
if (arrSource[i].indexOf("=") > 0) {
if (
arrSource[i].split("=")[0].toLowerCase() ==
paramName.toLowerCase()
) {
paramValue = arrSource[i].split("=")[1];
isFound = true;
}
}
i++;
}
}
return paramValue;
}
//鏄剧ず鎻愮ず寮瑰眰
function openTips(isSuccess, title) {
if (isSuccess) {
$(".js_tips").addClass("cur success");
$(".js_tips .success").find("p").html(title);
} else {
$(".js_tips").addClass("cur fail");
$(".js_tips .fail").find("p").html(title);
}
$(".o_main").append('
');
// $('body').css('overflow', 'hidden')
}
// 鍏抽棴寮瑰眰
function closeTips() {
$(".js_tips").removeClass("cur");
$(".js_tips").removeClass("success");
$(".js_tips").removeClass("fail");
// $('bo.o_maindy').css('overflow', 'auto')
$(".tipShadow").remove();
}
//鎻愮ず寮瑰眰
$(".js_tips").on("click", ".close", function () {
closeTips();
});
// 鑾峰彇url鍙傛暟
function getRequest(paraName, isDecode) {
var url = window.location.href;
if (isDecode) {
//url瑙g爜
try {
url = url.replace("%%", "%");
url = decodeURIComponent(url);
} catch (e) {
return;
}
}
var arrPara = url.substring(url.indexOf("?") + 1, url.length).split("&"); //闃叉鍑虹幇鍚у叧閿瘝涓湁闂彿
var arr;
for (var i = 0; i < arrPara.length; i++) {
arr = arrPara[i].split("=");
if (arr != null && arr[0] == paraName) {
return arr[1];
}
}
return "";
}
// pc搴曢儴瀵艰埅鍒濆鍖栦笅鎷
$(".footer_pc .js_footer_link .link_box_floor2 .link_item").each(function (
index,
item
) {
hope.selector({
ele: ".js_select_link_" + (index + 1),
on: {
change: function (e) {
$(".js_footer_link .option").removeClass("hopeui-select-this");
if (e.value == "/index.shtml") {
return
} else {
window.open(e.value);
}
},
},
});
});
// 绉诲姩绔 瀵艰埅鍒濆鍖
//$(".footer_phone .js_footer_web_list .web_item").each(function (index, item) {
// hope.selector({
// ele: ".js_select_web_" + (index + 1),
// on: {
// change: function (e) {
// $(".js_footer_web_list .option").removeClass(
// "hopeui-select-this"
// );
// window.open(e.value);
// openwin(e.value)
// },
// },
// });
//});
//function openwin(url) {
// var a = document.createElement("a");
// a.setAttribute("href", url);
// a.setAttribute("target", "_blank");
// a.setAttribute("id", "openwin");
// document.body.appendChild(a);
// a.click();
//}
// 鎵嬫満瀵艰埅
$(".js_daohang").on("click", function () {
var $this = $(this);
$this.siblings(".js_zhezhao").removeClass("displaynone");
setTimeout(function () {
$this.siblings(".js_youce").addClass("show");
}, 1);
});
$(".js_zhezhao").on("click", function (e) {
var $this = $(this);
$this.siblings(".js_youce").removeClass("show");
setTimeout(function () {
$this.addClass("displaynone");
}, 100);
});
// 骞翠唤鎺掑簭
function arrSort(arr, type) {
return arr.sort(function (a1, a2) {
var item1 = Number(a1[type]);
var item2 = Number(a2[type]);
if (item1 < item2) {
return 1;
} else if (item1 > item2) {
return -1;
} else {
return 0;
}
});
}
function onIndexOf(arr, obj) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == obj) {
return i;
}
}
return -1;
}
// 鑾峰彇涓€骞翠竴鏈堜竴鍛
function getData(num) {
var timestamp = Math.round(new Date());
var dataNum = Number(num) * 24 * 60 * 60 * 1000;
// return formatDate(new Date(timestamp - dataNum)) + ',' + formatDate(new Date())
return formatDate(new Date(timestamp - dataNum));
}
function formatDate(now) {
var year = now.getFullYear();
var month = now.getMonth() + 1;
if (month < 10) {
month = "0" + month;
}
var date = now.getDate();
if (date < 10) {
date = "0" + date;
}
return year + "-" + month + "-" + date;
}
// 鐛插彇骞存湀鏃
function GetDate() {
var now = new Date();
var year = now.getFullYear(); //骞
var month = now.getMonth() + 1; //鏈
if (month < 10) {
month = "0" + month;
}
var day = now.getDate(); //鏃
var hh = now.getHours(); //鏃
var mm = now.getMinutes(); //鍒
var dateStr = year + "-" + month + "-" + day;
return dateStr;
}
if (!Array.indexOf) {
Array.prototype.indexOf = function (obj) {
for (var i = 0; i < this.length; i++) {
if (this[i] == obj) {
return i;
}
}
return -1;
};
}
function openShadow() {
$(".js_shadow").addClass("cur");
// $('body').css('overflow', 'hidden')
}
function closeShadow() {
// $('body').css('overflow', 'auto')
$(".js_shadow").removeClass("cur");
}
//杩囨护
var patt1 = new RegExp("[$()*+.[\\]?^{\\\\}|%]", "g");
function delSearchIllegaWords(str) {
if (null != str) {
str = str.replace(patt1, "");
str = str.replace(/script/g, "");
str = str.replace(/&/gi, "&");
str = str.replace(/ /gi, " ");
str = str.replace(/"/gi, '"');
str = str.replace(/'/g, "'");
str = str.replace(//gi, ">");
str = str.replace(/ /gi, ">");
str = str.replace(/(/g, "(");
str = str.replace(/)/g, ")");
str = str.replace(/
]*>(?:(rn)|r|n)?/gi, "n");
str = str.replace(/<\/?[^>]*>/g, ""); //鍘婚櫎HTML Tag
str = str.replace(/[|]*\n/, ""); //鍘婚櫎琛屽熬绌烘牸
str = str.replace(/&npsp;/gi, ""); //鍘绘帀npsp
str = str.replace(/>/gi, "");
str = str.replace(//gi, "");
str = str.replace(/= 0) {
stillSearching = false;
}
}
// 杈撳叆娉 鍗犱綅绗﹂樁娈
$("#qt").on("compositionstart", function () {
flag = false;
});
// 杈撳叆娉 鎻掑叆鏁版嵁闃舵
$("#qt").on("compositionupdate", function () {
flag = false;
});
// 杈撳叆娉 鏁版嵁鎻掑叆缁撴潫鍚
$("#qt").on("compositionend", function () {
flag = true;
});
if (flag && oval != "" && oval.trim().length > 0) {
$.ajax({
type: "get",
url: config.apiUrl + "/igs/front/suggest/term.jhtml",
data: {
code: "4fe430f0de7a4b069ee80f9e17009fbd",
siteId: "5",
fuzzy: false,
searchWord: $.trim($("#" + searchTxt).val()),
},
dataType: "json",
success: function (arr) {
searchDivEl.innerHTML = "";
var isShowList = true;
if ($(".js_header_input ").is(":focus")) {
if (arr.length > 0) {
searchDivEl.style.display = "block";
} else {
if (arr.length == 1) {
if (arr[0] == oval) {
searchDivEl.style.display = "none";
isShowList = false;
} else {
searchDivEl.style.display = "block";
}
} else {
searchDivEl.style.display = "none";
isShowList = false;
}
}
} else {
}
if (isShowList) {
var ulElemet = document.createElement("ul");
for (var i = 0; i < arr.length; i++) {
// 鎼滅储璇嶇浉鍚屼笉灞曠ず
// if (arr[i] == oval) {
// continue;
// }
var oLi = document.createElement("li");
oLi.innerHTML = arr[i];
oLi.classList.add("show_1_line");
ulElemet.appendChild(oLi);
//缁檒i鍔犱簨浠
(function (index) {
oLi.onmouseover = function () {
for (
var i = 0;
i < ulElemet.children.length;
i++
) {
ulElemet.children[i].classList =
"show_1_line";
}
this.className = "show_1_line on";
iNow = index;
};
oLi.onclick = function () {
oT.value = this.innerHTML;
oBtn.click();
};
})(i);
}
searchDivEl.appendChild(ulElemet);
}
},
});
} else {
searchDivEl.style.display = "none";
}
oldValue = oT.value;
}
function cleanList(ev) {
var oval = oT.value;
if (ev.keyCode == 8 && oval.length == 1) {
$(".searchul ul").each(function () {
$(this).remove();
});
}
}
oT.onkeydown = function (ev) {
if (!realTimeSearch) {
var aLi = $(".searchul ul li");
var oEvent = ev || event;
switch (oEvent.keyCode) {
case 40:
// 涓嬮敭
iNow++;
if (iNow == aLi.length) iNow = -1;
for (var i = 0; i < aLi.length; i++) {
aLi[i].className = "";
}
if (iNow == -1) {
oT.value = oldValue;
} else {
aLi[iNow].className = "on";
oT.value = aLi[iNow].innerHTML;
}
break;
case 38:
// 涓婇敭
iNow--;
if (iNow == -2) iNow = aLi.length - 1;
for (var i = 0; i < aLi.length; i++) {
aLi[i].className = "";
}
if (iNow == -1) {
oT.value = oldValue;
} else {
aLi[iNow].className = "on";
oT.value = aLi[iNow].innerHTML;
}
break;
default:
iNow = -1;
}
}
};
}
// 鑰佸勾涓撳尯璺宠浆
function oldAlinkopen() {
$("a[title='闀胯€呯増']").on("click", function (e) {
var $this = $(this);
if (e && e.preventDefault) {
e.preventDefault();
} else {
window.event.returnValue = false; //鍏煎IE
}
//鏈紑鍚緟鍔╁伐鍏锋椂鎵撳紑杈呭姪宸ュ叿鐨勪唬鐮
var openStatus = EsdToolbarInit.getCookie("wzaIsOn");
if (openStatus == null || openStatus == "false" || openStatus == false) {
EsdToolbarInit.loadScript(null);
EsdToolbarInit.setCookie("wzaIsOn", "true", 10);
}
setTimeout(function () {
var NewHref = $this.attr("href");
var nowurl = window.location.href;
if (nowurl.indexOf("ywdt/zwzl/zzgh") > -1) {
location.reload()
} else {
window.location.href = '/ywdt/zwzl/zzgh/'
}
}, 10)
})
}
$(function () {
oldAlinkopen();
if ($(".js_header_input").length > 0) {
if (!isIe9 && !isIe8) {
//澶撮儴涓嬫媺
search("header_input", "ulSearchList", "clickSearchBtn");
//鎼滅储杈撳叆妗
var isBox = false;
$("#ulSearchList").hide();
$(".js_header_input").focus(function () {
if ($(this).siblings("#ulSearchList").find("li").length > 0) {
$(this).siblings("#ulSearchList").show();
}
isBox = true;
});
$(".js_header_input")
.parent(".input_box")
.mousemove(function () {
isBox = true;
})
.mouseout(function () {
isBox = false;
});
//鍏冪礌澶辩劍浜嬩欢
$(".js_header_input").blur(function () {
if (isBox == true) {
return false;
}
$(this).siblings("#ulSearchList").hide();
});
//涓嬫媺缁戝畾鐐瑰嚮浜嬩欢
$("#ulSearchList").on("click", "li", function () {
isBox = false;
var text = $(this).text();
if ($("#ulSearchList li a").length < 0) {
$(this).parent().siblings(".js_header_input").val(text);
$(this).parent().hide();
go();
} else {
$("#ulSearchList").hide();
}
});
//涓嬫媺缁戝畾榧犳爣鏍峰紡
$("#ulSearchList").on("mouseover", "li", function () {
$(this).addClass("on");
});
$("#ulSearchList").on("mouseout", "li", function () {
$(this).removeClass("on");
});
} else {
var headInput = $("#header_input").oInputSelect({
inputFn: function (val) {
// headInput.changelist(['11','11','11','11','11','11','11','11']);
if (val != "") {
$.ajax({
type: "get",
url:
config.apiUrl + "/igs/front/suggest/term.jhtml",
data: {
code: "4fe430f0de7a4b069ee80f9e17009fbd",
siteId: "5",
fuzzy: false,
searchWord: val,
},
dataType: "json",
success: function (data) {
if (data.length > 0) {
headInput.changelist(data);
var liHeight = $(
".listbox .o_scrollbody ul"
).innerHeight();
// console.log('liHeight==', liHeight)
$(".o_InputSelectBox .listbox .list").css(
"height",
liHeight
);
} else {
// 鎺╄棌涓嬫媺妗
$(".listbox").hide();
}
},
});
}
},
openFn: function (val) {
// console.log('openfun==', val)
},
changeFn: function (val) {
// console.log('callbackFn==', val);
var $thisinput = $(".js_header_input");
var val = $thisinput.val();
// 璋冪敤鏌ヨ鎺ュ彛
if ($.trim(val)) {
if (isSearchPage(val)) {
stillSearching = false;
//濡傛灉鏃堕棿娌℃湁闄愬埗 灏辨寜鐓ч粯璁や笁骞
if (
$(".js_date_limit").parent().find(".cur")
.length == 0
) {
gj_timeRange = getData(1095);
$(".js_date_limit")
.eq(1)
.addClass("cur")
.siblings()
.removeClass("cur");
}
getSreachFun();
}
} else {
openTips("", "璇疯緭鍏ユ绱㈣瘝");
return false;
}
},
});
hope.input({
ele: "#header_input",
});
$(".js_header_input").focus(function () {
headInput.inputFn($(this).val());
});
}
// 鎼滅储妗嗗洖杞︿簨浠
if (isIe9 || isIe8) {
$(".js_header_input").bind("keypress", function (event) {
if (event.keyCode == 13) {
// 璋冪敤鏌ヨ鎺ュ彛
var val = $(this).val();
if ($.trim(val)) {
if (isSearchPage(val)) {
stillSearching = false;
//濡傛灉鏃堕棿娌℃湁闄愬埗 灏辨寜鐓ч粯璁や笁骞
if (
$(".js_date_limit").parent().find(".cur")
.length == 0
) {
gj_timeRange = getData(1095);
$(".js_date_limit")
.eq(1)
.addClass("cur")
.siblings()
.removeClass("cur");
}
getSreachFun();
}
} else {
openTips("", "璇疯緭鍏ユ绱㈣瘝");
return false;
}
$(".o_InputSelectBox .listbox").hide();
$("#ulSearchList").hide();
$(".js_header_input").blur();
}
});
}
// 鐐瑰嚮鎼滅储鎸夐挳
$(".header_search").on("click", ".js_clickSearchBtn", function () {
if (isIe9 || isIe8) {
var $thisinput = $(".js_header_input");
} else {
var $thisinput = $(this).siblings(".js_header_input");
}
var val = $thisinput.val();
if ($.trim(val)) {
if (isSearchPage(val)) {
stillSearching = false;
//濡傛灉鏃堕棿娌℃湁闄愬埗 灏辨寜鐓ч粯璁や笁骞
if ($(".js_date_limit").parent().find(".cur").length == 0) {
gj_timeRange = getData(1095);
$(".js_date_limit")
.eq(1)
.addClass("cur")
.siblings()
.removeClass("cur");
}
//聽鍖呭惈浠ヤ笅鐨勫畬鏁村叧閿瘝
includesFull = "";
$("#hightGrade_search2").val("");
//聽鍖呭惈浠ヤ笅浠绘剰涓€涓叧閿瘝
includesAny = "";
$("#hightGrade_search3").val("");
//聽涓嶅寘鍚互涓嬪叧閿瘝
notIncludes = "";
$("#hightGrade_search4").val("");
// 璋冪敤鏌ヨ鎺ュ彛
getSreachFun();
}
} else {
openTips("", "璇疯緭鍏ユ绱㈣瘝");
return false;
}
$("#ulSearchList").hide();
if (isIe9 || isIe8) {
headInput.inputFn($(this).val());
}
});
getsearch_hot_wordFun();
// 鐐瑰嚮鐑瘝鍒楄〃杩涜蹇€熸悳绱
$(".hot_word_list").on("click", ".js_click_headerHotword", function () {
var searchWord = $(this)
.attr("times")
.replace(/"/gi, '"');
$(".js_header_input").val(searchWord);
$(".js_header_input").siblings("label").hide();
if (isSearchPage(searchWord)) {
//聽鍖呭惈浠ヤ笅鐨勫畬鏁村叧閿瘝
includesFull = "";
$("#hightGrade_search2").val("");
//聽鍖呭惈浠ヤ笅浠绘剰涓€涓叧閿瘝
includesAny = "";
$("#hightGrade_search3").val("");
//聽涓嶅寘鍚互涓嬪叧閿瘝
notIncludes = "";
$("#hightGrade_search4").val("");
// 璋冪敤鏌ヨ鎺ュ彛
getSreachFun();
$("body,html").animate(
{
scrollTop: 0,
},
500
);
}
});
}
// 鐐瑰嚮澶村鑸樉绀哄脊灞
// $('.js_showModel').click(function () {
// openTips(true, '姝e湪鍔姏寤鸿涓?..')
// })
// 璋冪敤 鏌ヨ[鎼滅储鐑瘝]鏂规硶
// 鏌ヨ[鎼滅储鐑瘝]
function getsearch_hot_wordFun() {
// 鍔犱竴涓垽鏂惂 濡傛灉鏄粺涓€妫€绱㈢殑椤甸潰 鍒欎笉鎵ц鍏敤
// 鍚屾剰妫€绱㈤〉闈㈡湁鍗曠嫭鐨勭儹鍒烘柟娉
if ($(".tyse_header").length > 0) {
return false
}
if ($(".searchtgcs").length == 0) {
$.ajax({
type: "get",
// 鍔ㄦ€
// url: config.apiUrl + '/igs/front/statistics/find_search_hot_word.jhtml',
// 鏆傛椂鍐欐
url:
config.apiUrl +
"/igs/front/statistics/find_search_hot_word.jhtml",
data: {
siteId: "5",
},
dataType: "json",
success: function (data) {
var hotWordList = data; //鏂伴椈鍒楄〃鍐呭
// 寰幆鐢熸垚鏂伴椈鍒楄〃
var headerHotWordHtml = "";
var leftHotWordHtml = "";
if ($(".js_hotWord_Ul ").length != 0) {
// 濡傛灉娌掓湁鎼滅储鏃讹紝鎼滅储绗竴涓儹璇
if ($(".js_header_input").val() == "") {
$(".js_header_input").val(hotWordList[0].name);
}
getSreachFun();
}
// 璁剧疆澶撮儴鎼滅储
$(".js_header_input").attr(
"placeholder",
"鎼滅储鎮ㄦ兂浜嗚В鐨勬斂绛?璧勮/鏈嶅姟"
);
if ($("#header_input").siblings("label").length != 0) {
$("#header_input")
.siblings("label")
.text("鎼滅储鎮ㄦ兂浜嗚В鐨勬斂绛?璧勮/鏈嶅姟");
}
// 鏍规嵁瀛楁暟鍒ゆ柇 濡傛灉瀛楁暟澶х害15涓瓧 鍒欏彇4涓 鍚﹀垯5涓
var topfivestr = "";
var hotnum = 0;
for (var i = 0; i < 5; i++) {
topfivestr = topfivestr + hotWordList[i].name;
}
var pattern_chin = /[\u4e00-\u9fa5]/g;
var count_chin = topfivestr.match(pattern_chin).length;
// console.log(count_chin);
if ($(".header_sp").length > 0) {
if (count_chin > 19) {
hotnum = 4;
} else {
hotnum = 5;
}
} else {
if (widthpcphone <= 750 && count_chin > 17) {
hotnum = 4;
} else {
hotnum = 5;
}
}
for (var i = 0; i < hotWordList.length; i++) {
// 鍓嶅洓涓儹璇嶈鍦ㄥご瀵艰埅锛屽墿涓嬬殑鏀惧湪鍙充晶
// if (i > 3 && i < 13) {
// leftHotWordHtml += '';
// leftHotWordHtml += '' + (i - 3) + '';
// leftHotWordHtml += ' ';
// leftHotWordHtml += ' ';
// } else {
// headerHotWordHtml += ' ';
// }
var y = hotWordList[i].name;
y = delHtml(y);
if (i < 10) {
leftHotWordHtml += "";
leftHotWordHtml +=
'' +
(i + 1) +
"";
leftHotWordHtml +=
' ";
leftHotWordHtml += " ";
}
if (i < hotnum) {
headerHotWordHtml +=
' ";
}
}
// 鎻掑叆鍒板ご閮╱l涓
$(".js_headerHotword_Ul").html(headerHotWordHtml);
if ($(".js_hotWord_Ul").length != 0) {
$(".js_hotWord_Ul").html(leftHotWordHtml);
}
// if(window.location.pathname.indexOf('searchAll')>=0){
// // 鎻掑叆鍒板彸渚l涓
// // 鎼滅储鐑瘝涔嬪悗锛岃皟鐢ㄥ彲鑳芥劅鍏磋叮鍒楄〃
// // if (getCookie("keywords")) {
// // getInterestedList(getCookie("keywords"));
// // } else {
// // // 鎺╄棌鎰熷叴瓒
// // var keywords = $('.js_hotWord_Ul li a').eq(0).text();
// // getInterestedList(keywords);
// // }
// }
},
});
} else {
var hotWordList = [{ name: "浼佷笟", times: 1448, day: 1654132297254 },
{ name: "浼佷笟寮€鍔?, times: 806, day: 1654132297254 },
{ name: "椤圭洰", times: 683, day: 1654132297254 },
{ name: "浜烘墠", times: 660, day: 1654132297254 },
{ name: "鐤儏闃叉帶", times: 409, day: 1654132297254 },
{ name: "鍖诲吇缁撳悎", times: 368, day: 1654132297254 },
{ name: "鍏Н閲?, times: 365, day: 1654132297254 },
{ name: "鍥藉瀹為獙瀹?, times: 338, day: 1654132297254 },
{ name: "浜烘墠寮曡繘", times: 290, day: 1654132297254 },
{ name: "鏃呮父", times: 274, day: 1654132297254 }]; //鏂伴椈鍒楄〃鍐呭
// 寰幆鐢熸垚鏂伴椈鍒楄〃
var headerHotWordHtml = "";
var leftHotWordHtml = "";
if ($(".js_hotWord_Ul ").length != 0) {
// 濡傛灉娌掓湁鎼滅储鏃讹紝鎼滅储绗竴涓儹璇
if ($(".js_header_input").val() == "") {
$(".js_header_input").val(hotWordList[0].name);
}
getSreachFun();
}
// 璁剧疆澶撮儴鎼滅储
$(".js_header_input").attr(
"placeholder",
"澶у鍦ㄦ悳 " + hotWordList[0].name
);
if ($("#header_input").siblings("label").length != 0) {
$("#header_input")
.siblings("label")
.text("澶у鍦ㄦ悳 " + hotWordList[0].name);
}
// 鏍规嵁瀛楁暟鍒ゆ柇 濡傛灉瀛楁暟澶х害15涓瓧 鍒欏彇4涓 鍚﹀垯5涓
var topfivestr = "";
var hotnum = 0;
for (var i = 0; i < 5; i++) {
topfivestr = topfivestr + hotWordList[i].name;
}
var pattern_chin = /[\u4e00-\u9fa5]/g;
var count_chin = topfivestr.match(pattern_chin).length;
// console.log(count_chin);
if ($(".header_sp").length > 0) {
if (count_chin > 19) {
hotnum = 4;
} else {
hotnum = 5;
}
} else {
if (widthpcphone <= 750 && count_chin > 17) {
hotnum = 4;
} else {
hotnum = 5;
}
}
for (var i = 0; i < hotWordList.length; i++) {
// 鍓嶅洓涓儹璇嶈鍦ㄥご瀵艰埅锛屽墿涓嬬殑鏀惧湪鍙充晶
// if (i > 3 && i < 13) {
// leftHotWordHtml += '';
// leftHotWordHtml += '' + (i - 3) + '';
// leftHotWordHtml += ' ';
// leftHotWordHtml += ' ';
// } else {
// headerHotWordHtml += ' ';
// }
var y = hotWordList[i].name;
y = delHtml(y);
if (i < 10) {
leftHotWordHtml += "";
leftHotWordHtml +=
'' +
(i + 1) +
"";
leftHotWordHtml +=
' ";
leftHotWordHtml += " ";
}
if (i < hotnum) {
headerHotWordHtml +=
' ";
}
}
// 鎻掑叆鍒板ご閮╱l涓
$(".js_headerHotword_Ul").html(headerHotWordHtml);
if ($(".js_hotWord_Ul").length != 0) {
$(".js_hotWord_Ul").html(leftHotWordHtml);
}
}
}
// 杈撳叆鏃堕樆姝簨浠跺啋娉★紝闃叉瑙﹀彂鏃犻殰纰
$("input").on("keyup", function (e) {
e.stopPropagation();
});
$("input").on("keydown", function (e) {
e.stopPropagation();
});
});
// 鐐瑰嚮澶村鑸樉绀哄脊灞
// $('.js_showModel,.js_business_services_url').click(function () {
// openTips(true, '姝e湪鍔姏寤鸿涓?..')
// })
// 澶村鑸彍鍗曢€変腑鏍峰紡
$(".js_showModel a").removeClass("cur");
function positionHeadNav() {
var pasthName = window.location.pathname;
pasthName = pasthName.replace("/gate/big5/www.qingdao.gov.cn", "");
var fileName = pasthName.substring(0, 6);
// if(pasthName.substring(0,11).indexOf('gggs')>=0){
// $(".js_showModel a").eq(5).addClass('cur')
// }else{
if (fileName == "/") {
$(".js_showModel a").eq(0).addClass("cur");
} else {
$(".js_showModel a").each(function (index, element) {
if (index != 0 && index != 3 && index != 5) {
var $this = $(this);
var navHref = $this.attr("href");
if (navHref.indexOf(fileName) >= 0) {
$this.addClass("cur");
}
}
});
}
// }
}
// if(!isHomePage){
positionHeadNav();
// }
//鐐瑰嚮绾犻敊鍥炬爣
function Link(site_code) {
//鑾峰彇璇ョ珯鐐归渶瑕佺籂閿欓〉闈㈢殑url鍦板潃
var url = getCurrUrl();
//璺宠浆鑷崇籂閿欑郴缁熷~鍐欓〉闈
window.open(
"https://zfwzgl.www.gov.cn/exposure/jiucuo.html?site_code=" +
site_code +
"&url=" +
encodeURIComponent(url)
);
}
//鑾峰彇璇ョ珯鐐归渶瑕佺籂閿欓〉闈㈢殑url鍦板潃
function getCurrUrl() {
var url = "";
if (parent !== window) {
try {
url = window.top.location.href;
} catch (e) {
url = window.top.document.referrer;
}
}
if (url.length == 0) url = document.location.href;
return url;
}
$(function () {
if (!sessionStorage.getItem("screenwidth")) {
sessionStorage.setItem("screenwidth", "750");
}
$(".js_typechange").on("touchend", function () {
sessionStorage.setItem("screenwidth", "1280");
setTimeout(function () {
resizeScreen(1280);
window.location.reload();
}, 100);
});
if (navigator.userAgent.match(/(iPhone|iPod|Android|ios|Mobile)/i)) {
if (sessionStorage.getItem("screenwidth") == "1280") {
$(".js_typechange_pc").show();
}
}
$(".js_typechange_pc").on("touchend", function () {
sessionStorage.setItem("screenwidth", "750");
setTimeout(function () {
resizeScreen(750);
window.location.reload();
}, 100);
});
});
resizeScreen(+sessionStorage.getItem("screenwidth") || 750);
// window.setTimeout(function(){
// $('body').show()
// },100)
$(window).resize(function () {
setTimeout(function () {
resizeScreen(+sessionStorage.getItem("screenwidth") || 750);
}, 10);
});
// 鍒ゆ柇瀛楁鎵嬪ご涓虹┖
function isNull(a) {
if (
typeof a == "undefined" ||
a == [] ||
a == "" ||
a == "null" ||
a == null
) {
return true;
}
return false;
}
// showLoading();
function ShowLoading() {
$('.js_shadow').addClass('cur'); //閬僵
$('.loading_box').show();
//鏃嬭浆鍥剧墖
rotation();
}
function HiddenLoading() {
$('.loading_box').hide();
$('.js_shadow').removeClass('cur'); //閬僵
}
//鏃嬭浆鍥剧墖
var rotation = function () {
$(".loading_img").rotate({
angle: 0,
animateTo: 360,
callback: rotation,
easing: function (x, t, b, c, d) { // t: current time, b: begInnIng value, c: change In value, d: duration
return c * (t / d) + b;
}
});
}