$(function () { let pc = { index: { nav: function (tar) { $(tar).mouseover(function () { $(tar).addClass('index_header_hover') }).mouseleave(function () { if ($('.scrollact_1').length) return false; if ($('.header_nav_menu_bar_mask:visible').length || $('.crc-sub-search-click').length) return false let scrollTop = $(window).scrollTop(); var localHref = window.location.href if (scrollTop == 0 && !localHref.includes('detail') || localHref.includes('index') && !$('.fadeInLeft').length) { $(tar).removeClass('index_header_hover') } else { if (!$('.fadeInLeft').length && $('.scroll').length) { $(tar).removeClass('index_header_hover') } } }); }, videoPlay: function (tar) { if (tar && tar.length != 0) { var video = $("#index-video"), src = video.attr("data-src"),poster=video.attr("data-poster"); video[0].controls = false; tar.off().on("click", function () { var index = ((video.attr("data-src")).indexOf("?")); var videoID = video.attr("data-src").substring(index+5); pc.news.videoClick(videoID); video[0].src = src; video[0].play(); video.attr("controls",true); tar.hide(); video[0].addEventListener("ended", function (ev) { if (ev.returnValue) { tar.show(); video.removeAttr("controls"); video.attr("src",""); video.attr("poster",poster); } }); }); } }, index_search: function (tar) { if (tar && tar.length != 0) { var defHref = tar.attr("href"); var searchFlag = 0; $(".hr-search-mask").on("click", function () { $(this).toggleClass("icon-guanbi"); $('.other_header').toggleClass('crc-sub-search-click').off('mouseleave'); if (!searchFlag) { searchFlag = 1 $('.header_nav_menu_bar_mask:visible').hide() $('.index_header').addClass('index_header_hover crc-sub-search-click').off('mouseleave'); tar.attr("href", defHref); $(".hr-search-content").show(); $("#searchword2").focus(); $(".crc-sub-search,.crc-sub-quick").show(); } else if (searchFlag) { searchFlag = 0 var scrollTop = $('.scroll').scrollTop(); if (scrollTop == 0) { $('.index_header').removeClass('crc-sub-search-click').mouseleave(function () { if ($('.header_nav_menu_bar_mask:visible').length) return false $('.index_header').removeClass('index_header_hover') }) } else { $('.index_header').removeClass('crc-sub-search-click') } var localHref = window.location.href var scrolltop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; if (!localHref.includes('index') && scrolltop == 0) { $('.index_header').removeClass('crc-sub-search-click').mouseleave(function () { $('.index_header').removeClass('index_header_hover') }) } $(".hr-search-content").hide(); } }); $("#hr-search-href,.hr-search-close").on("click", function () { searchFlag = 0 var args = "siteId=" + window.btoa(tar.attr("data-siteId")) + "&siteIds=" + window.btoa(tar.attr("data-siteIds")) + "&excludeCategoryId=" + window.btoa(tar.attr("data-excludeCategoryId")) + "&platform=" + window.btoa(tar.attr("data-source")) + "&column=" + window.btoa(tar.attr("data-plate")) + "&keyword=" + encodeURI(encodeURI($.trim($("#searchword2").val()))); tar.attr("href", defHref + '#' + args); $("#searchword2").val(""); $('.index_header').removeClass('crc-sub-search-click').mouseleave(function () { $('.index_header').removeClass('index_header_hover') }) $(".hr-search-content").hide(); $(".crc-sub-search-mask").removeClass("icon-guanbi"); $('.index_header,.other_header').removeClass('crc-sub-search-click') }); $("#searchword2").keyup(function (e) { if (e.keyCode == 13) { $("#hr-search-href").trigger("click"); window.open(tar.attr("href")); } }); } }, index_banner_swiper: function (tar) { if ($(tar + ' .swiper-slide').length > 1) { new Swiper(tar, { loop: true, // 寰幆妯″紡閫夐」 autoplay: { disableOnInteraction: false, // 鐢ㄦ埛鎿嶄綔swiper涔嬪悗锛屾槸鍚︾姝utoplay delay: 5000, // 鑷姩鍒囨崲鐨勬椂闂撮棿闅旓紙鍗曚綅ms锛 }, speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: 1, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 // 濡傛灉闇€瑕佸垎椤靛櫒 pagination: { el: '.swiper-pagination', clickable :true, }, on: { init: function () { var timber = setTimeout(function () { $(".swiper_progressbar .swiper-pagination-bullet").width(100/$(".swiper_progressbar .swiper-pagination-bullet").length+'%'); },500); } } }) } }, index_window_scroll: function (tar) { let winhref = window.location.href $(tar).mousewheel(function (event, delta, deltaX, deltaY) { let right_navArr = [] if (delta < 0) { if (!event.ctrlKey) { $('.other_header').css('transform', 'translateY(-40px)'); if ($('.fadeInLeft').length) { $('.index_header').css('transform', 'translateY(-40px)'); return $('.scroll').removeClass('scrollact_1') } if (!$('.header_nav_menu_bar_mask:visible').length && !$('.crc-sub-search-click').length) { $('.index_header').addClass("index_header_hover").css('transform', 'translateY(-40px)'); } else { $('.index_header').addClass('index_header_hover') } $('.scroll').addClass('scrollact_1'); } } else { let scrollTop = $('.scroll').scrollTop(); let windowTop = $(window).scrollTop(); let data = sessionStorage.getItem('key'); $('.other_header').css('transform', 'translateY(0px)'); $('.index_header').css('transform', 'translateY(0)') if (scrollTop == 0 && data == undefined) { if (!$('.header_nav_menu_bar_mask:visible').length && !$('.crc-sub-search-click').length) { $('.index_header').removeClass('index_header_hover') } } else if (scrollTop == 0 && windowTop == 0) { $('.index_header').removeClass('index_header_hover') } else { $('.index_header').addClass('index_header_hover') } } let windowTop = $(window).scrollTop(); let documentHeight = $(document).height(); let winHeight = $(window).height(); if ((documentHeight - windowTop - winHeight) < 700) { $(".position_fixed").hide(); } else { $(".position_fixed").show(); } var localHref = window.location.href if (!localHref.includes('index') && windowTop == 0) { if (!$('.header_nav_menu_bar_mask:visible').length && !$('.crc-sub-search-click').length) { } } if (localHref.includes('detail') && windowTop == 0) { $('.index_header').addClass('index_header_hover') } if (!$('.scroll').length && $('.position_fixed_div').length) { $('.inner>.title').each(function (i, j) { var id = $(j).attr("id") if (isInViewPortOfOne('#' + id)) { right_navArr.push(i) $('.position_fixed_div a ').eq(right_navArr[0]).addClass('active').siblings().removeClass('active') } else { } }) } function isInViewPortOfOne(el) { var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; // viewPortHeight 鍏煎鎵€鏈夋祻瑙堝櫒鍐欐硶 const viewPortHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight var el = document.querySelector(el) var el_height = el.getBoundingClientRect().height / 2 const offsetTop = $(el).offset().top + el_height const top = offsetTop - scrollTop if (-el_height < top && top < viewPortHeight) { return true } else { return false } } }); }, index_scroll: function (tar) { let timer = false let counterflag = false $(tar).mousewheel(function (event, delta, deltaX, deltaY) { var scrollTop = $(tar).scrollTop(); $('.swiper_products .swiper-container').removeClass('swiper-container_act') $('.index_header').addClass('index_header_hover') if (scrollTop == 0) { $(tar).removeClass('scrollact_1') if (!$('.header_nav_menu_bar_mask:visible').length && !$('.crc-sub-search-click').length) { $('.index_header').removeClass('index_header_hover') } } if (isInViewPortOfOne('.index_products') && scrollTop !== 0) { $('.swiper_products .swiper-container').addClass('swiper-container_act') } else { $('.swiper_products .swiper-container').removeClass('swiper-container_act') } if (isInViewPortOfOne('.news') && scrollTop !== 0) { $('.index_news_pic').addClass('index_news_pic_act') $('.news_list li').addClass('news_act') } else { $('.index_news_pic').removeClass('index_news_pic_act') $('.news_list li').removeClass('news_act') } clearTimeout(timer); // 娓呴櫎鏈墽琛岀殑浠g爜锛岄噸缃洖鍒濆鍖栫姸鎬 if (isInViewPortOfOne('.marketing_network') == true) { counterflag = true } timer = setTimeout(function () { if (counterflag) { if (isInViewPortOfOne('.marketing_network')) { $('.counter').countUp({ delay: 10, time: 1500, triggerOnce: true }); } } if (isInViewPortOfOne('.marketing_network') == true) { counterflag = false } }, 500); function isInViewPortOfOne(el) { // viewPortHeight 鍏煎鎵€鏈夋祻瑙堝櫒鍐欐硶 const viewPortHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight var el = document.querySelector(el) var el_height = el.getBoundingClientRect().height / 2 const offsetTop = el.offsetTop + el_height const top = offsetTop - scrollTop if (-el_height < top && top < viewPortHeight) { return true } else { return false } } }) }, index_products_swiper: function (tar) { var bgSwiper = new Swiper(".index_products_bg_swiper .swiper-container ", { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: 1, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 10, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) noSwiping: true, }); var indexProSwiper = new Swiper(tar, { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: 1, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 10, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) controller: { control: bgSwiper, }, pagination: { el: '.swiper-index-pagination', type: 'progressbar', }, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 noSwiping: false, }, 440: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 noSwiping: false, }, 750: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 noSwiping: false, }, 1025: { noSwiping: true, }, }, // 濡傛灉闇€瑕佸墠杩涘悗閫€鎸夐挳 on: { init: function () { var dom = $(".swiper_products .slide_left .index_more a"),rightDom = $(".swiper_products .slide_right a"),leftDom = $(".swiper_products .slide_left .product_title a"); for (let i = 0; i < dom.length; i++) { dom.eq(i).attr("href", $(".index-prod").eq(i).attr("data-url")); rightDom.eq(i).attr("href", $(".index-prod").eq(i).attr("data-url")); leftDom.eq(i).attr("href", $(".index-prod").eq(i).attr("data-url")); } } }, navigation: { nextEl: '.swiper-index-next', prevEl: '.swiper-index-prev', }, }); }, index_netmarketing_swiper: new Swiper('.index_netmarketing_swiper .swiper-container', { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 slidesPerView: 1, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 fadeEffect: { crossFade: true }, }), index_shop_map: function (tar) { $(tar).mouseover(function () { $(".map_detail").fadeOut(); $(this).find(".map_detail").fadeIn(); }).mouseleave(function () { $(this).find(".map_detail").fadeOut(); }) }, index_service_swiper: new Swiper('.index_service_swiper .swiper-container', { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 direction: 'vertical',//鍨傜洿鍒囨崲閫夐」 slidesPerView: 1, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 10, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) fadeEffect: { crossFade: true }, noSwiping: true, // 濡傛灉闇€瑕佸垎椤靛櫒 }), index_back_top: function (tar) { if ($(".index_header").length != 0) { } else { $(window).scroll(function () { if ($(this).scrollTop() > 500) { $(".back_to_top_pic").addClass("back_fixed"); } else { $(".back_to_top_pic").removeClass("back_fixed"); } }); } $(tar).on("click",function () { $("html,body,.scroll").animate({ scrollTop: 0 },500); $(".back_to_top_pic").removeClass("back_fixed"); }) }, index_banner_relation: function (tar) { $(tar).click(function () { sessionStorage.setItem('key', 'isInvestment'); $('.index_relation_mask').addClass('fadeInLeft') if ($('.fadeInLeft').length) { let right_close_icon_height = $('.investment_body').outerHeight() + 400 $('.index_relation_mask_right_close').height(right_close_icon_height) let data = sessionStorage.getItem('key'); if (data == 'isInvestment') { $('.index_relation_mask').addClass('fadeInLeft') } else { $('.index_relation_mask').removeClass('fadeInLeft') } let scrollTop = $(window).scrollTop(); if (scrollTop != 0) { $('.index_header').addClass('index_header_hover') } $('.index_relation_mask_right_close_icon').click(function () { sessionStorage.removeItem('key'); $('.index_relation_mask').removeClass('fadeInLeft') }) } }) }, index_service: function (tar) { let clicknum = 0; $(tar).off().on('click', function () { if ($(this).hasClass("active")) { clicknum += 0 return } else { clicknum ++; } pc.index.index_service_swiper.slideTo($(this).attr("data-code"), 0, false); if (clicknum % 5 == 1) { $(tar).eq(1).removeClass('index_service_item3_move').addClass('index_service_item2_move'); $(tar).eq(2).removeClass('index_service_item4_move').addClass('index_service_item3_move'); $(tar).eq(3).removeClass('index_service_item5_move').addClass('index_service_item4_move'); $(tar).eq(4).removeClass('index_service_item1_move').addClass('index_service_item5_move'); $(tar).eq(0).removeClass('index_service_item2_move').addClass('index_service_item1_move'); } if (clicknum % 5 == 2) { $(tar).eq(1).addClass('index_service_item1_move') $(tar).eq(2).removeClass('index_service_item3_move').addClass('index_service_item2_move') $(tar).eq(3).removeClass('index_service_item4_move').addClass('index_service_item3_move') $(tar).eq(4).removeClass('index_service_item5_move').addClass('index_service_item4_move') $(tar).eq(0).removeClass('index_service_item1_move').addClass('index_service_item5_move') } if (clicknum % 5 == 3) { $(tar).eq(1).removeClass('index_service_item1_move').addClass('index_service_item5_move') $(tar).eq(2).removeClass('index_service_item2_move').addClass('index_service_item1_move') $(tar).eq(3).removeClass('index_service_item3_move').addClass('index_service_item2_move') $(tar).eq(4).removeClass('index_service_item4_move').addClass('index_service_item3_move') $(tar).eq(0).removeClass('index_service_item5_move').addClass('index_service_item4_move') } if (clicknum % 5 == 4) { $(tar).eq(1).removeClass('index_service_item5_move').addClass('index_service_item4_move') $(tar).eq(2).removeClass('index_service_item1_move').addClass('index_service_item5_move') $(tar).eq(3).removeClass('index_service_item2_move').addClass('index_service_item1_move') $(tar).eq(4).removeClass('index_service_item3_move').addClass('index_service_item2_move') $(tar).eq(0).removeClass('index_service_item4_move').addClass('index_service_item3_move') } if (clicknum % 5 == 0) { $(tar).eq(1).removeClass('index_service_item4_move').addClass('index_service_item3_move') $(tar).eq(2).removeClass('index_service_item5_move').addClass('index_service_item4_move') $(tar).eq(3).removeClass('index_service_item1_move').addClass('index_service_item5_move') $(tar).eq(4).removeClass('index_service_item2_move').addClass('index_service_item1_move') $(tar).eq(0).removeClass('index_service_item3_move').addClass('index_service_item2_move') } $(tar).removeClass("active"); $(this).addClass('active'); }); var timber = setInterval(function () { var dom = $(".index_service .service_list li.active").next(); if (dom.length != 0) { dom.trigger("click"); } else { dom = $(".index_service .service_list li.active").prev(); dom.trigger("click"); } }, 10000); $(".service_list").mouseover(function () { clearInterval(timber); }).mouseleave(function () { timber = setInterval(function () { var dom = $(".index_service .service_list li.active").next(); if (dom.length != 0) { dom.trigger("click"); } else { dom = $(".index_service .service_list li.active").prev(); dom.trigger("click"); } }, 10000); }); } }, about: { vision_swiper: function (tar) { var visSwiper = new Swiper(tar, { speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: 4, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 40, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) normalizeSlideIndex: false, resizeObserver: true, watchOverflow: true, // 濡傛灉闇€瑕佸垎椤靛櫒 pagination: { el: '.swiper-bot-swiper .swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { return ''+(swiper.activeIndex*1+1)+'' + ' / ' + swiper.slides.length; } }, // navigation: { // nextEl: '.swiper-vision-next', // prevEl: '.swiper-vision-prev', // }, on: { init: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".swiper-bot-swiper .main-bot-prog-in").width(len+'%'); var i = 0; $(".swiper-vision-prev").addClass("swiper-disabled"); $(".swiper-vision-prev").on("click", function () { if (i > 0) { i--; $(".swiper-vision-next").removeClass("swiper-disabled"); visSwiper.slideTo(i); if (i == 0) { $(".swiper-vision-prev").addClass("swiper-disabled"); } } else { $(".swiper-vision-prev").addClass("swiper-disabled"); } }); $(".swiper-vision-next").on("click", function () { $(".swiper-vision-prev,.swiper-vision-next").removeClass("swiper-disabled"); var len = visSwiper.slides.length; if (visSwiper.activeIndex < len - 1) { i++ visSwiper.slideNext(); if (visSwiper.activeIndex >= (len - 1)) { $(".swiper-vision-next").addClass("swiper-disabled"); } } else { $(".swiper-vision-next").addClass("swiper-disabled"); } }); }, resize: function (swiper) { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".swiper-bot-swiper .main-bot-prog-in").width(len + '%'); }, slideChange: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; if (window.screen.width > 1025) { $(".swiper-bot-swiper .main-bot-prog-in").width(len + '%'); } else { if (visSwiper.isEnd) { $(".swiper-bot-swiper .main-bot-prog-in").width(100 + '%'); } else { $(".swiper-bot-swiper .main-bot-prog-in").width(len + '%'); } } }, }, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 noSwiping: false, slidesPerView: 1, spaceBetween: 20 }, 440: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 2, spaceBetween: 20, noSwiping: false, }, 750: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 3, spaceBetween: 20, noSwiping: false, }, 1025: { noSwiping: true, }, 1280: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?280 slidesPerView: 4, spaceBetween: 40, noSwiping: true, } }, }); }, sub_swiper: function (tar) { var subSwiper = new Swiper(tar, { speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: 4, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 40, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) normalizeSlideIndex: false, resizeObserver: true, watchOverflow: true, noSwiping: true, pagination: { el: '.sub-pag', type: 'custom', renderCustom: function (swiper, current, total) { return ''+(swiper.activeIndex*1+1)+'' + ' / ' + swiper.slides.length; } }, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 1, spaceBetween: 20, noSwiping: false, }, 440: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 2, spaceBetween: 20, noSwiping: false, }, 750: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 3, spaceBetween: 20, noSwiping: false, }, 1025: { noSwiping: true, }, 1280: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?280 slidesPerView: 4, spaceBetween: 40, noSwiping: true, } }, // navigation: { // nextEl: '.swiper-sub-next', // prevEl: '.swiper-sub-prev', // }, on: { init: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".swiper-sub-swiper .main-bot-prog-in").width(len+'%'); var i = 0; $(".swiper-sub-prev").addClass("swiper-disabled"); $(".swiper-sub-prev").on("click", function () { if (i > 0) { i--; $(".swiper-sub-next").removeClass("swiper-disabled"); subSwiper.slideTo(i); if (i == 0) { $(".swiper-sub-prev").addClass("swiper-disabled"); } } else { $(".swiper-sub-prev").addClass("swiper-disabled"); } }); $(".swiper-sub-next").on("click", function () { $(".swiper-sub-prev,.swiper-sub-next").removeClass("swiper-disabled"); var len = subSwiper.slides.length; if (subSwiper.activeIndex < len - 1) { i++; subSwiper.slideNext(); if (subSwiper.activeIndex >= (len - 1)) { $(".swiper-sub-next").addClass("swiper-disabled"); } } else { $(".swiper-sub-next").addClass("swiper-disabled"); } }); }, resize: function (swiper) { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".swiper-sub-swiper .main-bot-prog-in").width(len+'%'); }, slideChange: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; if (window.screen.width > 1025) { $(".swiper-sub-swiper .main-bot-prog-in").width(len + '%'); } else { if (subSwiper.isEnd) { $(".swiper-sub-swiper .main-bot-prog-in").width(100+'%'); } else { $(".swiper-sub-swiper .main-bot-prog-in").width(len+'%'); } } }, }, }) }, res_swiper: function (tar) { var resSwiper = new Swiper(tar, { speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: 4, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 40, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) normalizeSlideIndex: false, resizeObserver: true, watchOverflow: true, noSwiping: true, // 濡傛灉闇€瑕佸垎椤靛櫒 // 濡傛灉闇€瑕佸墠杩涘悗閫€鎸夐挳 pagination: { el: '.swiper-res-swiper .swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { return ''+(swiper.activeIndex*1+1)+'' + ' / ' + swiper.slides.length; } }, // navigation: { // nextEl: '.swiper-res-next', // prevEl: '.swiper-res-prev', // }, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 1, spaceBetween: 0, noSwiping: false, resistanceRatio:0, resizeObserver: false, watchOverflow: false, resistance:false, }, 440: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 2, spaceBetween: 20, noSwiping: false, }, 750: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 2, spaceBetween: 20, noSwiping: false, }, 1025: { noSwiping: true, }, 1280: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?280 slidesPerView: 4, spaceBetween: 40, noSwiping: true, } }, on: { init: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".swiper-res-swiper .main-bot-prog-in").width(len+'%'); window.itemIndex = 0; $(".swiper-res-prev").addClass("swiper-disabled"); $(".swiper-res-prev").on("click", function () { if (itemIndex >= 0) { itemIndex--; $(".swiper-res-next").removeClass("swiper-disabled"); resSwiper.slideTo(itemIndex); if (itemIndex == 0) { $(".swiper-res-prev").addClass("swiper-disabled"); } } else { $(".swiper-res-prev").addClass("swiper-disabled"); } }); $(".swiper-res-next").on("click", function () { $(".swiper-res-prev,.swiper-res-next").removeClass("swiper-disabled"); var len = resSwiper.slides.length; if (resSwiper.activeIndex < len - 1) { itemIndex++; resSwiper.slideNext(); if (resSwiper.activeIndex >= (len - 1)) { $(".swiper-res-next").addClass("swiper-disabled"); } } else { $(".swiper-res-next").addClass("swiper-disabled"); } }); }, resize: function (swiper) { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".swiper-res-swiper .main-bot-prog-in").width(len+'%'); }, slideChange: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; if (window.screen.width > 1025) { $(".swiper-res-swiper .main-bot-prog-in").width(len + '%'); } else { if (resSwiper.isEnd) { $(".swiper-res-swiper .main-bot-prog-in").width(100+'%'); } else { $(".swiper-res-swiper .main-bot-prog-in").width(len+'%'); } } itemIndex = this.activeIndex; if ((this.activeIndex + 1) == total) { $(".swiper-res-next,.swiper-res-prev").removeClass("swiper-disabled"); $(".swiper-res-next").addClass("swiper-disabled"); } else if (this.activeIndex == 0) { $(".swiper-res-next,.swiper-res-prev").removeClass("swiper-disabled"); $(".swiper-res-prev").addClass("swiper-disabled"); } else { $(".swiper-res-next,.swiper-res-prev").removeClass("swiper-disabled"); } if (this.activeIndex=total) { return false; } }, } }) }, about_history_swiper: new Swiper('.about_history_swiper .swiper-container', { direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: '1', // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 on: { init: function () { var total = this.slides.length; $(".history-next .items").hide(); $(".history-next .items").eq(1).show(); $('.index_processes_bar_inner').width("33.3%"); }, transitionEnd: function () { var total = this.slides.length; var index = this.realIndex + 1; $(".index_processes_year_li").removeClass("active"); $(".index_processes_year_li").eq(this.realIndex).addClass("active"); var o = (((this.activeIndex+1)/total)*1) * 100; let width_percent = o + '%' $('.index_processes_bar_inner').width(width_percent); $(".processes_li").removeClass("processes_sel"); $(".processes_li").eq(this.realIndex).addClass("processes_sel"); $(".history-next .items").hide(); if (index == total) { $(".history-next .items").eq(0).show(); } else { $(".history-next .items").eq(index).show(); } } } }), process_year: function (tar) { $(tar).on('click', function () { let about_history_swiper = $(this).index() $(this).addClass('active').siblings().removeClass('active') pc.about.about_history_swiper.slideTo(about_history_swiper); $(".processes_li ").removeClass("processes_sel"); $(".processes_li ").eq(about_history_swiper).addClass("processes_sel"); }) }, honorFun: function (tar) { if (tar && tar.length != 0) { var scrllHeight = $(".about_body_honour_content")[0].scrollHeight; var realHeight = $(".about_body_honour_content").height(); var arrOffset = [],brrOffset = []; //鍦嗗舰 var win = document.body.clientWidth; if (win > 1024) { $("body").attr("data-screen", "big"); } else { $("body").attr("data-screen", "small"); } $(".index_honour_scroll_item").each(function (index) { brrOffset.push($(".index_honour_scroll_item").eq(index)[0].offsetTop+$(".index_honour_scroll_item").eq(index).height() - 200); arrOffset.push($(".index_honour_scroll_item").eq(index)[0].offsetTop + $(".index_honour_scroll_item").eq(index).height() - 200); }); var radialObj = null; radialObj = $('#rad_about_honour_circe').radialIndicator( { initValue: 0, barWidth: 2, maxValue: scrllHeight-realHeight, barColor: '#E2332E', radius: 200, displayNumber: false }).data('radialIndicator'); //鍦嗗舰 end $(window).resize(function () { var win = document.body.clientWidth; if ($("body").attr("data-screen") == "small") { if (win > 1024) { scrllHeight = $(".about_body_honour_content")[0].scrollHeight; realHeight = $(".about_body_honour_content").height(); arrOffset = [], brrOffset = []; $(".index_honour_scroll_item").each(function (index) { brrOffset.push($(".index_honour_scroll_item").eq(index)[0].offsetTop + $(".index_honour_scroll_item").eq(index).height() - 200); arrOffset.push($(".index_honour_scroll_item").eq(index)[0].offsetTop + $(".index_honour_scroll_item").eq(index).height() - 200); }); $("body").attr("data-screen", "big"); radialObj.option('maxValue',scrllHeight-realHeight); } } }); var sec = 0; $(".about-year-li").eq(0).addClass("about-year-sel"); $(".about_body_honour_content").mousewheel(function (event, delta, deltaX, deltaY) { var dom = $(".about_body_honour_content").scrollTop(); if (dom > 50) { $(".honor-wrap").addClass("honor-wrap-sel"); } if (deltaY == -1) { for (let i = 0; i < arrOffset.length; i++) { if (dom > sec && dom > arrOffset[i]) { sec = arrOffset[i]; } } $(".about_honour_year_left_list").css("transform", "translate3d(0," + ((220 + (arrOffset.indexOf(sec)) * 220) * -1) + "px , 0)"); radialObj.animate(dom); var timber = setTimeout(function () { $(".about-year-li").removeClass("about-year-sel"); $(".about-year-li").eq(arrOffset.indexOf(sec) + 1).addClass("about-year-sel"); }, 300); } else { for (let i = 0; i < arrOffset.length; i++) { if ( dom < arrOffset[i] && dom> arrOffset[i-1]) { sec = arrOffset[i-1]; } } if (arrOffset.indexOf(sec) == 0 && dom < 100) { $(".about_honour_year_left_list").css("transform", "translate3d(0," + 0 + "px , 0)"); $(".honor-wrap").removeClass("honor-wrap-sel"); radialObj.animate(0); var timber = setTimeout(function () { $(".about-year-li").removeClass("about-year-sel"); $(".about-year-li").eq(0).addClass("about-year-sel"); }, 300); } else { $(".about_honour_year_left_list").css("transform", "translate3d(0," + ((220 + (arrOffset.indexOf(sec)) * 220) * -1) + "px , 0)"); var timber = setTimeout(function () { $(".about-year-li").removeClass("about-year-sel"); $(".about-year-li").eq(arrOffset.indexOf(sec) + 1).addClass("about-year-sel"); }, 300); radialObj.animate(dom); } } }); } }, }, investment: { stock_quotes_swiper: new Swiper('.stock_quotes_swiper .swiper-container', { direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: '1', // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 // 濡傛灉闇€瑕佸墠杩涘悗閫€鎸夐挳 navigation: { nextEl: '.stock_quotes_swiper .swiper-button-next', prevEl: '.stock_quotes_swiper .swiper-button-prev', }, }), director_swiper: function (tar) { var arrMain = []; for (let i = 0; i < $(tar).length; i++) { $(tar).eq(i).addClass('swiper' + i); arrMain[i] = new Swiper('.swiper' + i + ' .swiper-container', { slidesPerView: 3, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 20, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) normalizeSlideIndex: false, resizeObserver: true, watchOverflow: true, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 1, spaceBetween: 20, noSwiping: false, }, 450: { noSwiping: false, }, 440: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 2, spaceBetween: 20, noSwiping: false, }, 750: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 3, spaceBetween: 20, noSwiping: false, }, 1025: { noSwiping: true, }, 1280: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?280 slidesPerView: 4, spaceBetween: 20, noSwiping: true, } }, pagination: { el: '.swiper' + i + ' .swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { return ''+(swiper.activeIndex*1+1)+'' + ' / ' + swiper.slides.length; } }, on: { init: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".main-bot-prog-in").eq(i).width(len + '%'); var that = this; var m = 0; var preDom = $(".corporate_governance_swiper_contain").eq(i).find(".swiper-qu-prev"); var nextDom = $(".corporate_governance_swiper_contain").eq(i).find(".swiper-qu-next"); preDom.addClass("swiper-disabled"); preDom.on("click", function () { if (m > 0) { m--; nextDom.removeClass("swiper-disabled"); that.slideTo(m); if (m == 0) { preDom.addClass("swiper-disabled"); } } else { preDom.addClass("swiper-disabled"); } }); nextDom.on("click", function () { preDom.removeClass("swiper-disabled"); nextDom.removeClass("swiper-disabled"); var len = that.slides.length; if (that.activeIndex < len - 1) { m++; that.slideNext(); if (that.activeIndex >= (len - 1)) { nextDom.addClass("swiper-disabled"); } } else { nextDom.addClass("swiper-disabled"); } }); $(document).on("contextmenu",function(e){ return false; }); }, resize: function (swiper) { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".main-bot-prog-in").eq(i).width(len + '%'); }, slideChange: function () { var that = this; var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; if (window.screen.width > 1025) { $(".main-bot-prog-in").eq(i).width(len + '%'); } else { if (that.isEnd) { $(".main-bot-prog-in").eq(i).width(100 + '%'); } else { $(".main-bot-prog-in").eq(i).width(len + '%'); } } }, } }) } var domMain = $(".corporate_governance .slide_content"),html='
'; domMain.on("click", function () { $(".ds-mask,.ds-mask-open").remove(); $("body").append(html); if ($(this).attr("data-cont").indexOf("null") != "-1") { $(".ds-mask-open .det").html(""); } else { $(".ds-mask-open .det").html($(this).attr("data-cont")); } $(".ds-mask-open .desc").html($(this).attr("data-desc")); $(".ds-mask-open .name").html($(this).attr("data-name")); if ($(this).attr("data-pic") && $(this).attr("data-pic").length != 0) { $(".ds-mask-open .pic img").attr("src",$(this).attr("data-pic")); } else { $(".ds-mask-open .pic").remove(); $(".ds-mask-open .name").addClass("ds-nopadding"); } $(".ds-mask-open .close,.ds-mask-open .ds-mask").on("click", function () { $(".ds-mask,.ds-mask-open").remove(); }); }); }, investment_more_show: function (tar, n) { if (n == 6&&tar==".capital_stock_content .stock_more") { if ($('.top_ten_stockholder .top_ten_stockholder_li').length) { if ($('.top_ten_stockholder .top_ten_stockholder_li').length < n) { $(tar).hide() } else { $('.top_ten_stockholder .top_ten_stockholder_li:nth-child(n' + n + ')').hide() } } } $(tar).click(function () { $(".top_ten_stockholder .stock_more").hide() if ($('.top_ten_stockholder .top_ten_stockholder_li')) { for (i = 0; i < $('.top_ten_stockholder .top_ten_stockholder_li').length; i++) { $($('.top_ten_stockholder .top_ten_stockholder_li')[i]).show() } } }) }, }, news: { video_play: function (tar) { if (tar && tar.length != 0) { tar.each(function (i) { tar.eq(i).find("a").attr({ "href": 'javascript:;', "title": "杩欐槸瑙嗛锛岀偣鍑绘挱鏀? }); $(this).on("click", function () { var data = { title: tar.eq(i).attr("data-title"), m4v: tar.eq(i).attr("data-video-link"), poster: tar.eq(i).attr("data-poster"), }; var size = { width: 800, height: 450, cls: 'jp-video-800p' } RUN.videoListOpen(tar.eq(i), data, size, function () { var index = ((tar.attr("data-video-link")).indexOf("?")); var videoID = tar.attr("data-video-link").substring(index+5); pc.news.videoClick(videoID); }); }); }); } }, videoClick: function (videoID) { function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone","SymbianOS", "Windows Phone","iPad", "iPod"]; var flagPc = true; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flagPc = false; break; } } return flagPc; } var clientType = 1; if(!IsPC()){ clientType = 2 } $.ajax({type: "POST",url: "/rcms-external-rest/rm/addClick",data:{"siteId": "31","id": videoID,"type": 3,"clientType": clientType,"webHost":window.location.host},success:function(res){if(res.code === "S1A00000"){}}}) }, total_e_journal: function (tar) { $('.total_e_journal_num_span').each(function (i, item) { $(item).html($(tar).length) }) }, newsPage: function (tar) { if (tar && tar.length != 0) { var isIndex = window.location.href; if (tar.length > 5) { if (!(isIndex.indexOf("index_") != -1)) { for (let i = 5; i < 10; i++) { tar.eq(i).hide(); } $(".gf-page").hide(); $(".news-more").css("display","block"); $(".news-more").on("click", function () { $(".gf-page").show(); $(".news-more").css("display","none"); tar.show(); }); } else { $(".gf-page").show(); $(".news-more").hide(); } } else { } } } }, products: { products_swiper: function (tar, num) { if (tar == ".categories") { var quSwiper = new Swiper(tar + ' .swiper-container', { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: 'auto', // 濡傛灉闇€瑕佸垎椤靛櫒 preventClicksPropagation: false,//椤甸潰鍖哄煙闃绘click鍐掓场銆傛嫋鍔⊿wiper鏃堕樆姝lick浜嬩欢銆 normalizeSlideIndex: false, resizeObserver: true, watchOverflow: true, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 2, spaceBetween: 20, noSwiping: false, }, 750: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 3, spaceBetween: 20, noSwiping: false, }, 1025: { noSwiping: true, }, 1280: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?280 slidesPerView: 4, spaceBetween: 40, noSwiping: true, } }, pagination: { el: tar + ' .swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { return ''+(swiper.activeIndex*1+1)+'' + ' / ' + swiper.slides.length; } }, on: { init: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".products_body_categories_swiper .main-bot-prog-in").width(len+'%'); var i = 0; $(".swiper-cat-prev").addClass("swiper-disabled"); $(".swiper-cat-prev").on("click", function () { if (i > 0) { i--; $(".swiper-cat-next").removeClass("swiper-disabled"); quSwiper.slideTo(i); if (i == 0) { $(".swiper-cat-prev").addClass("swiper-disabled"); } } else { $(".swiper-cat-prev").addClass("swiper-disabled"); } }); $(".swiper-cat-next").on("click", function () { $(".swiper-cat-prev,.swiper-cat-next").removeClass("swiper-disabled"); var len = quSwiper.slides.length; if (quSwiper.activeIndex < len - 1) { i++; quSwiper.slideNext(); if (quSwiper.activeIndex >= (len - 1)) { $(".swiper-cat-next").addClass("swiper-disabled"); } } else { $(".swiper-cat-next").addClass("swiper-disabled"); } }); $(document).on("contextmenu",function(e){ return false; }); }, resize: function (swiper) { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".products_body_categories_swiper .main-bot-prog-in").width(len + '%'); }, slideChange: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; if (window.screen.width > 1025) { $(".products_body_categories_swiper .main-bot-prog-in").width(len + '%'); } else { if (quSwiper.isEnd) { $(".products_body_categories_swiper .main-bot-prog-in").width(100 + '%'); } else { $(".products_body_categories_swiper .main-bot-prog-in").width(len + '%'); } } }, } }) } else if (tar==".product_honors") { var swiperHonor = new Swiper(tar + ' .swiper-container', { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: num, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 24, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) autoHeight: true, //楂樺害闅忓唴瀹瑰彉鍖 // 濡傛灉闇€瑕佸垎椤靛櫒 preventClicksPropagation: false,//椤甸潰鍖哄煙闃绘click鍐掓场銆傛嫋鍔⊿wiper鏃堕樆姝lick浜嬩欢銆 pagination: { el: tar + ' .swiper-pagination', type: 'fraction', }, // 濡傛灉闇€瑕佸墠杩涘悗閫€鎸夐挳 navigation: { nextEl: tar + ' .swiper-button-next', prevEl: tar + ' .swiper-button-prev', }, on: { init: function () { if (this.slides.length == 0) { return; } if (this.slides[this.activeIndex].children.length > 3) { $('.product_honors .product_more').show(); for (let i = 3; i < this.slides[this.activeIndex].children.length; i++) { $(".product_honors .swiper-slide-active .slide_content_pic").eq(i).hide(); } this.update(); } else { $('.product_honors .product_more').hide() } if (tar == '.product_honors') { if ($(tar + ' li').length != $(tar + ' .swiper-slide').length) { let num = $(tar + ' li').length - $(tar + ' .swiper-slide').length let slide_str = '' for (var i = 0; i < num; i++) { slide_str += '
鏆傛棤
' } $(tar + ' .swiper-wrapper').append(slide_str) } } $("#pro_honor li").each(function (index) { $(this).on("click", function () { $("#pro_honor li").removeClass("active_honors"); $(this).addClass("active_honors"); swiperHonor.slideTo(index); }); }); }, slideChange: function () { var that = this; if (this.slides[this.activeIndex].children.length > 3) { for (let i = 3; i < this.slides[this.activeIndex].children.length; i++) { $(this.slides[this.activeIndex]).find(".slide_content_pic").eq(i).hide(); } $('.product_honors .product_more').show() } else { $('.product_honors .product_more').hide() } $(tar + ' li').eq(this.activeIndex).addClass('active_honors').siblings().removeClass('active_honors'); } } }); $('.product_honors .product_more').off().on("click", function () { $(".swiper-slide-active").find(".slide_content_pic").show(); swiperHonor.update(); $('.product_honors .product_more').hide(); }); } else if (tar == ".quality") { var quSwiper = new Swiper(tar + ' .swiper-container', { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: num, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 40, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) // 濡傛灉闇€瑕佸垎椤靛櫒 preventClicksPropagation: false,//椤甸潰鍖哄煙闃绘click鍐掓场銆傛嫋鍔⊿wiper鏃堕樆姝lick浜嬩欢銆 normalizeSlideIndex: false, resizeObserver: true, watchOverflow: true, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 1, spaceBetween: 20, noSwiping: false, }, 750: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 2, spaceBetween: 20, noSwiping: false, }, 1025: { noSwiping: true, }, 1280: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?280 slidesPerView: 4, spaceBetween: 40, noSwiping: true, } }, pagination: { el: tar + ' .swiper-pagination', type: 'custom', renderCustom: function (swiper, current, total) { return ''+(swiper.activeIndex*1+1)+'' + ' / ' + swiper.slides.length; } }, on: { init: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".products_body_quality_swiper .main-bot-prog-in").width(len+'%'); var i = 0; $(".swiper-qu-prev").addClass("swiper-disabled"); $(".swiper-qu-prev").on("click", function () { if (i > 0) { i--; $(".swiper-qu-next").removeClass("swiper-disabled"); quSwiper.slideTo(i); if (i == 0) { $(".swiper-qu-prev").addClass("swiper-disabled"); } } else { $(".swiper-qu-prev").addClass("swiper-disabled"); } }); $(".swiper-qu-next").on("click", function () { $(".swiper-qu-prev,.swiper-qu-next").removeClass("swiper-disabled"); var len = quSwiper.slides.length; if (quSwiper.activeIndex < len - 1) { i++; quSwiper.slideNext(); if (quSwiper.activeIndex >= (len - 1)) { $(".swiper-qu-next").addClass("swiper-disabled"); } } else { $(".swiper-qu-next").addClass("swiper-disabled"); } }); $(document).on("contextmenu",function(e){ return false; }); }, resize: function (swiper) { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; $(".products_body_quality_swiper .main-bot-prog-in").width(len + '%'); }, slideChange: function () { var total = this.slides.length; var len = ((this.activeIndex * 1 + 1) / total) * 100; if (window.screen.width > 1025) { $(".products_body_quality_swiper .main-bot-prog-in").width(len + '%'); } else { if (quSwiper.isEnd) { $(".products_body_quality_swiper .main-bot-prog-in").width(100 + '%'); } else { $(".products_body_quality_swiper .main-bot-prog-in").width(len + '%'); } } }, }, // 濡傛灉闇€瑕佸墠杩涘悗閫€鎸夐挳 // navigation: { // nextEl: tar + ' .swiper-button-next', // prevEl: tar + ' .swiper-button-prev', // } }); } else { new Swiper(tar + ' .swiper-container', { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: num, // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 24, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) // 濡傛灉闇€瑕佸垎椤靛櫒 preventClicksPropagation: false,//椤甸潰鍖哄煙闃绘click鍐掓场銆傛嫋鍔⊿wiper鏃堕樆姝lick浜嬩欢銆 pagination: { el: tar + ' .swiper-pagination', type: 'fraction', }, // 濡傛灉闇€瑕佸墠杩涘悗閫€鎸夐挳 navigation: { nextEl: tar + ' .swiper-button-next', prevEl: tar + ' .swiper-button-prev', } }); } }, products_desc_show: function (tar) { $(tar).each(function (i, j) { let clickflag = 0 $(j).click(function () { if (clickflag == 0) { clickflag = 1 $(this).find('.categories_more_inner').css({ 'transform': 'rotate(90deg) scale(1)', 'opacity': '1' }) $(this).off('mouseenter') $(this).off('mouseleave') $($(this).parent()[0]).next().slideDown('slow') } else if (clickflag == 1) { clickflag = 0 $(this).find('.categories_more_inner').removeClass('icon-a-chanpinfenleigengduoiconyixuan').css('transform', 'rotate(0deg)') $(this).mouseenter(function () { $(this).find('.categories_more_inner').css('transform', 'scale(1)') }) $(this).mouseleave(function () { $(this).find('.categories_more_inner').removeClass('icon-a-chanpinfenleigengduoiconyixuan').css({ 'transform': 'scale(0)' }) }) $($(this).parent()[0]).next().slideUp('slow') } }) }) }, products_detail_swiper: function (tar) { if (tar && tar.length != 0) { if ($("#pro-det-span") && $("#pro-det-span").length != 0) { if ($("#pro-det-span").attr("data-cont").indexOf("none")!=-1) { $("#pro-det-span").hide(); } } var arr = []; for (let i = 0; i < $(tar).length; i++) { $(tar).eq(i).addClass('swiper' + i); var swiper = new Swiper('.swiper' + i + ' .swiper-container', { // loop: true, // 寰幆妯″紡閫夐」 speed: 500, // 鍒囨崲閫熷害 direction: 'horizontal', // 姘村钩鍒囨崲閫夐」 slidesPerView: 'auto', // 璁剧疆slider瀹瑰櫒鑳藉鍚屾椂鏄剧ず鐨剆lides鏁伴噺(carousel妯″紡)銆?auto'鍒欒嚜鍔ㄦ牴鎹畇lides鐨勫搴︽潵璁惧畾鏁伴噺銆 spaceBetween: 10, // slide涔嬮棿璺濈(demo鐢ㄤ簬鍖哄垎slide, 瀹為檯寮€鍙戝彲鍒犻櫎) // 濡傛灉闇€瑕佸垎椤靛櫒 preventClicksPropagation: false,//椤甸潰鍖哄煙闃绘click鍐掓场銆傛嫋鍔⊿wiper鏃堕樆姝lick浜嬩欢銆 pagination: { el: '.swiper' + i + ' .swiper-pagination', type: 'fraction', }, on: { init: function () { arr[i] = this; }, slideChange: function () { $(".products_categories_detail_content_swiper_footer").eq(i).find(".products_categories_product_content_span").removeClass("active"); $(".products_categories_detail_content_swiper_footer").eq(i).find(".products_categories_product_content_span").eq(this.activeIndex).addClass("active"); } }, // 濡傛灉闇€瑕佸墠杩涘悗閫€鎸夐挳 navigation: { nextEl: '.swiper' + i + ' .swiper-button-next', prevEl: '.swiper' + i + ' .swiper-button-prev', }, }); $(".products_categories_detail_content_swiper_footer").eq(i).find(".products_categories_product_content_span").eq(0).addClass("active"); $(".products_categories_detail_content_swiper_footer").eq(i).find(".products_categories_product_content_span").each(function (index) { $(this).on("click", function () { $(".products_categories_detail_content_swiper_footer").eq(i).find(".products_categories_product_content_span").removeClass("active"); $(this).addClass("active"); arr[i].slideTo(index); }); }); } } }, changeTab: function () { if ($(".det-main") && $(".det-main").length!= 0) { $(".tabs-href").eq(0).addClass("tabs-href-sel"); $(".det-main-in").eq(0).addClass("det-show"); pc.products.products_detail_swiper('.det-show .products_categories_detail_content_swiper') $(".tabs-href").each(function (index) { $(this).on("click", function () { $(".tabs-href").removeClass("tabs-href-sel"); $(this).addClass("tabs-href-sel"); $(".det-main-in").removeClass("det-show"); $(".det-main-in").eq(index).addClass("det-show"); pc.products.products_detail_swiper('.det-show .products_categories_detail_content_swiper') }); }); } else { pc.products.products_detail_swiper('.products_categories_detail_content_swiper') } }, product_description: function (tar) { $(tar).click(function () { $('.products_categories_product_mask').toggle() }) }, products_categories_more: function (tar) { $(tar).each(function (i, j) { let clickflag = 0 $(j).click(function () { if (clickflag == 0) { clickflag = 1 $(this).addClass('active') $(this).parent().parent().addClass("products_categories_name_check"); } else if (clickflag == 1) { clickflag = 0 $(this).removeClass('active'); $(this).parent().parent().removeClass("products_categories_name_check"); } }) }) } }, netmarketing: { search_mask_show: function (tar) { $(tar).click(function () { $('.netmarketing_map_mode_search_mask').toggle() }) } }, pub: { sub_menu_show: function (tar) { if (tar && tar.length != 0) { tar.each(function (index) { $(this).on("mouseover", function (e) { $(".header_nav_menu_bar_mask").hide() $(this).find(".header_nav_menu_bar_mask").show(); $(this).find(".header_nav_menu_bar_mask").mouseleave(function () { $(".header_nav_menu_bar_mask").hide(); }); }); }); $(".nav_tools").on("mouseover", function (e) { $(".header_nav_menu_bar_mask").hide(); }); } }, position_fixed_init: function (tar) { if ($('.service_body').length || $('.products_body').length || $('.about_body').length||$(".investment_body")) { var title_text = $('.other_banner_text_zh').html() var title_str = ''+ title_text +'' var right_fixed_nav_str = '' $(tar).each(function (i, j) { $(j).attr('id', 'id' + i) right_fixed_nav_str += ''+ $(j).html() +'' }) if ($('.service_processes').length) { let right_nav_width = $('.position_fixed').width() let inner_width = $('.inner').width() let right_nav_transx = inner_width / 2 - right_nav_width $('.position_fixed').css({ 'width': 'unset', 'left': '50%', 'right': 'unset', 'transform': 'translateX(' + right_nav_transx + 'px)' }) $('.position_fixed_div').html(right_fixed_nav_str) } else { $('.position_fixed_div').html(title_str + right_fixed_nav_str) } $(".position_fixed_div a").each(function (index) { $(this).on("click", function () { $('html, body').animate({ scrollTop: $('#' + $(this).attr("data-id")).offset().top - 140 }, 500); }); }); } }, position_fixed: function (tar) { $(tar).on('click', function () { $(this).addClass('active').siblings().removeClass('active') if (!$('.header_nav_menu_bar_mask:visible').length) { $('.index_header').css('transform', 'translateY(-42px)') } }) }, footer_move_logo: function (tar) { if (tar && tar.length != 0) { var deg = 0, xPos, yPos; $(".footer").mouseenter(function () { $(".footer_move_logo").css({ width: 400, height:400 }); }); $(".footer").mousemove(function (e) { var allHeight = $(document).height(); var scrollHeight = $(document).scrollTop(); var newmain = allHeight - scrollHeight - window.screen.height; xPos = e.clientX-200+'px'; yPos =(e.clientY-newmain)/2 -200 + 'px'; var pie = $("body").width()/360; deg = (e.clientX / pie)*2; $(".footer_move_logo").css({ transform: "translate3d("+xPos+", "+yPos+", 0) rotate("+deg+"deg)", }); }); var timber = setInterval(function () { deg += 1; $(".footer_move_logo").css({ transform: "translate3d("+xPos+", "+yPos+", 0) rotate("+deg+"deg)", }); }, 20); $(".footer").mouseleave(function () { $(".footer_move_logo").css({ width: 0, height: 0, transform: "translate3d("+-400+", "+0+", 0) rotate("+0+"deg)", }); }); } }, winload: function () { var scrollTop = $(window).scrollTop(); if (scrollTop) { $('.index_header').addClass('index_header_hover') } function isInViewPortOfOne(el) { // viewPortHeight 鍏煎鎵€鏈夋祻瑙堝櫒鍐欐硶 const viewPortHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight var el = document.querySelector(el) var el_height = el.getBoundingClientRect().height / 2 const offsetTop = $(el).offset().top + el_height const top = offsetTop - scrollTop if (-el_height < top && top < viewPortHeight) { return true } else { return false } } window.onload = function () { var scrollTop = $(window).scrollTop(); let right_navArr = [] if (scrollTop) { $('.index_header').addClass('index_header_hover') } if (scrollTop) { $('.index_header').off('mouseleave') } if ($('.position_fixed').length && scrollTop) { pc.pub.position_fixed($('.position_fixed a')) $('.inner>.title').each(function (i, j) { var id = $(j).attr("id") if (isInViewPortOfOne(`#${id}`)) { right_navArr.push(i) $('.position_fixed_div a ').eq(right_navArr[0]).addClass('active').siblings().removeClass('active') } else { $('.position_fixed_div a ').eq($('.inner>.title').length - 1).addClass('active').siblings().removeClass('active') } }) } else { $('.position_fixed_div a ').eq(0).addClass('active').siblings().removeClass('active') } if ($('.header_nav_menu_bar_mask:visible').length) { $('.index_header').addClass('index_header_hover') } } }, scrollDiy: function (tar) { if (tar && tar.length != 0) { tar.mCustomScrollbar({ setTop: 0 , scrollButtons: { enable: false } }); } }, hasFile: function (tar) { if (tar && tar.length != 0) { var dns = $(".footer-main").attr("data-dns"); tar.on("click", function () { if ($(this).attr("data-href") != "") { window.open(dns+'/pdfjsold/index.html?file='+''+$(this).attr("data-href")); } }); } } }, fuwu: { ideaSwiper: function (tar) { if (tar && tar.length != 0) { var mySwiper = new Swiper (tar, { // 濡傛灉闇€瑕佸垎椤靛櫒 spaceBetween: 40, slidesPerView:'auto', pagination: { el: '.swiper-pagination', type:'progressbar' } }) } } } } pc.index.nav('.index_header') pc.index.videoPlay($('.right_video .mask')) pc.index.index_search($(".hr-search-href")) pc.index.index_banner_relation('.index_banner_relation') pc.index.index_banner_swiper('.index_banner .swiper-container') pc.index.index_window_scroll(window) pc.index.index_scroll('.scroll') pc.index.index_products_swiper('.swiper_products .swiper-container') pc.index.index_shop_map('.index_netmarketing_swiper li') pc.index.index_back_top('.back_to_top_pic') pc.index.index_service('.service_list ul li'); pc.about.vision_swiper('#vision .swiper-container'); pc.about.sub_swiper('.swiper-sub-swiper'); pc.about.res_swiper('.swiper-res-swiper'); pc.about.honorFun($('.about-honor')) pc.about.process_year('.index_processes_year_li') pc.investment.director_swiper('.corporate_governance_swiper') pc.investment.investment_more_show('.capital_stock_content .stock_more', 6) pc.investment.investment_more_show('.information_disclosure .stock_more', 7) pc.products.products_desc_show('.categories_more') pc.products.products_swiper('.categories',4) pc.products.products_swiper('.quality',4) pc.products.products_swiper('.product_honors',1) pc.products.changeTab() pc.products.products_detail_swiper('.products_categories_product_swiper') pc.products.product_description('.products_categories_product_description') pc.products.product_description('.products_categories_product_mask_close_btn') pc.products.products_categories_more('.products_categories_more_span') pc.news.video_play($('.news_video_li')) pc.news.total_e_journal('.news_e_journal_li'); pc.news.newsPage($('.news_list .news_item_pic')); pc.news.newsPage($('.news_tender_list .news_item_pic')); pc.netmarketing.search_mask_show('.search_ways_mask_close_span ') pc.pub.sub_menu_show($('.index_nav li')) pc.pub.position_fixed_init($('.inner>.title')) pc.pub.position_fixed($('.position_fixed_div a ')) pc.pub.footer_move_logo($('.footer_move_logo')) pc.pub.winload(); pc.pub.scrollDiy($(".event_desc,.yx-guo-bot,.yx-cond")); pc.pub.hasFile($(".info-hasfile")); pc.fuwu.ideaSwiper($(".idea-swiper")); /* touchstart */ $(".index-body").on("touchstart", function (e) { startX = e.originalEvent.changedTouches[0].pageX, startY = e.originalEvent.changedTouches[0].pageY; }) $(this).on("touchend", function (e) { moveEndX = e.originalEvent.changedTouches[0].pageX, moveEndY = e.originalEvent.changedTouches[0].pageY, X = moveEndX - startX, Y = moveEndY - startY; if (Y > 0) { if ($(".scroll").scrollTop() <= 0) { $(".index-body .index_header").removeClass("index_header_hover").css({ "transform": "translateY(0px)" }); $(".scroll").removeClass("scrollact_1"); } } else if (Y < -100) { $(".index-body .index_header").addClass("index_header_hover").css({ "transform": "translateY(-40px)" }); $(".scroll").addClass("scrollact_1"); } else { } }) /* touchstart end */ })