$(function () { // 定位导航 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(); (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); if ($(".e-module-202511041519").length > 0) { function module202511041519Fun($target) { var module202511041519Obj = { init: function () { // 获取属性 this.win = $(window); this.moduleObj = $target; this.resizeInit(); // resize初始化 this.judgmentPcWap(); // 判断移动还是pc端 this.lazyPicLink(); // 视频是否图片 this.resizeEvent(); // 设置自适应 }, resizeInit: function () { this.winw = this.win.width(); this.winh = this.win.height(); // 清除pc端设置的参数 this.clearPcArgument(); // 获取位置 this.scrollTop = this.win.scrollTop(); this.moduleTop = this.moduleObj.offset().top; }, clearPcArgument: function () { if (this.winw < 1200) { this.moduleObj.find(".arch-img img").css({ "max-width": "none", width: "100%", }); this.moduleObj.find(".arch-r-con").css({ "max-height": "none", }); } else { this.moduleObj.find(".arch-img img").css({ "max-width": "none", width: "auto", }); this.moduleObj.find(".arch-r-con").css({ "max-height": "none", }); } }, judgmentPcWap: function () { // 判断首页是pc还是移动,如果是移动端就显示放大图片的按钮 if (this.winw < 992) { this.clickEvent(); } // 判断首页是pc还是移动,如果是pc端就需要计算左右的高度,把图片的高度赋值给右边文字的高度 if (this.winw > 1200) { this.setRightBoxHeight(); } }, setRightBoxHeight: function () { var conHeight = this.moduleObj.find(".pic").height() - parseInt(this.moduleObj.find(".arch-right").css("padding-top")) - parseInt(this.moduleObj.find(".arch-right").css("padding-bottom")); // 设置右边内容区域的高度 this.moduleObj.find(".arch-r-con").css({ "max-height": conHeight, }); }, lazyPicLink: function () { // 加载图片 if (this.scrollTop + this.winh * 1.5 > this.moduleTop) { // 当滚动条滚动到当前位置时,加载视频 this.moduleImgObj = this.moduleObj.find(".arch-img img"); var originalImg = this.moduleImgObj.attr("data-original"); if (this.moduleImgObj.attr("src") != originalImg) { this.moduleImgObj.attr("src", originalImg); } } }, clickEvent: function () { // 获取对象 var lookFullBtn = this.moduleObj.find(".full-img"); var viewBox = this.moduleObj.find(".view-box"); var closeFull = this.moduleObj.find(".view-box .close-full"); // 点击放大按钮,弹框 lookFullBtn.on("click", function () { var oImg = $(this).parent(".arch-img").find("img").attr("data-original"); viewBox.find("img").attr("src", oImg); viewBox.fadeIn(400); $("body").css("overflow", "hidden"); eZoom(viewBox.find("img")); }); // 点击关闭按钮关闭弹框 closeFull.on("click", function () { viewBox.fadeOut(400); $("body").css("overflow", "auto"); }); // 点击弹框的黑色遮罩,关闭弹框 viewBox.on("click", function () { viewBox.fadeOut(400); $("body").css("overflow", "auto"); }); }, scrollEvent: function () { var _this = this; _this.win.on("scroll.202511041519", 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.202511041519", 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); } }); }, }; module202511041519Obj.init(); } // 初始化 $(".e-module-202511041519").each(function () { // 防止js文件被执行2次。 var _this = $(this); if (_this.data("init")) { return; } _this.data("init", true); module202511041519Fun($(this)); }); } if ($(".e-module-202511041606").length > 0) { $(".e-module-202511041606 .swiper img").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", }); } }); if ($(window).width() < 750) { var str = ""; $(".e-module-202511041606 .lists").each(function () { str += '
' + $(this).html() + "
"; }); $(".e-module-202511041606 .swiper-wrapper").empty().append(str); } var mySwiper = new Swiper($(".e-module-202511041606").find(".swiper"), { watchOverflow: true, spaceBetween: 40, slidesPerView: 1, slidesPerGroup: 1, navigation: { nextEl: $(".e-module-202511041606").find(".swiper-button-next"), prevEl: $(".e-module-202511041606").find(".swiper-button-prev"), }, pagination: { el: $(".e-module-202511041606").find(".swiper-pagination"), }, }); if ($(window).width() > 1200) { $(".e-module-202511041606 .lists").each(function () { $(this).data("height", $(this).find(".ptxt2").height()); $(this).find(".ptxt2").css({ height: 0, opacity: 0, transform: "translateY(100px)" }); }); $(".e-module-202511041606 .lists").hover( function () { $(this) .find(".ptxt2") .css({ height: $(this).data("height"), opacity: 1, transform: "translateY(0)" }); }, function () { $(this).find(".ptxt2").css({ height: 0, opacity: 0, transform: "translateY(100px)" }); } ); } } if ($(window).width() > 1200) { function formatNumberWithCommas(number) { var parts = number.toString().split("."); parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); return parts.join("."); } var off202505261426 = true; $(window).on("scroll.e-module-202505261426", function () { if ($(window).scrollTop() + $(window).height() * 0.5 > $(".e-module-202505261426").offset().top) { if (off202505261426) { off202505261426 = false; $(".e-module-202505261426 .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(formatNumberWithCommas(num)); } else { _this.text(formatNumberWithCommas((curNum += cishu))); } }, 30); }); } } }); } else { $(".e-module-202505261426 .num").each(function () { var _this = $(this); var num = parseInt(_this.attr("data-num")); _this.text(formatNumberWithCommas(num)); }); } }); $(function () { $("body").expandContent(); });