require(['jquery', 'lightBox', 'swiper', 'layer'], function ($, lightBox, Swiper, layer) { // 钱璟移动端图片加链接 $(function () { var w = $(window).width(); if (($webid == '1309' || $webid == '1164') && w < 1200) { $('.pro_detail img').each(function () { var imgs = $(this).attr('src'); $(this).wrapAll(''); }); } }); $('#gallery img:not(".bofangimg")').click(function (i) { $("#model_wind").css({ "opacity": "1", "zIndex": "10000", "visibility": "visible" }); }); $('#gallery .swiper-slide').click(function () { $('#model_wind').show(); var index = $(this).index(); var model_swiper = new Swiper('.model_wind_swiper', { navigation: { nextEl: '.swiper-button-next-model', prevEl: '.swiper-button-prev-model', }, pagination: { el: '.swiper-pagination_model', type: 'fraction' }, autoHeight: true, on: { init: function () { this.slideTo(index, 10, false); } } }); }); /*产品详情页360展示窗口,产品展示窗口*/ $("#model_wind").click(function (event) { $(this).css({ "opacity": "0", "zIndex": "-1", "visibility": "hidden" }); event.stopPropagation(); }); $(".model_wind_box").click(function (event) { event.stopPropagation(); }); $(".vr_show").click(function () { $(".vr_window").css({ "opacity": "1", "zIndex": "999", "visibility": "visible" }); }); $(".vidoe_close").click(function () { $(".vr_window").css({ "opacity": "0", "zIndex": "-1", "visibility": "hidden" }); }); // 有缩略图加缩略图效果,没有显示单图切换效果 var thumbsLen = $('.detail-gallery-thumbs').length; if (thumbsLen > 0) { var galleryThumbs = new Swiper('.detail-gallery-thumbs', { spaceBetween: 10, slidesPerView: 4, navigation: { nextEl: '.swiper-button-next-detail', prevEl: '.swiper-button-prev-detail', }, loopedSlides: 5, //looped slides should be the same freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, }); var galleryTop = new Swiper('.detail-gallery-top', { spaceBetween: 10, loopedSlides: 5, //looped slides should be the same watchSlidesVisibility: true, thumbs: { swiper: galleryThumbs }, on: { slideChange: function () { if($(".lib-video").length>0){ $(".lib-video").trigger('pause'); } }, }, navigation: { nextEl: '.detail-gallery-top .swiper-button-next', prevEl: '.detail-gallery-top .swiper-button-prev', }, }); var galleryThumbsa = new Swiper('.detail-gallery-thumbsa', { spaceBetween: 10, slidesPerView: 4, navigation: { nextEl: '.swiper-button-next-detail', prevEl: '.swiper-button-prev-detail', }, loopedSlides: 5, //looped slides should be the same freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, }); var galleryTopa = new Swiper('.detail-gallery-topa', { spaceBetween: 10, loopedSlides: 5, //looped slides should be the same thumbs: { swiper: galleryThumbsa }, navigation: { nextEl: '.detail-gallery-topa .swiper-button-next', prevEl: '.detail-gallery-topa .swiper-button-prev', }, }); } else { if($webid==2021 || $webid==2091 ){ var galleryTop_config={ slidesPerView: 1, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', },pagination: { el: '.swiper-pagination', } } }else{ var galleryTop_config={ slidesPerView: 1 } } var galleryTop = new Swiper('.detail-gallery-top', galleryTop_config); } // 有缩略图加缩略图效果,没有显示单图切换效果 $('.detail-gallery-thumbs__wrap .swiper-slide').click(function () { var slef = $(this); slef.addClass('swiper-slide-active'); slef.siblings('div').removeClass('swiper-slide-active'); }); var evt = "onorientationchange" in window ? "orientationchange" : "resize"; window.addEventListener(evt, resize, false); function resize(fals) { if ($(".detail-gallery-top").length > 0) { galleryTop.update(); } }; resize(true); /*第二套内页详情大小图切换*/ var galleryThumbs2_length = 3; if ($webid == 1799 || $webid == 2147 || $webid == 2148 || $webid == 123) { if ($(window).width() > 1439){ galleryThumbs2_length = 5; }else{ galleryThumbs2_length = 3; } }; var galleryThumbs2 = new Swiper('.detail-gallery-thumbs2', { direction: 'vertical', spaceBetween: 10, slidesPerView: galleryThumbs2_length, navigation: { nextEl: '.swiper-button-next-detail', prevEl: '.swiper-button-prev-detail', }, freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, }); if ($(window).width() < 576 && $(".detail-gallery-thumbs2").length > 0) { galleryThumbs2.changeDirection(); } var galleryTop2 = new Swiper('.detail-gallery-top2', { spaceBetween: 10, thumbs: { swiper: galleryThumbs2 } }); /*第三套内页详情大小图切换*/ var galleryThumbs3 = new Swiper('.detail-gallery-thumbs3', { spaceBetween: 16, slidesPerView: 5, navigation: { nextEl: '.swiper-button-next-detail', prevEl: '.swiper-button-prev-detail', }, freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, }); var hj01Prodetail231030 = {} if($(".detail-gallery-thumbs3").length > 0){ hj01Prodetail231030 = {swiper: galleryThumbs3} } var galleryTop3 = new Swiper('.detail-gallery-top3', { thumbs: hj01Prodetail231030, }); /*第三套详情页其他产品滚动展示*/ var otherswiper = new Swiper('.inner_3__prodetail__otherswiper', { slidesPerView: 4, spaceBetween: 30, navigation: { nextEl: '.inner_3__prodetail__next', prevEl: '.inner_3__prodetail__prev', }, breakpoints: { 640: { slidesPerView: 1, spaceBetween: 20, }, 768: { slidesPerView: 2, spaceBetween: 20, }, 1024: { slidesPerView: 3, spaceBetween: 30, }, }, }); /* 吟飞内页文字动效 */ if($webid == 1795 || $webid == 1759 || $webid == 1101 || $webid == 621) { $(function () { var t = $('.text_jc').attr('data-text'); if (t != undefined) { var arr = t.split(''); setTimeout(function (){ arr.forEach(function (ele, i) { setTimeout( function () { $('.text_jc').append(ele); }, 250 * i); }); }, 500); }; }); } /* 吟飞内页文字动效 */ if($webid=="1953"){ $(document).ready(function(e) { var height=$("#product_detail .left").height(); console.log("height",height); height=height-$(".pro_info_box h3").height()-$(".pro_info_box_contact").height()-43; console.log("height",height); $(".pro_info_box .pro_info_desc").css("max-height",height+"px"); }); } }); require(['jquery', 'datetimepicker'], function ($, datetimepicker) { if ($('#quinnoid_datetimepicker').length > 0) { $('#quinnoid_datetimepicker').datetimepicker({ lang: 'ch' }); } }); function jumpto() { $('html,body').animate({ scrollTop: $('#inquiry').offset().top }, 1000); return false; }; function jumpto_inquiry() { if ($webid == '2147' || $webid == '2148') { $('html,body').animate({ scrollTop: $('#feautre_tab5').offset().top - 350 }, 1000); } else{ $('html,body').animate({ scrollTop: $('#feautre_tab5').offset().top - 200 }, 1000); } return false; }; function show(i) { switch (i) { case 1: document.getElementById("gx1").style.display = "block"; document.getElementById("gx2").style.display = "none"; document.getElementById("pro1").className = "d_1"; document.getElementById("pro2").className = "d_2"; break; case 2: document.getElementById("gx1").style.display = "none"; document.getElementById("gx2").style.display = "block"; document.getElementById("pro1").className = "d_2"; document.getElementById("pro2").className = "d_1"; break } }; $(function () { $('#gx1 > table').addClass('s') }); if ($(".tabsTitle").length > 0) { $(".tabsTitle").on('click', function () { $(".tabsTitle").removeClass("active"); $(this).addClass("active"); var index = $(this).attr("index"); $(".pro_detail").hide(); $(".pro_detail").eq(index - 1).show().addClass("fadeInUp").siblings(".pro_detail").hide().removeClass("fadeInUp"); }); }