"use strict"; (function () { // console.log("娴忚鍣ㄥ垎杈ㄧ巼鏄? + document.documentElement.clientWidth + "*" + document.documentElement.clientHeight); // console.log("灞忓箷鍒嗚鲸鐜囨槸" + window.screen.width + "*" + window.screen.height); let pageVar = $("meta[name='generator']")[0].dataset.var; pageVar = pageVar.split("|"); pageVar = { pageUrl: pageVar[0], acode: pageVar[1], template: pageVar[2], tcode: pageVar[3], pcode: pageVar[4], scode: pageVar[5], }; let isPc = true; let isPad = false; let isPhone = false; checkSize() $(window).resize(function () { checkSize() }); function checkSize() { let windowsWidth = document.documentElement.clientWidth; if (windowsWidth > 991) { isPc = true; isPad = false; isPhone = false; // console.log("isPc", isPc); } else if (windowsWidth >= 768 && windowsWidth <= 991) { isPc = false; isPad = true; // console.log("isPad", isPad); } else if (windowsWidth < 768) { isPc = false; isPad = false; isPhone = true; // console.log("isPhone", isPhone); } // console.log("windowsWidth", windowsWidth); } let banners = $("#sw_banner .swiper-slide"); if (pageVar.scode != 0) { banners = $("#sw_pagebanner .swiper-slide"); } banners.each(function (v, k) { let classList = $(k)[0].dataset.id; // console.log($(k)); // console.log(classList); if (classList != null && pageVar.scode != 10001) { let tcode = $(k)[0].dataset.tcode; let pcode = $(k)[0].dataset.pcode; let scode = $(k)[0].dataset.scode; if (scode != 0) { let classLs = classList.split(',') let show = false; if (classLs.indexOf(tcode) >= 0) { show = true; } if (classLs.indexOf(pcode) >= 0) { show = true; } if (classLs.indexOf(scode) >= 0) { show = true; } // console.log(classLs); if (!show) { $(k)[0].remove(); } } // console.log(tcode,pcode,scode); } }) var mybanner = new Swiper('#sw_banner', { loop: true, speed: 300, autoplay: { disableOnInteraction: false, delay: 4000 }, navigation: { nextEl: '.swiper-button-next-banner', prevEl: '.swiper-button-prev-banner', }, pagination: { el: '.swiper-pagination-banner', clickable: true, }, on: { init: function (item) { bannerReSize() } } }) var sw_pagebanner = new Swiper('#sw_pagebanner', { loop: true, speed: 300, on: { init: function (item) { bannerReSize(item) } } }) function bannerReSize(e) { // console.log(e); let pcHeight = $(".sw_banner")[0].dataset.pcheight; let padHeight = $(".sw_banner")[0].dataset.padheight; let phoneHeight = $(".sw_banner")[0].dataset.phoneheight; if (isPc) { $(".sw_banner .swiper-slide").css({ "background-size": "auto " + pcHeight + "px", "height": pcHeight + "px" }) $(".sw_banner .swiper-slide div").css({ "height": pcHeight + "px" }) } if (isPad) { $(".sw_banner .swiper-slide").css({ "background-size": "auto " + padHeight + "px", "height": padHeight + "px" }) $(".sw_banner .swiper-slide div").css({ "height": padHeight + "px" }) } if (isPhone) { $(".sw_banner .swiper-slide").css({ "background-size": "auto " + phoneHeight + "px", "height": phoneHeight + "px" }) $(".sw_banner .swiper-slide div").css({ "height": phoneHeight + "px" }) } } $(window).resize(function () { bannerReSize() console.log("bannerUpdata"); } ); //浜у搧3 var mySwiper_product2 = new Swiper('#sw_para_box', { autoplay: true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, slidesPerView: 1, spaceBetween: 20, on: { init: function () { $('.index_product_para').removeClass('active') $('.index_product_para_' + this.activeIndex).addClass('active'); }, slideChangeTransitionEnd: function () { $('.index_product_para').removeClass('active') $('.index_product_para_' + this.activeIndex).addClass('active'); }, }, }) $('.index_product_para').hover(function (e) { // console.log('index_product_para',this,e,e.target.dataset['index']); // console.log('index_product_para',$(this).attr("data-index")); $('.index_product_para').removeClass('active') var targer_index = $(this).attr("data-index"); mySwiper_product2.slideTo(targer_index, 1000, false); $('.index_product_para_' + targer_index).addClass('active'); }) // 鍝佽川 var index_pz_sw = new Swiper('#index_pz_sw', { autoplay: true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, slidesPerView: 4, spaceBetween: 20, }) // 浼欎即 var index_hp_sw = new Swiper('#index_hp_sw', { loop: true, autoplay: true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, slidesPerView: 4, spaceBetween: 50, }) // 鐩稿唽 var mySwiper_index_xc_sw = new Swiper('#index_xc_sw', { autoplay: true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, slidesPerView: 5, spaceBetween: 20, navigation: { nextEl: '.swiper-button-next-right', prevEl: '.swiper-button-prev-left', }, }) // 鑽h獕 var mySwiper_index_ry_sw = new Swiper('#index_ry_sw', { autoplay: true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, slidesPerView: 4, spaceBetween: 20, }) // 鏂伴椈 var index_msg1_sw_item = new Swiper('#msg1_sw_news', { spaceBetween: 10, on: { init: function () { $('.index_news_text1').removeClass('active') $('.index_news_top_left_' + this.activeIndex).addClass('active'); }, slideChangeTransitionEnd: function () { let indexSwiper = this.activeIndex; $('.index_news_text1').removeClass('active'); $('.index_news_top_left_' + indexSwiper).addClass('active'); }, }, }) $('.index_news_text1').hover(function (e) { // console.log('index_news_text1',this,e,e.target.dataset['index']); // console.log('index_news_text1',$(this).attr("data-index")); $('.index_news_text1').removeClass('active') var targer_index = $(this).attr("data-index"); index_msg1_sw_item.slideTo(targer_index, 1000, false); $('.index_news_top_left_' + targer_index).addClass('active'); }) // phone var phone_product_sw = new Swiper('#phone_product_sw', { autoplay: true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, slidesPerView: 2, slidesPerColumn: 2, slidesPerColumnFill: 'row', spaceBetween: 20, breakpoints: { 1024: { slidesPerView: 2, }, 768: { slidesPerView: 2, }, 640: { slidesPerView: 2, }, 320: { slidesPerView: 2, } } }) var index_phone_td_sw_text = new Swiper('#index_phone_td_sw_text', { slidesPerView: 4, watchSlidesVisibility: true, }) var index_msg1_sw_item = new Swiper('#index_phone_td_sw', { spaceBetween: 10, loop: true, autopaly: true, autoplay: { disableOnInteraction: false, }, thumbs: { swiper: index_phone_td_sw_text, }, navigation: { nextEl: '.swiper-button-prev-td', prevEl: '.swiper-button-next-td', }, }) // 鎵嬫満浼樺娍 var mySwiper_index_phone_ys_sw = new Swiper('#index_phone_ys_sw', { autoplay: true, loop: true, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, spaceBetween: 20, pagination: { el: '.swiper-pagination-ys', }, }) // 鎵嬫満璇佷功 var mySwiper_index_phone_zs_sw = new Swiper('#index_phone_zs_sw', { autoplay: true, loop: true, slidesPerView: 4, autoplay: { disableOnInteraction: false, }, watchSlidesVisibility: true, spaceBetween: 10, navigation: { nextEl: '.swiper-button-prev-zs', prevEl: '.swiper-button-next-zs', }, }) $('.clearfix iframe').css('height', $('.clearfix iframe').width() * 0.56) // new WOW().init(); }()); function AddFavorite(sURL, sTitle) { try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle, sURL, ""); } catch (e) { alert("鍔犲叆鏀惰棌澶辫触锛岃浣跨敤Ctrl+D杩涜娣诲姞"); } } }