//=== viewid:dh_style_01_1514430255311 ===//
/*pc,鎵嬫満鏄剧ず闅愯棌*/
function is_mobile(){
return window.screen.width<767 || ($('body').width() > 0 && $('body').width() < 767);
}
var is_mobile_boolean = is_mobile();
$(function(){
/*pc,鎵嬫満鏄剧ず闅愯棌*/
})
//=== viewid:dh_style_01_1514430255311 ===//
function navSwtich(obj) {
$(obj).siblings(".menuUlCopy").slideToggle(200);
$(obj).toggleClass('ontoggle');
$(obj).parent().siblings().find(".menuUlCopy").slideUp(200);
$(obj).parent().siblings().find(".fa-angle-down").removeClass('ontoggle');
}
function subLeft_dh_style_01_1514430255311(){
$("#dh_style_01_1514430255311 .menuUl>li").each(function(){
$(this).find(".menuUl03").css("left",'100%');
})
}
$(window).resize(function() {
subLeft_dh_style_01_1514430255311();
})
$(function(){
$("#dh_style_01_1514430255311 .fa-navicon").click(function(){
$("#dh_style_01_1514430255311").addClass('clearTransform');
$("#dh_style_01_1514430255311 .menuUlCopy").each(function(){
$(this).siblings(".fa").show();
})
})
subLeft_dh_style_01_1514430255311();
$("#dh_style_01_1514430255311 .subBox").css("top",$("#dh_style_01_1514430255311 .menuUl_box").height());
if($("#dh_style_01_1514430255311 .menuUl").hasClass("noHover")){
var tabNum = 0;
$("#dh_style_01_1514430255311 .menuUl>li").find(".Onsub").each(function(){
tabNum += 1;
$(this).parent().attr("tabNum",tabNum)
})
$("#dh_style_01_1514430255311 .menuUl>li .Onsub").mouseover(function(){
$("#dh_style_01_1514430255311 .subBox").show();
var index = $(this).parent().attr("tabNum");
$("#dh_style_01_1514430255311 .subBox .subItems").eq(index-1).fadeIn(100).siblings().hide();
$("#dh_style_01_1514430255311 .subBox .subMenuImgArea .subMenuImgCon").eq(0).fadeIn(100).siblings().hide();
})
$("#dh_style_01_1514430255311 .subBox").mouseleave(function(){
$(this).hide();
});
$("#dh_style_01_1514430255311 .menuUl>li .Nosub").mouseover(function(){
$("#dh_style_01_1514430255311 .subBox").hide();
})
//椋庢牸41 42
}
})
//=== viewid:searchbox_style_01_1541940675935 ===//
$("#searchbox_style_01_1541940675935 .search-btn").click(function(){
var kw=$("#searchbox_style_01_1541940675935 .search_input").val();
var gourl = $(this).attr("attrhref");
href = gourl+(gourl.indexOf('?')>-1?'&':'?')+"pkeyword="+kw;
window.open(href);
})
function searchOne(lname){
var gourl = $(lname).attr("attrhref");
href = gourl+(gourl.indexOf('?')>-1?'&':'?')+"pkeyword="+$(lname).html();
window.open(href);
}
$("#searchbox_style_01_1541940675935 .search_input").val(decodeURIComponent(Request("pkeyword")));
function goSearch(form) {
console.log('form: ', form);
$(form).find('.search-btn').trigger('click');
return false;
}
//=== viewid:newsDetail_style_01_1542213116838 ===//
// var content_div = '';
// var show_div = '';
// var flag="";
// var lang="";
// var show_style="";
// var page_length = "";
var content_length = 0;
var page_num = 1;
var start_flag = 0;
var end_flag = 0;
var content_arr = '';
// var total_lenth = 0;
// var page_count = 0;
function getPage(hideNewsContent) {
if(flag == 2){
var content = $(hideNewsContent).html();
content_arr = content.split(/
]*>/);
page_count = content_arr.length;
}
else{
total_lenth = $(hideNewsContent).text().trim().length;
page_count = Math.ceil(total_lenth / page_length);
content_arr = $(hideNewsContent).html();
}
$(hideNewsContent).empty();
}
function goto(page,newsText,view_id,obj='', showAllText = '') {
if(obj && !newsText && !view_id){
view_id = $(obj).parents('.newsDetail').attr("id");
newsText = '#'+view_id+' .newsText.contSet';
}
if(page != -1 && !is_login && need_check_login == 1){
checkLogin();
}
if(page == -1 || is_login || need_check_login == 0){
content_length = 0;
start_flag = 0;
end_flag = 0;
if(page < 1) page_num = 1;
else if(page > page_count) page_num = page_count;
else page_num = page;
if(flag == 1){
$(newsText).html(content_arr);
getChildren(newsText);
}
else{
$(newsText).html(content_arr[page_num - 1]);
}
pagebutton(newsText, view_id, showAllText);
if(page != -1){
location.href = newsText;
}
setDivHeight(newsText)
}
}
function getChildren(el) {
var child = $(el).children();
if(child.length > 0){
child.each(function () {
if(end_flag == 1) return false;
content += $(this).contents().filter(function() {
return this.nodeType === 3;
}).text();
content_length += $(this).contents().filter(function() {
return this.nodeType === 3;
}).text().length;
//鑾峰彇涓婁竴椤电粨灏
if(start_flag == 0 && content_length >= (page_num - 1) * page_length){
var parents = $(this).parentsUntil(el);
start_flag = 1;
var need_length = content_length - ((page_num - 1) * page_length);
//灏嗗綋鍓嶉〉寮€澶村埌涓婁竴椤电粨灏句负姝㈠鍑烘潵鐨勫唴瀹瑰幓鎺
if(need_length > 0){
var now_html = $(this).html();
var now_text_length = $(this).contents().filter(function() {
return this.nodeType === 3;
}).text().length;
now_html = now_html.substring(now_text_length - need_length, now_html.length);
$(this).html(now_html);
}
parents.each(function () {
$(this).prevAll().remove();
});
}
//鑾峰彇褰撳墠椤电粨灏
if(content_length >= page_num * page_length){
var parents = $(this).parentsUntil(el);
var need_length = content_length - (page_num * page_length);
if(need_length == 0){
parents.each(function () {
$(this).nextAll().remove();
});
}
else{
var now_text = $(this).contents().filter(function() {
return this.nodeType === 3;
}).text();
var need_text = now_text.substring(0, now_text.length - need_length);
$(this).text(need_text);
parents.each(function () {
$(this).nextAll().remove();
});
}
end_flag = 1;
return false;
}
else {
var flag = getChildren(this);
}
});
}
}
function showAll() {
if(need_check_login == 1){
checkLogin();
}
if(is_login == true || need_check_login == 0){
$('.news_pagination').remove();
if(flag == 2){
$(show_div).html(content_arr.join(''));
}
else{
$(show_div).html(content_arr);
}
location.href = show_div;
setDivHeight(show_div)
}
}
function pagebutton(newsText,view_id, showAllText = '') {
$('#'+view_id+' .news_pagination').remove();
if (!showAllText) {
showAllText = '鏄剧ず鍏ㄩ儴';
}
var button_html = '';
$(newsText).after(button_html);
}
function checkLogin(errorText = '', loginText = '') {
var serverUrl = '//' + diy_js_server + '/sysTools.php?mod=viewsConn&act=checkUserLogin&idweb=' + id_web;
if (!errorText) {
errorText = '浜诧紝鎮ㄥ繀椤荤櫥褰曚簡鎵嶅彲缁х画鏌ョ湅璇ユ枃绔?;
}
if (!loginText) {
loginText = '椹笂鐧诲綍';
}
//鑾峰彇鏁版嵁 xhrFields瑙e喅浼犺緭cookie闂
$.ajax({
type: 'get',
cache: false,
dataType: 'json',
async: false,
url: serverUrl,
xhrFields: {
withCredentials: true
},
crossDomain: true,
success: function(result){
if(result.is_login == false){
var fun_str = is_mobile() ? 'OnLogin(' + lang +', 0, \'' + location.href + '\')' : 'OnLogin(' + lang +', 0)';
var html = '';
$('body').css({overflowY:'hidden',height:'100%'});
$('body').append(html);
}
else {
is_login = true
}
}
});
}
function hideLogin() {
$('.mustlogin').remove();
}
//=== viewid:newsDetail_style_01_1542213116838 ===//
//--
$(function(){
var viewid="newsDetail_style_01_1542213116838";
var sys_url="viewid=newsDetail_style_01_1542213116838&name=newsDetail&style=style_01&langid=0&pageid=66053&viewCtrl=newsDetail&isfb=1";
var moreParams='';
if(typeof(history.pushState) != 'undefined'){
var hstate=JSON.stringify(history.state);
if(hstate!='null'&& hstate!=null){
eval('var hjson = ' + hstate);
moreParams=hjson.moreParamsnewsDetail_style_01_1542213116838;
}
}
RequestURL(viewid,sys_url,moreParams);
});
//--
//=== viewid:newsDetail_style_01_1542213116838 ===//
detailHeightAuto("newsDetail_style_01_1542213116838", "璇︽儏鍔犺浇涓?);