define("/Assets/enp/v2/js/ebg-module/ebg-module-showcase.js", ["/Assets/enp/v2/js/vendor/swiper-5.3.6.min.js"], function (s, pub) { // 判断有没有模块 if ($('.ebg-module-showcase').length > 0) { // 遍历每个模块 $('.ebg-module-showcase').each(function () { // 获取对象 var This = $(this); var swiper1, swiper2; // 获取非遮罩层上的轮播 var objConList = This.find('.ebg-tab .con .list'); // 遮罩层 var fade = This.find('.ebg-tab .black_overlay'); // 获取遮罩层的内容区域 var contentList = This.find('.ebg-tab .swiperList'); // 获取遮罩层的轮播 var objBlockList = This.find('.ebg-tab .black_overlay .list'); // 放大镜按钮 var dialog = This.find('.ebg-tab .con .list .dialog'); // 获取图片 var picImgBig = This.find('.ebg-tab .con .list .pic .pic-img'); // 获取视口分辨率 var clientWidth = $(window).width(); // 视口宽小于等于 992 双击放大图片轮播 if (clientWidth <= 992) { var i; picImgBig.on('click', function () { i++; var timer = setTimeout(function () { i = 0; }, 500); if (i > 1) { // fade.fadeIn(); fade.css('top', 0); i = 0; clearInterval(timer) } }) } // 非遮罩层上的轮播函数 function conListNewSwiper(objConList) { // 判断当前下面con是否是否有轮播,数量是否超过1个 if (objConList.find('.swiper-slide').length > 1) { // 防止swiper重复调用。判断objConList.data('init')是否已经存在 if (objConList.data('init') == undefined) { // 第一次调用swiper后,禁止再次调用 objConList.data('init', 'true'); // 初始化非遮罩层的swiper swiper1 = new Swiper(objConList.find('.swiper-container'), { slidesPerView: 1.14, spaceBetween: 15, autoplay: false, resistanceRatiao: 1, //触底不反弹 watchOverflow: true, //一屏显示左右按钮和pag centeredSlides: true, observer: true, observeParents: true, pagination: { el: objConList.find('.pagination'), type: 'fraction', }, navigation: { nextEl: objConList.find('.icon-right'), prevEl: objConList.find('.icon-left') }, breakpoints: { 750: { slidesPerView: 1, autoplay: false, spaceBetween: 15, resistanceRatiao: 1, //触底不反弹 watchOverflow: true, //一屏显示左右按钮和pag centeredSlides: false, observer: true, observeParents: true, } }, controller: { control: swiper2, //控制Swiper1 }, }); } } else if (clientWidth <= 750) { objConList.css('width', '86%') dialog.css('bottom', '14px') } else { objConList.find('.navigation-con').css('display', 'none'); } } // 遮罩层上的轮播函数 function blockConListNewSwiper(objBlockList) { // 判断当前遮罩层下面con是否是否有轮播,数量是否超过1个 if (objBlockList.find('.swiper-slide').length > 1) { // 判断objBlockList.data('init')是否已经存在 if (objBlockList.data('init') == undefined) { // 第一次调用swiper后,禁止再次调用 objBlockList.data('init', 'true'); // 初始化遮罩层的swiper swiper2 = new Swiper(objBlockList.find('.swiper-container'), { slidesPerView: 1, spaceBetween: 15, // loop: true, autoplay: false, resistanceRatiao: 1, //触底不反弹 watchOverflow: true, //一屏显示左右按钮和pag centeredSlides: false, observer: true, observeParents: true, autoplayDisableOnInteraction: false, pagination: { el: objBlockList.find('.pagination'), type: 'fraction', }, navigation: { nextEl: objBlockList.find('.icon-right'), prevEl: objBlockList.find('.icon-left') }, breakpoints: { 750: { slidesPerView: 1, autoplay: false, spaceBetween: 15, resistanceRatiao: 1, //触底不反弹 watchOverflow: true, //一屏显示左右按钮和pag observer: true, observeParents: true, autoplayDisableOnInteraction: false, } }, controller: { control: swiper1, //控制Swiper1 }, }); } } else { objBlockList.find('.navigation-con').css('display', 'none'); } } // debugger // 点击放大镜图标 dialog.on('click', function () { fade.css('top', 0); }) fade.on('click', function () { fade.css('top', '200%') }) contentList.on('click', function (e) { e.stopPropagation(); }) // debugger // 初始化con 轮播器功能 if (objBlockList.find('.swiper-slide').length > 1) { // 显示左右箭头 objConList.find('.navigation-con .iconfont').css('display', 'block'); conListNewSwiper(objConList); blockConListNewSwiper(objBlockList); swiper1.controller.control = swiper2; //Swiper1控制Swiper2,需要在Swiper2初始化后 swiper2.controller.control = swiper1; //Swiper2控制Swiper1,需要在Swiper1初始化后 } }) } });