$(function () {
var winW = $(window).width();
$(function () {
if ($('.e-module-202403261417').length > 0) {
function module202403261417Fun($target) {
var module202403261417Obj = {
init: function () {
// 获取属性
this.win = $(window);
this.bannerObj = $target;
this.bannerText = this.bannerObj.find('.text');
this.resizeInit();
this.addVideoLink(this.bannerObj.find('>.e-lazy'));
// this.setTextTime();
this.resizeEvent();
},
resizeInit: function () {
this.winw = this.win.width();
},
addVideoLink: function (bgObj) {
if (bgObj.data('src') != undefined && bgObj.data('src') != '' && this.winw >
1200) {
// 添加video的dom结构
if (bgObj.find('.video').length == 0) {
bgObj.append(
""
);
}
// 判断视频是否已经赋值,如果赋值了,就不需要再次赋值了。
var videoObj = bgObj.find('.video');
if (videoObj.attr("src") != bgObj.data('src')) {
videoObj.attr("src", bgObj.data('src'));
}
} else {
bgObj.find('.video').remove();
}
},
setTextTime: function () {
if (this.winw > 1200) {
var videoObj = $(".e-module-202403261417 .video")[0]; // 获取视频对象
var videoCurrentTime = 0; // 获取视频播放到第几秒
var loopStart = 5; // 无限轮播开始时间
var loopEnd = 11; // 无限轮播结束时间
// 开启监听定时器
var aaa = setInterval(function () {
// 获取视频播放到第几秒
function getOneDecimalPlace(num) {
return Math.floor(num * 10) / 10;
}
videoCurrentTime = getOneDecimalPlace(videoObj.currentTime);
// 设置视频无限轮播的范围
if (videoCurrentTime == loopEnd) {
videoObj.currentTime = loopStart;
}
if (videoCurrentTime == loopStart - 1.1) {
$(".e-module-202403261417").addClass("animate-v2");
}
}, 100);
}
},
resizeEvent: function () {
// 页面resize事件
var _this = this;
var resizeWinw = 0;
var resizeTimer = '';
this.win.on('resize', function () {
var winw = _this.win.width();
if (winw != resizeWinw) {
currentWinw = winw;
// 删除之前的定时器
if (resizeTimer) {
clearTimeout(resizeTimer);
}
// 添加新的定时器
resizeTimer = setTimeout(function () {
// 调用函数
_this.resizeInit(); // 需要rezise的变量
_this.addVideoLink(_this.bannerObj.find('>.e-lazy'));
}, 200)
}
})
}
}
module202403261417Obj.init();
}
// 初始化
$('.e-module-202403261417').each(function () {
// 防止js文件被执行2次。
var _this = $(this);
if (_this.data('init')) {
return;
}
_this.data('init', true);
module202403261417Fun($(this));
})
}
})
$(".e-module-202403261452 .con").hover(function () {
var _this = $(this);
if ($(window).width() > 1200) {
if (_this.find("video").length == 0) {
var videoStr = "";
_this.find(".video-box").append(videoStr);
} else {
_this.find("video")[0].play();
_this.find(".icon").css("zIndex", 1);
}
}
}, function () {
var _this = $(this);
if (_this.find("video").length > 0) {
_this.find("video")[0].pause();
_this.find(".icon").css("zIndex", 3);
}
});
if (winW > 1200) {
var off202403261452 = true;
$(window).on("scroll.e-module-202403261452", function () {
if ($(window).scrollTop() + $(window).height() * 0.5 > $(".e-module-202403261452").offset().top) {
if (off202403261452) {
off202403261452 = false;
$(".e-module-202403261452 .num").each(function () {
var _this = $(this);
var num = parseInt(_this.attr("data-num"));
var cishu = parseInt(num / 50);
var curNum = 0;
if (cishu < 1) {
cishu = 1;
}
var iTime = setInterval(function () {
if (num < curNum + cishu) {
clearInterval(iTime);
_this.text(num);
} else {
_this.text(curNum += cishu);
}
}, 30)
})
}
}
})
} else {
$(".e-module-202403261452 .num").each(function () {
var _this = $(this);
var num = parseInt(_this.attr("data-num"));
_this.text(num);
})
}
if (winW > 1200) {
var off202403261439 = true;
$(window).on("scroll.e-module-202403261439", function () {
if ($(window).scrollTop() + $(window).height() * 0.5 > $(".e-module-202403261439").offset().top) {
if (off202403261439) {
off202403261439 = false;
$(".e-module-202403261439 .num").each(function () {
var _this = $(this);
var num = parseInt(_this.attr("data-num"));
var cishu = parseInt(num / 50);
var curNum = 0;
if (cishu < 1) {
cishu = 1;
}
var iTime = setInterval(function () {
if (num < curNum + cishu) {
clearInterval(iTime);
_this.text(num);
} else {
_this.text(curNum += cishu);
}
}, 30)
})
}
}
})
} else {
$(".e-module-202403261439 .num").each(function () {
var _this = $(this);
var num = parseInt(_this.attr("data-num"));
_this.text(num);
})
}
$(window).on("scroll.scrollBottomTopAnimeta", function () {
if (off) {
off = false
animateInit();
}
scrollBottomTopAnimeta();
});
// 页面滚动动画:初始化
var animateInitsetTimeout = '';
var translateY1Obj = '';
var off = true;
// 页面滚动动画:下到上
function scrollBottomTopAnimeta() {
if (winW > 1200) {
scrollTop = $(window).scrollTop();
for (var i = 0; i < boxTopAll.length; i++) {
if (boxTopAll[i] < winH + scrollTop) {
var topNum = numLine[i] + (boxTopAll[i] - winH - scrollTop);
if (topNum < 2) {
topNum = 0;
}
translateY1Obj.eq(i).css({
"transform": "translateY(" + topNum + "px)",
"opacity": 1 - topNum / numLine[i]
});
}
}
}
}
function animateInit() {
translateY1Obj = $('.translateY1');
if (winW > 1200) {
// 计算所有动画的位置
numLine = [];
boxTopAll = [];
winH = $(window).height();
// 初始化动画位置
translateY1Obj.each(function () {
var _this = $(this);
var num = _this.data('line') ? _this.data('line') : 200;
numLine.push(num);
_this.css("transform", "translateY(" + num + "px)");
})
clearTimeout(animateInitsetTimeout);
animateInitsetTimeout = setTimeout(function () {
translateY1Obj.each(function () {
var _this = $(this);
var num = _this.data('line') ? _this.data('line') : 200;
boxTopAll.push(_this.parent().offset().top + num);
})
scrollBottomTopAnimeta();
}, 400)
} else {
translateY1Obj.css("transform", "translateY(0px)");
}
}
animateInit();
// 导航
$("#mob-menubtn").on("click", function () {
$('.main-header').addClass('open');
$('#close-menubtn').show();
$('#mob-menubtn').hide();
$('body').css('overflow', 'hidden')
})
$("#close-menubtn").on("click", function () {
closeMenu()
})
//mob端关闭导航
function closeMenu() {
// $('.nav-new').removeClass('active')
$('.main-header').removeClass('open');
$('#close-menubtn').hide();
$('#mob-menubtn').show();
$('body').css('overflow', 'auto')
}
// 定位导航
function fixedNav() {
// 基础对象
var winW = $(window).width();
// 对象
var navObj = $('.bz-header');
var liObj = navObj.find('.li');
var boxObj = $('.anchorpoint');
if ($('.e-module-202208270930').css('display') == 'block') {
if (winW > 1600) {
navObj.css("top", "52px");
} else {
navObj.css("top", "42px");
}
} else {
navObj.css("top", 0);
}
$('.e-module-202208270930').on("click", function () {
navObj.animate({
"top": 0
});
})
// 锚点定位,如果链接有带参数,自动触发点击事件
anchorFun();
// 点击导航栏按钮事件
liObj.on('click', function (e) {
// 阻止时间冒泡
e.stopPropagation();
var _this = $(this);
clickEvent(_this);
});
// 滚动页面,导航栏跟着变化事件
$(window).on("scroll.bz-header", function () {
// 获取滚动条当前位置
var scrollTop = $(window).scrollTop();
// // 显示、隐藏当前导航栏
if (scrollTop >= 20) {
navObj.addClass('fix');
} else {
navObj.removeClass('fix');
}
// 获取每个版块的到页面顶部的位置
var anchorpointArr = [];
boxObj.each(function () {
anchorpointArr.push(Math.ceil($(this).offset().top - 80));
})
// 获取当前可预览的板块在哪个位置
var curLightHighIndex = 0;
for (var i = 0; i < anchorpointArr.length; i++) {
if (scrollTop >= anchorpointArr[i]) {
curLightHighIndex = i;
liObj.eq(curLightHighIndex).addClass('active').siblings().removeClass('active');
} else {
curLightHighIndex = i;
liObj.eq(curLightHighIndex).removeClass('active')
}
}
// 当前导航栏跟着页面滚动高亮当前按钮
// liObj.eq(curLightHighIndex).addClass('active').siblings().removeClass('active');
})
function clickEvent(obj) {
if (winW < 992) {
closeMenu()
}
// 获取点击位置
var li_index = obj.index();
// 获取位置的top值
var willScrollTop = Math.ceil(boxObj.eq(li_index).offset().top - 80);
// console.log(willScrollTop)
// 执行动画
$("body,html").stop(true, true).animate({
"scrollTop": willScrollTop
}, 300);
// 高亮当前定位按钮
// obj.addClass('active').siblings().removeClass('active');
};
// 获取链接参数
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
}
// 锚点定位函数
function anchorFun() {
var queryStr = getQueryString("section");
if (queryStr == undefined) return
// 清除滚动条默认位置
if ('scrollRestoration' in history) {
history.scrollRestoration = 'manual';
}
liObj.each(function () {
var _this = $(this);
if (_this.data('key') == queryStr) {
setTimeout(function () {
_this.trigger('click');
}, 500)
}
})
}
}
function init() {
fixedNav(); // 定位导航
}
init();
var $backtop = $(".backtop");
$(window).on('scroll.backtop', function () {
var high = $(window).scrollTop();
// 三元表达式进行高度判断
// if (winW > 1200) {
high >= 700 ? $backtop.show() : $backtop.hide();
// }
})
$backtop.on('click', function () {
$("html, body").animate({
scrollTop: 0
});
})
// agenda
if ($('.e-module-202404181550').length > 0) {
function module202404181550Fun($target) {
var module202404181550Obj = {
init: function () {
// 获取属性
this.win = $(window);
this.moduleObj = $target;
this.tablist = $target.find(".tablist");
this.tab = $target.find(".tab");
this.agendaBot = $target.find('.agenda-bottom');
this.listItem = $target.find('.list-item');
this.closePop = $target.find('.close-btn');
this.popCon = $target.find('.pop-con');
this.keynote1 = this.agendaBot.find('.keynote .day1').length;
this.keynote2 = this.agendaBot.find('.keynote .day2').length;
this.sum1 = this.agendaBot.find('.summit .day1').length;
this.sum2 = this.agendaBot.find('.summit .day2').length;
this.ses1 = this.agendaBot.find('.session .day1').length;
this.ses2 = this.agendaBot.find('.session .day2').length;
this.forum1 = this.agendaBot.find('.forum .day1').length;
this.forum2 = this.agendaBot.find('.forum .day2').length;
this.filSel = $target.find('.fil-sel');
this.resizeInit(); // resize初始化
this.addHtml();
this.clickEvent();
this.scrollEvent(); // 设置滚动事件,文字动画效果
this.resizeEvent(); // 设置自适应
this.lazyPicLink(); // 是否加载图片
this.tablist.append("");
this.tab.eq(0).find('.p2').css("opacity", 1);
this.tab.eq(1).find('.p1').css("opacity", 1);
var liW = this.tab.eq(0).outerWidth();
var curLiL = this.tab.eq(0).position().left;
this.moduleObj.find(".sekuai").css({
"width": liW,
"left": curLiL
});
},
resizeInit: function () {
this.winw = this.win.width();
this.winh = this.win.height();
// 获取位置
this.scrollTop = this.win.scrollTop();
this.moduleTop = this.moduleObj.offset().top;
},
lazyPicLink: function () {
// 加载图片
if (this.scrollTop + this.winh * 1.5 > this.moduleTop) {
// 当滚动条滚动到当前位置时,加载视频
this.moduleSlideObj = this.moduleObj.find(".swiper-slide");
this.moduleSlideObj.each(function () {
var $this = $(this);
var imgObj = $this.find('img');
var src = imgObj.attr("data-original");
if (imgObj.attr("src") != src) {
imgObj.attr("src", src)
}
})
}
},
clickEvent: function () {
var _this = this;
_this.tab.click(function () {
var $this = $(this);
if (!$this.parent().hasClass("zanting")) {
$this.parent().addClass("zanting");
if ($this.parent(".tablist").hasClass("preventClick")) {
return;
}
var _index = $this.index();
$this.addClass('active').siblings().removeClass('active');
if (_index == 0) {
_this.agendaBot.find('.day1').show();
_this.agendaBot.find('.day2').hide();
if (_this.keynote1 == 0) {
_this.agendaBot.find('.keynote').hide();
} else {
_this.agendaBot.find('.keynote').show();
}
if (_this.sum1 == 0) {
_this.agendaBot.find('.summit').hide();
} else {
_this.agendaBot.find('.summit').show();
}
if (_this.ses1 == 0) {
_this.agendaBot.find('.session').hide();
} else {
_this.agendaBot.find('.session').show();
}
if (_this.forum1 == 0) {
_this.agendaBot.find('.forum').hide();
} else {
_this.agendaBot.find('.forum').show();
}
} else {
_this.agendaBot.find('.day2').show();
_this.agendaBot.find('.day1').hide();
if (_this.keynote2 == 0) {
_this.agendaBot.find('.keynote').hide();
} else {
_this.agendaBot.find('.keynote').show();
}
if (_this.sum2 == 0) {
_this.agendaBot.find('.summit').hide();
}
if (_this.ses2 == 0) {
_this.agendaBot.find('.session').hide();
}
if (_this.forum2 == 0) {
_this.agendaBot.find('.forum').hide();
}
}
// 设置色块的移动
var liW = $(this).outerWidth();
var curLiL = $(this).position().left;
$(this).nextAll(".sekuai").css({
"width": liW,
"left": curLiL
});
$(this).find('.p1').css("opacity", 0);
$(this).find('.p2').delay(200).animate({
"opacity": 1
}, 200);
$(this).siblings().find('.p2').css("opacity", 0);
$(this).siblings().find('.p1').animate({
"opacity": 1
}, 400);
setTimeout(function () {
$this.parent().removeClass("zanting");
}, 500)
}
})
_this.listItem.on('click', function () {
$('body').append($(this).find('.agenda-item-pop').clone()).find('>.agenda-item-pop').show();
if (_this.winw < 992) {
$(".agenda-item-pop .item-pop-cons .item-pop-con .pop-detail").css("max-height", _this.winh - $(".agenda-item-pop .item-pop-cons .item-pop-con .agenda-item-con").height() - 350);
}
})
$('body').on('click', ".item-pop-cons", function () {
$('body').find('>.agenda-item-pop').remove();
})
$('body').on('click', '.item-close-btn', function () {
$('body').find('>.agenda-item-pop').remove();
})
$('body').on('click', '.item-pop-con', function (e) {
e.stopPropagation();
})
},
addHtml: function () {
var _this = this;
var box = this.moduleObj.find(".yc-list .list-item");
box.each(function (index) {
var popBox = '
' + $(this).find('.agenda-item-con').html() + '
';
$(this).find('.item-pop-con .item-close-btn').after(popBox);
if ($(this).find('.icon-dates img').data('xl') != '') {
$(this).find('.icon-dates img').attr('src', $(this).find('.icon-dates img').data('xl'))
}
if ($(this).find('.icon1 img').data('xl') != '') {
$(this).find('.icon1 img').attr('src', $(this).find('.icon1 img').data('xl'))
}
if ($(this).find('.icon2 img').data('xl') != '') {
$(this).find('.icon2 img').attr('src', $(this).find('.icon2 img').data('xl'))
}
if ($(this).find('.icon3 img').data('xl') != '') {
$(this).find('.icon3 img').attr('src', $(this).find('.icon3 img').data('xl'))
}
})
},
scrollEvent: function () {
var _this = this;
_this.win.on('scroll.202404181550', function () {
// 获取位置
_this.scrollTop = _this.win.scrollTop();
_this.moduleTop = _this.moduleObj.offset().top;
_this.lazyPicLink(); // 视频是否图片
});
},
resizeEvent: function () {
// 页面resize事件
var _this = this;
var resizeWinw = 0;
var resizeTimer = '';
this.win.on('resize.202404181550', function () {
var winw = _this.win.width();
if (winw != resizeWinw) {
currentWinw = winw;
// 删除之前的定时器
if (resizeTimer) {
clearTimeout(resizeTimer);
}
// 添加新的定时器
resizeTimer = setTimeout(function () {
_this.resizeInit(); // resize初始化
_this.scrollEvent(); // 设置滚动事件,文字动画效果
}, 100)
}
})
}
};
module202404181550Obj.init();
}
// 初始化
$('.e-module-202404181550').each(function () {
// 防止js文件被执行2次。
var _this = $(this);
if (_this.data('init')) {
return;
}
_this.data('init', true);
module202404181550Fun($(this));
})
}
if ($(".backtop").length > 0) {
var $backtop = $(".backtop");
var $slide = $('.slidebars');
$(window).on('scroll.backtop', function () {
var high = $(window).scrollTop();
var bannerH = $('.e-module-202312151534').height();
var invitH = $('.e-module-202312191038').height();
var $high = ''
if ($('.e-module-202312151534').length > 0) {
$high = bannerH;
} else {
$high = invitH;
}
// console.log(invitH)
if (high > $high) {
$('.xiazai').addClass('active');
setTimeout(() => {
$('.xiazai').addClass('hide');
$('.slidebars').addClass('active');
}, 5000);
}
high >= 700 ? $slide.fadeIn() : $slide.fadeOut();
})
$backtop.on('click', function () {
$("html, body").animate({
scrollTop: 0
});
})
}
// 合作伙伴
if ($('.e-module-202305251344').length > 0) {
function module202305251344Fun($target) {
var module202305251344Obj = {
init: function () {
// 获取属性
this.win = $(window);
this.moduleObj = $target;
this.resizeInit();
this.judgmentPcWap();
this.resizeEvent();
this.lazyPicLink();
this.scrollEvent();
},
resizeInit: function () {
this.winw = this.win.width();
this.winh = this.win.height();
// 获取位置
this.scrollTop = this.win.scrollTop();
this.moduleTop = this.moduleObj.offset().top;
},
judgmentPcWap: function () {
this.clickEvent();
},
lazyPicLink: function () {
// 加载图片
if (this.scrollTop + this.winh * 1.5 > this.moduleTop) {
// 当滚动条滚动到当前位置时,加载视频
var moduleImgObj = this.moduleObj.find("img");
moduleImgObj.each(function () {
var $this = $(this);
var src = $this.attr("data-original");
if ($this.attr("src") != src) {
$this.attr("src", src);
$this.parent().addClass("over").css({
"height": "auto",
"background": "none"
})
}
})
}
},
scrollEvent: function () {
var _this = this;
_this.win.on('scroll.202305251344', function () {
// 获取位置
_this.scrollTop = _this.win.scrollTop();
_this.moduleTop = _this.moduleObj.offset().top;
_this.lazyPicLink(); // 视频是否图片
});
},
clickEvent: function () {
var _this = this;
// 获取对象
var closeBtn = this.moduleObj.find('.close-btn');
var point = this.moduleObj.find('.partner-item .imgs');
var popCons = this.moduleObj.find('.partner-item .pop-cons');
var popCon = this.moduleObj.find('.partner-item .pop-con');
point.on('click', function () {
$('body').append($(this).parent().find('.pop').clone()).find('>.pop').show();
})
$('body').on('click', ".pop-cons", function () {
$('body').find('>.pop').remove();
})
$('body').on('click', '.close-btn', function () {
$('body').find('>.pop').remove();
})
$('body').on('click', '.pop-con', function (e) {
e.stopPropagation();
})
// $('body').on('mouseup', function (e) {
// if (!popCon.is(e.target) && popCon.has(e.target).length == 0) {
// $('body').find('>.pop').remove();
// }
// })
},
resizeEvent: function () {
// 页面resize事件
var _this = this;
var resizeWinw = 0;
var resizeTimer = '';
this.win.on('resize.202209070955', function () {
var winw = _this.win.width();
if (winw != resizeWinw) {
currentWinw = winw;
// 删除之前的定时器
if (resizeTimer) {
clearTimeout(resizeTimer);
}
// 添加新的定时器
resizeTimer = setTimeout(function () {
_this.resizeInit(); // resize初始化
_this.judgmentPcWap(); // 判断移动还是pc端
}, 100)
}
})
}
};
module202305251344Obj.init();
}
// 初始化
$('.e-module-202305251344').each(function () {
// 防止js文件被执行2次。
var _this = $(this);
if (_this.data('init')) {
return;
}
_this.data('init', true);
module202305251344Fun($(this));
})
}
// speaker
if ($('.e-module-202409041335').length > 0) {
function module202409041335Fun($target) {
var module202409041335Obj = {
init: function () {
this.win = $(window);
this.moduleObj = $target;
this.moduleWrapperObj = this.moduleObj.find(".swiper-wrapper");
this.moduleSlideObj = this.moduleObj.find(".swiper-slide");
this.resizeInit();
this.judgmentSwiper();
this.scrollEvent();
this.resizeEvent();
this.lazyPicLink();
},
resizeInit: function () {
this.winw = this.win.width();
this.winh = this.win.height();
this.scrollTop = this.win.scrollTop();
this.moduleTop = this.moduleObj.offset().top;
},
judgmentSwiper: function () {
if (this.moduleSlideObj.length > 1) {
if (this.moduleObj.data("swiper-init")) {
return;
};
this.moduleObj.data("swiper-init", true);
this.initSwiper();
}
},
lazyPicLink: function () {
if (this.scrollTop + this.winh * 1.5 > this.moduleTop) {
this.moduleSlideObj = this.moduleObj.find(".swiper-slide");
this.moduleSlideObj.each(function () {
var $this = $(this);
var imgObj = $this.find('img');
var src = imgObj.attr("data-original");
if (imgObj.attr("src") != src) {
imgObj.attr("src", src);
};
});
};
},
initSwiper: function () {
var _this = this;
var slidesPerGroup = 2;
if (_this.winw > 992) {
slidesPerGroup = 4;
}
var slideLength = $target.find(".swiper-slide").length;
var mySwiper = new Swiper($target.find(".swiper"), {
watchOverflow: true,
spaceBetween: 20,
slidesPerView: 2,
resistanceRatiao: 1,
slidesPerGroup: slidesPerGroup,
autoplay: $target.data("auto-time") ? {
delay: $target.data("auto-time"),
stopOnLastSlide: false,
disableOnInteraction: true
} : false,
loop: slideLength > 2 ? true : false,
noSwiping: slideLength > 1 ? false : true,
pagination: {
el: $target.find('.swiper-pagination'),
clickable: true,
},
breakpoints: {
1200: {
slidesPerView: 4,
spaceBetween: 40,
loop: slideLength > 4 ? true : false,
},
992: {
slidesPerView: 4,
spaceBetween: 20,
loop: slideLength > 4 ? true : false,
},
},
on: {
init: function () {
if (_this.winw > 992) {
if (_this.moduleSlideObj.length < 5) {
$target.find('.swiper-button').hide();
$target.find('.swiper-wrapper').css('justify-content', 'space-around');
if (_this.winw > 992 && _this.winw < 1200) {
$target.find('.swiper-pagination').hide();
};
};
} else {
if (_this.moduleSlideObj.length < 3) {
$target.find('.swiper-pagination').hide();
};
};
},
resize: function () {
var This = this;
setTimeout(function () {
if (_this.winw > 992) {
slidesPerGroup = 4;
} else {
slidesPerGroup = 2;
}
This.emit('init');
This.update();
}, 150);
},
},
});
mySwiper.el.onmouseover = function () {
mySwiper.autoplay.stop();
};
mySwiper.el.onmouseout = function () {
mySwiper.autoplay.start();
};
},
scrollEvent: function () {
var _this = this;
_this.win.on('scroll.202409041335', function () {
_this.scrollTop = _this.win.scrollTop();
_this.moduleTop = _this.moduleObj.offset().top;
_this.lazyPicLink();
});
},
resizeEvent: function () {
var _this = this;
var resizeWinw = 0;
var resizeTimer = '';
this.win.on('resize.202409041335', function () {
var winw = _this.win.width();
if (winw != resizeWinw) {
currentWinw = winw;
if (resizeTimer) {
clearTimeout(resizeTimer);
};
resizeTimer = setTimeout(function () {
_this.resizeInit();
_this.judgmentSwiper();
_this.scrollEvent();
}, 100);
};
});
},
};
module202409041335Obj.init();
};
$('.e-module-202409041335').each(function () {
var _this = $(this);
if (_this.data('init')) {
return;
};
_this.data('init', true);
module202409041335Fun($(this));
});
};
if ($(".e-module-202408080914").length > 0 && winW > 992) {
$(".e-module-202408080914 .box .right ul li").height(($(".e-module-202408080914 .box .left").height() - 20) / 2);
$(window).on('resize.202408080914', function () {
$(".e-module-202408080914 .box .right ul li").height("auto");
setTimeout(function () {
$(".e-module-202408080914 .box .right ul li").height(($(".e-module-202408080914 .box .left").height() - 20) / 2);
}, 1000)
})
}
if ($('.e-module-202502281611').length > 0) {
function module202502281611Fun($target) {
var module202502281611Obj = {
init: function () {
this.win = $(window);
this.moduleObj = $target;
this.moduleWrapperObj = this.moduleObj.find(".swiper-wrapper");
this.moduleSlideObj = this.moduleObj.find(".swiper-slide");
this.resizeInit();
this.lazyPicLink();
this.judgmentSwiper();
this.scrollEvent();
this.resizeEvent();
},
resizeInit: function () {
this.winw = this.win.width();
this.winh = this.win.height();
this.scrollTop = this.win.scrollTop();
this.moduleTop = this.moduleObj.offset().top;
},
judgmentSwiper: function () {
if (this.moduleSlideObj.length > 1) {
if (this.moduleObj.data("swiper-init")) {
return;
};
this.moduleObj.data("swiper-init", true);
this.initSwiper();
} else if (this.moduleSlideObj.length == 1) {
$target.find(".swiper-button").css({
"display": "none"
});
$target.find('.img').addClass('img-len1');
};
},
lazyPicLink: function () {
if (this.scrollTop + this.winh * 1.5 > this.moduleTop) {
this.moduleSlideObj = this.moduleObj.find('img');
this.moduleSlideObj.each(function () {
var $this = $(this);
var src = $this.attr("data-original");
if ($this.attr("src") != src) {
$this.attr("src", src);
$this.parent(".e-lazy").addClass("over").css({
"height": "auto",
"background": "none"
});
};
});
};
},
initSwiper: function () {
var _this = this;
var slidesPerGroup = 1;
var slideLength = _this.moduleObj.find(".swiper-slide").length;
var mySwiper = new Swiper($target.find(".swiper"), {
watchOverflow: true,
spaceBetween: 40,
slidesPerView: 1,
slidesPerGroup: 1,
autoplay: $target.data("auto-time") ? {
delay: $target.data("auto-time"),
stopOnLastSlide: false,
disableOnInteraction: true
} : false,
loop: slideLength > 1 ? true : false,
navigation: {
nextEl: $target.find('.swiper-button-next'),
prevEl: $target.find('.swiper-button-prev'),
},
pagination: {
el: $target.find('.swiper-pagination'),
type: 'fraction',
},
breakpoints: {
1200: {
slidesPerView: 1,
spaceBetween: 40,
},
},
on: {
init: function () {
},
resize: function () {
var This = this;
setTimeout(function () {
This.params.slidesPerGroup = 1;
This.update();
}, 150)
},
},
});
},
scrollEvent: function () {
var _this = this;
_this.win.on('scroll.202502281611', function () {
_this.scrollTop = _this.win.scrollTop();
_this.moduleTop = _this.moduleObj.offset().top;
_this.lazyPicLink();
});
},
resizeEvent: function () {
var _this = this;
var resizeWinw = 0;
var resizeTimer = '';
this.win.on('resize.202502281611', function () {
var winw = _this.win.width();
if (winw != resizeWinw) {
currentWinw = winw;
if (resizeTimer) {
clearTimeout(resizeTimer);
};
resizeTimer = setTimeout(function () {
_this.resizeInit();
_this.judgmentSwiper();
_this.scrollEvent();
}, 100);
};
});
},
};
module202502281611Obj.init();
};
$('.e-module-202502281611').each(function () {
var _this = $(this);
if (_this.data('init')) {
return;
};
_this.data('init', true);
module202502281611Fun($(this));
});
};
if ($('.e-module-202208150943').length > 0) {
function module202208150943Fun($target) {
var module202208150943Obj = {
init: function () {
// 获取属性
this.win = $(window);
this.animateOff = false;
this.moduleObj = $target;
this.moduleSlideObj = $target.find(".swiper-slide");
this.activeIndex = 0;
this.resizeInit(); // resize初始化
this.saveAClass(); // 保存按钮颜色
this.setWapBtnColor(); // 设置按钮颜色
this.judgmentHomeOther(); // 判断是否是首页,还是内页。如果是首页pc就执行动画,其他的不用执行
this.judgmentSwiper(); // 判断需不需要执行swiper,如果只有一个就不需要执行。多个就需要执行
this.scrollEvent(); // 设置滚动事件,文字动画效果
this.resizeEvent(); // 设置自适应
},
resizeInit: function () {
this.winw = this.win.width();
this.winh = this.win.height();
},
judgmentHomeOther: function () {
if ($target.hasClass('h600')) {
this.judgmentPcWap();
}
},
judgmentPcWap: function () {
// 判断首页是pc还是移动
if (this.winw > 1200) {
// pc端执行动画
this.judgmentAnimate();
} else {
// 移动端直接显示文字,不用执行动画
$target.find(".swiper-slide").addClass('animate');
}
},
judgmentAnimate: function () {
var _this = this;
// 获取滚动条位置
_this.scrollTop = _this.win.scrollTop();
_this.moduleTop = $target.offset().top;
var $targetH = $target.height();
// 判断是否在屏幕中,如果是显示动画,不是就不执行
if (_this.scrollTop + _this.winh - $targetH > _this.moduleTop) {
if (!_this.animateOff) {
// 如果只有第一屏,就显示第一屏
if ($target.find(".swiper-slide").length == 1) {
$target.find(".swiper-slide").eq(0).addClass('animate');
} else {
// 显示当前轮播屏
_this.moduleSlideObj.eq(_this.activeIndex).addClass('animate').siblings().removeClass('animate');
}
_this.animateOff = true;
}
}
},
judgmentSwiper: function () {
if (this.moduleSlideObj.length > 1) {
if (this.moduleObj.data("swiper-init")) {
return;
}
this.moduleObj.data("swiper-init", true);
this.initSwiper();
}
},
saveAClass: function () {
var _this = this;
_this.aClassArr = [];
$target.find('a').each(function () {
_this.aClassArr.push($(this).attr('class'));
})
},
setWapBtnColor: function () {
var _this = this;
// 不管pc端按钮是什么颜色,到了移动端都是黑色按钮
if (this.winw < 992) {
$target.find('.e-btn-bd-white-xl').addClass('e-btn-bd-black-xl').removeClass('e-btn-bd-white-xl');
$target.find('.e-btn-bd-white-lg').addClass('e-btn-bd-black-lg').removeClass('e-btn-bd-white-lg');
$target.find('.e-btn-bd-white-video-xl').addClass('e-btn-bd-black-video-xl').removeClass('e-btn-bd-white-video-xl');
$target.find('.e-btn-bd-white-video-lg').addClass('e-btn-bd-black-video-lg').removeClass('e-btn-bd-white-video-lg');
$target.find('.e-btn-bd-red-xl').addClass('e-btn-bd-black-xl').removeClass('e-btn-bd-red-xl');
$target.find('.e-btn-bd-red-lg').addClass('e-btn-bd-black-lg').removeClass('e-btn-bd-red-lg');
$target.find('.e-btn-bd-red-video-xl').addClass('e-btn-bd-black-video-xl').removeClass('e-btn-bd-red-video-xl');
$target.find('.e-btn-bd-red-video-lg').addClass('e-btn-bd-black-video-lg').removeClass('e-btn-bd-red-video-lg');
} else {
$target.find('a').each(function (index, elm) {
$(this).attr('class', _this.aClassArr[index]);
})
}
},
lazyPicLink: function () {
// 加载图片
if (this.scrollTop + this.winh * 1.5 > this.moduleTop) {
// 当滚动条滚动到当前位置时,加载视频
this.addPicLink();
}
},
lazyVideoLink: function () {
// 加载视频
if (this.scrollTop + this.winh * 1.5 > this.moduleTop) {
// 当滚动条滚动到当前位置时,加载视频
this.addVideoLink();
}
},
addPicLink: function () {
this.moduleSlideObj = $target.find(".swiper-slide");
this.moduleSlideObj.each(function () {
var $this = $(this);
var src = $this.find('img').attr("data-original");
if ($this.find(".e-bg").css("backgroundImage") != "url(" + src + ")") {
$this.find(".e-bg").css("backgroundImage", "url('" + src + "')");
$this.find(".e-lazy").css("display", "none");
}
})
},
addVideoLink: function () {
if (this.winw > 1200) {
this.moduleSlideObj = $target.find(".swiper-slide");
this.moduleSlideObj.each(function () {
var $this = $(this);
if ($this.find(".e-bg").data('src') != '' && $this.find('.video').length == 0) {
// 添加video的dom结构
$this.find(".e-bg").append("");
// 判断视频是否已经赋值,如果赋值了,就不需要再次赋值了。
$this.find('.video').attr("src", $this.find(".e-bg").data('src'));
}
})
} else {
$target.find('.video').remove();
}
},
initSwiper: function () {
var _this = this;
var slideLength = $target.find(".swiper-slide").length;
var mySwiper = new Swiper($target.find(".swiper-container"), {
effect: 'fade',
fadeEffect: {
crossFade: true,
},
pagination: { // 设置点点点
el: $target.find('.swiper-pagination'),
clickable: true
},
grabCursor: slideLength > 1 ? true : false,
autoplay: $target.data("auto-time") ? {
delay: $target.data("auto-time"),
stopOnLastSlide: false,
disableOnInteraction: true
} : false,
loop: slideLength > 1 ? true : false, // 设置自动轮播
noSwiping: slideLength > 1 ? false : true,
runCallbacksOnInit: true,
on: {
init: function () {
$target.find(".swiper-pagination").show();
},
slideChangeTransitionEnd: function () {
_this.activeIndex = this.activeIndex;
setTimeout(function () {
// 执行文字动画
if (_this.animateOff) {
if (_this.winw > 1200) {
$target.find(".swiper-slide").eq(mySwiper.activeIndex).addClass('animate').siblings().removeClass('animate');
} else {
$target.find(".swiper-slide").addClass('animate');
}
}
// 根据文字颜色变化底部点点点的颜色
var $currentSilde = $target.find(".swiper-slide-active");
var $pr = $currentSilde.parent();
if ($currentSilde.hasClass('isBlackFont')) {
$pr.next('.swiper-pagination').addClass('gray');
} else {
$pr.next('.swiper-pagination').removeClass('gray');
}
}, 0)
},
resize: function () {
var _this = this;
setTimeout(function () {
_this.update(); //窗口变化时,更新Swiper的一些属性,如宽高等
_this.emit('slideChangeTransitionEnd');
}, 250)
},
}
});
//鼠标覆盖停止自动切换
mySwiper.el.onmouseover = function () {
mySwiper.autoplay.stop();
}
//鼠标离开开始自动切换
mySwiper.el.onmouseout = function () {
mySwiper.autoplay.start();
}
},
scrollEvent: function () {
var _this = this;
_this.win.on('scroll.202208150943', function () {
// 获取位置
_this.scrollTop = _this.win.scrollTop();
_this.moduleTop = $target.offset().top;
_this.judgmentHomeOther(); // 判断是否是首页,还是内页。如果是首页pc就执行动画,其他的不用执行
_this.lazyVideoLink(); // 视频是否加载
_this.lazyPicLink(); // 视频是否图片
});
},
resizeEvent: function () {
// 页面resize事件
var _this = this;
var resizeWinw = 0;
var resizeTimer = '';
this.win.on('resize.202208150943', function () {
var winw = _this.win.width();
if (winw != resizeWinw) {
currentWinw = winw;
// 删除之前的定时器
if (resizeTimer) {
clearTimeout(resizeTimer);
}
// 添加新的定时器
resizeTimer = setTimeout(function () {
_this.resizeInit(); // resize初始化
_this.setWapBtnColor(); // 设置按钮颜色
_this.judgmentHomeOther(); // 判断是否是首页,还是内页。如果是首页pc就执行动画,其他的不用执行
_this.scrollEvent(); // 设置滚动事件,文字动画效果
}, 200)
}
})
}
};
module202208150943Obj.init();
}
// 初始化
$('.e-module-202208150943').each(function () {
// 防止js文件被执行2次。
var _this = $(this);
if (_this.data('init')) {
return;
}
_this.data('init', true);
module202208150943Fun($(this));
})
};
})
;
(function ($) {
$.fn.showHideContent = function (options) {
var settings = $.extend({
buttonSelector: '.showhide-btn',
activeClass: 'active'
}, options);
return $(settings.buttonSelector).each(function () {
$(this).on('click', function () {
var $this = $(this);
if (!$this.hasClass('active')) {
$this.addClass(settings.activeClass);
} else {
$this.removeClass(settings.activeClass);
}
var contentId = $this.data('target');
$("." + contentId).each(function () {
if ($(this).css('display') === "none") {
$(this).addClass(settings.activeClass);
} else {
$(this).removeClass(settings.activeClass);
}
});
});
});
};
})(jQuery);
;
(function ($) {
$.fn.expandContent = function (options) {
var settings = $.extend({
buttonSelector: '.expand-btn',
activeClass: 'active'
}, options);
return $(settings.buttonSelector).on('click', function () {
var $this = $(this);
var contentId = $this.data('target');
$this.addClass(settings.activeClass).siblings().removeClass(settings.activeClass);
$(settings.buttonSelector).each(function () {
var $this = $(this);
var contentId = $this.data('target');
$("." + contentId).removeClass(settings.activeClass);
})
$("." + contentId).each(function () {
if ($(this).css('display') === "none") {
$(this).addClass(settings.activeClass);
} else {
$(this).removeClass(settings.activeClass);
}
});
});
};
})(jQuery);
$(function () {
$('body').showHideContent();
$('body').expandContent();
})
// 新闻
if ($(".e-module-202406041415").length > 0 && $(window).width() > 750) {
$(".e-module-202406041415 .right .e-scroll-vrt-d1-2").height($(".e-module-202406041415 .left a")
.height() +
0)
}