if ($('.e-module-202409291521').length > 0) { function module202409291521Fun($target) { var module202409291521Obj = { 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.addHtml(); 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(this.moduleObj.find('.news-pc')); this.initSwiper(this.moduleObj.find('.news-wap')); }; }, lazyPicLink: function () { if (this.scrollTop + this.winh * 1.5 > this.moduleTop) { this.moduleSlideObj = this.moduleObj.find(".e-lazy"); 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); }; }); }; }, addHtml: function () { var _this = this; var cardItem = _this.moduleObj.find( '.news-pc .news-container .swiper-slide .card-item'); for (var i = 0; i < cardItem.length; i++) { _this.moduleObj.find('.news-wap .news-container .swiper-wrapper').push(cardItem); }; function countLi(global) { var num = 0; var viewLen = Math.ceil(cardItem.length / global); for (var i = 0; i < viewLen; i++) { _this.moduleObj.find('.news-wap .news-container .swiper-wrapper').prepend( '
'); }; cardItem.each(function (i, e) { if (i % global === 0 && i !== 0) { num++; }; $(e).appendTo(_this.moduleObj.find( ".news-wap .news-container .swiper-wrapper .swiper-slide")[ num]); }); }; if (_this.winw < 992) { countLi(2); }; }, initSwiper: function ($this) { var _this = this; var slidesPerGroup = 1; if (_this.winw > 1200) { slidesPerGroup = 3; } else if (_this.winw > 750) { slidesPerGroup = 2; }; var mySwiper = new Swiper($this.find(".swiper"), { watchOverflow: true, spaceBetween: 20, slidesPerView: 1, resistanceRatiao: 1, slidesPerGroup: slidesPerGroup, pagination: { el: $this.find('.swiper-pagination'), clickable: true, }, breakpoints: { 1600: { slidesPerView: 3, spaceBetween: 40, }, 1200: { slidesPerView: 3, spaceBetween: 30, }, 750: { slidesPerView: 2, spaceBetween: 20, }, }, on: { init: function () {}, resize: function () { var This = this; setTimeout(function () { if (_this.winw > 1200) { slidesPerGroup = 3; } else if (_this.winw > 750) { slidesPerGroup = 2; } else { slidesPerGroup = 1; }; This.emit('init'); This.update(); }, 150); }, }, }); }, scrollEvent: function () { var _this = this; _this.win.on('scroll.202409291521', 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.202409291521', 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); }; }); }, }; module202409291521Obj.init(); }; $('.e-module-202409291521').each(function () { var _this = $(this); if (_this.data('init')) { return; }; _this.data('init', true); module202409291521Fun($(this)); }); }; 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)); }); };