$(function () { createBackCircle($('.circle-nosquare-animated')) createDeseCircle($('.dese-concact')) seeMoreBtn() headerScroll() $(document).scroll(function () { // tagAutoPlay('.challanges') animeCircle($('.circle-nosquare-animated')) animeDeseCircle($('.dese-concact')) }) }) // 鍒ゆ柇椤甸潰鏄惁鍒颁簡闇€瑕佹樉绀哄浘鐗囩殑浣嶇疆骞惰祴鍊 function loadlazy(){ var itv = setTimeout(function(){ var winHeight = $(window).height(); var scrolltop = $(window).scrollTop(); $('img').each(function(){ var oTop = $(this).offset().top; if((oTop-scrolltop) >= 0 && (oTop-scrolltop) ul > li') .mouseenter(function () { $(this).find('.nav-li-active').css('width', '3.5rem') $(this).siblings().find('.nav-li-active').css('width', '0') $(`.hd-nav:eq(${$(this).index()})`) .stop() .slideDown({ start: function () { $(this).css({ display: 'flex' }) }, }) }) .mouseleave(function () { $(this).find('.nav-li-active').css('width', '0') $(`.hd-nav:eq(${$(this).index()})`) .stop() .slideUp() }) $('.nav-wrap > ul > li > a').css('color', '#fff') $('.header').css('background', 'transparent') $('.search-logo').addClass('search-logo-new') $(window).scroll(function () { var offsetTop = $('.header').offset().top if (offsetTop === 0) { $('.header').mouseleave(function () { headerTransparent() }) headerTransparent() } else if (offsetTop > 0) { $('.header').mouseleave(function () { headerWhite() }) headerWhite() } }) } function headerTransparent() { $('.logo').removeClass('logo-new') $('.nav-wrap > ul > li > a').css('color', '#fff') $('.search-logo').addClass('search-logo-new') $('.header').css('background', 'transparent') $('.header').removeClass('headerShadow') } function headerWhite() { $('.logo').addClass('logo-new') $('.nav-wrap > ul > li > a').css('color', '#090F21') $('.search-logo').removeClass('search-logo-new') $('.header').css('background', '#fff') $('.header').addClass('headerShadow') } // 婊氬姩鑳屾櫙 //鍒涘缓鏋舵瀯鑳屾櫙鍥剧墖锛?涓渾 鏃犳柟鍧楋級 function createBackCircle(className) { $('
').appendTo(className) $('
').appendTo(className) $('
').appendTo(className) } //鏋舵瀯閮ㄥ垎鑳屾櫙鍥剧墖婊氬姩鐗规晥 function animeCircle(className) { if ($(className).length == 0) { return } var scrollValue = ($(window).height() + $(document).scrollTop() - $(className).offset().top) / 2 if (scrollValue > 120 && scrollValue < 700) { anime({ targets: '.item-bg1', translateY: -scrollValue / 2 + 100, translateX: scrollValue + 300, loop: false, duration: 300, easing: 'linear', }) anime({ targets: '.item-bg2', translateY: -scrollValue + 70, translateX: 300 - scrollValue, loop: false, duration: 300, easing: 'linear', }) anime({ targets: '.item-bg3', translateY: scrollValue - 60, translateX: -scrollValue - 30, loop: false, duration: 300, easing: 'linear', }) } } //鏌ョ湅鏇村鎸夐挳锛堝姩鎬佸渾鏁堟灉锛 function seeMoreBtn() { $('.more-white-see,.more-black-see') .on('mouseenter', function (e) { var parentOffset = $(this).offset(), relX = e.pageX - parentOffset.left, relY = e.pageY - parentOffset.top $(this).find('.more-see-bg').css({ top: relY, left: relX, }) }) .on('mouseout', function (e) { var parentOffset = $(this).offset(), relX = e.pageX - parentOffset.left, relY = e.pageY - parentOffset.top $(this).find('.more-see-bg').css({ top: relY, left: relX, }) }) } //鍒涘缓灏忓緱鐟熷挩璇㈣儗鏅渾鍥剧墖锛?涓渾 鏃犳柟鍧楋級 function createDeseCircle(className) { $('
').appendTo(className) $('
').appendTo(className) $('
').appendTo(className) } //灏忓緱鐟熷挩璇㈤儴鍒嗚儗鏅浘鐗囨粴鍔ㄧ壒鏁 function animeDeseCircle(className) { if ($(className).length == 0) { return } var scrollValue = ($(window).height() + $(document).scrollTop() - $(className).offset().top) / 3 if (scrollValue > 0 && scrollValue < 120) { anime({ targets: '.dese-bg1', translateY: scrollValue / 2, translateX: scrollValue + 30, loop: false, duration: 300, easing: 'linear', }) anime({ targets: '.dese-bg2', translateY: -scrollValue / 3 + 70, translateX: scrollValue - 70, loop: false, duration: 300, easing: 'linear', }) anime({ targets: '.dese-bg3', translateY: scrollValue / 5 - 5, translateX: -scrollValue - 90, loop: false, duration: 300, easing: 'linear', }) } } // renderIcon 閮ㄥ垎hover涓婄Щ10px function moveRenderIconUp(box, iconBox, type) { // hover涓婄Щ20px if (type === 'renderIcon') { $(box) .mouseenter(function () { $(this).find(iconBox).css('transform', 'translateY(-.625rem)') }) .mouseleave(function () { $(this).find(iconBox).css('transform', 'translateY(0rem)') }) } else if (type === 'product') { // 鑷富浜у搧妯″潡hover $(box) .mouseenter(function () { $(this).siblings(iconBox).css('transform', 'translateY(-.625rem)') }) .mouseleave(function () { $(this).siblings(iconBox).css('transform', 'translateY(0rem)') }) } else if (type === 'aps-tips') { //鏅鸿兘鍒堕€ aps妯″潡hover $(box) .mouseenter(function () { $(this) .parent() .parent() .siblings(iconBox) .css('transform', 'translateY(-.625rem)') }) .mouseleave(function () { $(this) .parent() .parent() .siblings(iconBox) .css('transform', 'translateY(0rem)') }) } } //娓叉煋涓や釜鏂规 swiper-slide鍐呭 function renderTwoboxSlide(list, boxDom) { list.forEach((item) => { const slideHtmlFont = `
` const slideHtmlEnd = `
${item.title1} MORE
${item.subTitle1}${ item.blueSubTitle1 ? `${item.blueSubTitle1}${item.backSubTitle1}` : `` }
${item.description1}
${item.title2} MORE
${item.subTitle2}${ item.blueSubTitle2 ? `${item.blueSubTitle2}${item.backSubTitle2}` : `` }
${item.description2}
` if (item.imgUrl3) { $( slideHtmlFont + `
` + slideHtmlEnd ).appendTo(boxDom) } else { $(slideHtmlFont + slideHtmlEnd).appendTo(boxDom) } }) } //娓叉煋鍦嗘 甯︽粦鍔 杩涘害鏉″垎椤靛櫒锛?涓級 function renderDigitalSwiper(dom, spaceBetween, loop, delay, slidesPerView) { var rootSizeScale = parseFloat($('html').css('font-size')) / 16 var spaceB = spaceBetween * rootSizeScale if (delay) { delay = { disableOnInteraction: false, delay: delay, } } var mouseSwiper = new Swiper(dom, { slidesPerView: slidesPerView, loop: loop, pagination: { el: `${dom} .swiper-pagination`, clickable: true, bulletElement: 'li', }, spaceBetween: spaceB, autoplay: delay, navigation: { nextEl: `${dom} .swiper-button-next`, prevEl: `${dom} .swiper-button-prev`, }, observer: true, //淇敼swiper鑷繁鎴栧瓙鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper observeParents: true, //淇敼swiper鐨勭埗鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper }) for (i = 0; i < mouseSwiper.pagination.bullets.length; i++) { mouseSwiper.pagination.bullets[i].onmouseover = function () { this.click() } } $(`${dom} .swiper-slide`).mouseenter(function () { mouseSwiper.autoplay.stop() }) $(`${dom} .swiper-slide`).mouseleave(function () { mouseSwiper.autoplay.start() }) $(`${dom} .swiper-button`) .mouseenter(function () { $(this).addClass(`swiper-button-white`) }) .mouseleave(function () { $(this).removeClass(`swiper-button-white`) }) return mouseSwiper } // 灞曠ずtag 瀵瑰簲鍧楀唴瀹 function showChallangeTag(dom, orderList, Index, imgBool) { $(`${dom} .challange-tags .challange-tag:eq(${orderList[Index]})`).addClass( 'challange-tag-active' ) $(`${dom} .challange-tags .challange-tag:eq(${orderList[Index]})`) .siblings() .removeClass('challange-tag-active') $(`${dom} .content-right:eq(${orderList[Index]})`).show() $(`${dom} .content-right:eq(${orderList[Index]})`).siblings().hide() if (imgBool) { $(`${dom} .img-tag-show:eq(${orderList[Index]})`).show() $(`${dom} .img-tag-show:eq(${orderList[Index]})`).siblings().hide() } } // 婊氬姩鍒板搴斾綅缃紑濮嬭嚜鍔ㄦ挱鏀 //鏄惁姝e湪鏈塩hallengeTag瀹氭椂鍣ㄨ繘琛 var challangeBool=false; function challangeTag(dom, index, imgBool, orderList) { var domHeight = 0 if ($(`${dom}`).parents('.card-new').length === 0) { domHeight = $(`${dom}`).height() } else { domHeight = $(`${dom}`).parents('.card-new').height() } // let scrollNum=0 // if (dom.indexOf('case') === -1){ // scrollNum=domHeight/2 // }else{ // dom.indexOf('case-log') === -1 ? (scrollNum = window.innerHeight-214) : (scrollNum = window.innerHeight-80) // } // $(document).scroll(function(){ // console.log(($(`${dom}`).offset().top - $(document).scrollTop()),scrollNum) // }) showChallangeTag(dom, orderList, 0, imgBool) $(`${dom} .challange-tags .challange-tag`) .mouseenter(function () { showChallangeTag(dom, orderList.sort(), $(this).index(), imgBool) }) var stop = true function autoplayFlag() { if ( // $(`${dom}`).css('display') !== 'none' && $(`${dom}`).offset().top - $(document).scrollTop() < domHeight / 2 && $(`${dom}`).offset().top - $(document).scrollTop() > -domHeight ) { if (stop) { tagAutoPlay(dom, index, imgBool, orderList, false) } stop = false } else { if (!stop) { tagAutoPlay(dom, index, imgBool, orderList, true) } stop = true } } autoplayFlag() $(document).scroll(function () { autoplayFlag() }) } var timerList = {} var DomNameing='' //鑷姩鎾斁鍒囨崲tag +鍙充晶鍐呭 function tagAutoPlay(dom, index, imgBool, orderList, stop) { if (DomNameing!== dom) { clearInterval(timerList[DomNameing]) intervalEnd() DomNameing = dom } // 鑷姩鎾斁鍒囨崲tag鍏ㄥ眬鍙橀噺 tagIndex var tagIndex = 0 function IntroInterval() { if (tagIndex < index - 1 && $(`${dom}`).css('display') !== 'none') { tagIndex++ } else { tagIndex = 0 } showChallangeTag(dom, orderList, tagIndex, imgBool) } function intervalStart() { console.log('寮€濮?) challangeBool=true timerList[dom] = setInterval(IntroInterval, 3000) } function intervalEnd() { console.log('缁撴潫') clearInterval(timerList[dom]) challangeBool=false } if (!stop) { if (!challangeBool){ intervalStart() } } else { intervalEnd() } // // //榧犳爣绉诲叆tag 缁撴潫鑷姩鎾斁 $(`${dom} .challange-tags .challange-tag`) .mouseenter(function () { $(this).addClass('challange-tag-active') $(this).siblings().removeClass('challange-tag-active') intervalEnd() $(`${dom} .content-right:eq(${$(this).index()})`).show() $(`${dom} .content-right:eq(${$(this).index()})`) .siblings() .hide() if (imgBool) { $(`${dom} .img-tag-show:eq(${$(this).index()})`).show() $(`${dom} .img-tag-show:eq(${$(this).index()})`) .siblings() .hide() } }) .mouseleave(function () { if (!challangeBool) { intervalStart() } }) // // //榧犳爣绉诲叆鍙充晶鍐呭 涓嶈疆鎾 $(`${dom} .content-right`) .mouseenter(function () { intervalEnd(); if ($(this).parents('.case-content-df').index()===0&&$(this).find('.qingdao-video-play')){ var casePlay = $(this).find('.qingdao-video-play') }else if ($(this).parents('.case-content-df').index()===1&&$(this).find('.guangming-video-play')) { var casePlay = $(this).find('.guangming-video-play') } if ( $(`${dom}`).parents('#market').length !== 0 && ($(`${dom}`).index() === 0 || $(`${dom}`).index() === 1) ) { caseVideoPaly(casePlay) } }) .mouseleave(function () { if (!challangeBool) { intervalStart() } }) } //case 妗堜緥閲岀殑瑙嗛鎾斁 function caseVideoPaly(casePlay) { casePlay.siblings('.product-img-mask') .find('.mask-cover') .mouseenter(function () { $(this).css('opacity', '0') }) .mouseleave(function () { $(this).css('opacity', '0.5') }) casePlay .mouseenter(function () { $(this) .siblings('.product-img-mask') .find('.mask-cover') .css('opacity', '0') }) .mouseleave(function () { $(this) .siblings('.product-img-mask') .find('.mask-cover') .css('opacity', '0.5') }) .click(function () { if ($(this).attr('class') === 'qingdao-video-play') { $(this) .siblings('.product-img-mask') .find('.mask-cover') .css('display', 'none') videoplayCase('qingdao-video', '.qingdao-video-play') } else if ($(this).attr('class') === 'guangming-video-play') { $(this) .siblings('.product-img-mask') .find('.mask-cover') .css('display', 'none') videoplayCase('guangming-video', '.guangming-video-play') } }) } //瑙嗛鎾斁 function videoplayCase(dom, that) { let ele = document.getElementById(dom) ele.load() ele.controls = true //鏄剧ず鎺т欢 ele.play() ele.autoplay = true //鍔犺浇瀹屾瘯鍚庤嚜鍔ㄦ挱鏀 $(that).hide() //鎾斁鏃舵殏鍋滆疆鎾 let playPromise = ele.play() if (playPromise !== undefined) { playPromise .then(() => { ele.play() }) .catch(() => {}) } ele.onplay = function () { //鎾斁鏃跺叾浠栫殑鎾斁鍣ㄥ叧闂 for (let i = 0; i < document.querySelectorAll('video').length; i++) { if (document.querySelectorAll('video')[i] !== ele) { document.querySelectorAll('video')[i].pause() } } setTimeout(() => {}, 0) } } //浜у搧浠峰€ 鍦嗗湀鍥剧墖鍒囨崲 var ValtimerIntro = {} // 鑷姩鎾斁鍒囨崲tag鍏ㄥ眬鍙橀噺 tagIndex var valueIndex=0 //鏄惁姝e湪鏈夊畾鏃跺櫒杩涜 var valueTagBool=false function valueTag(dom, index) { if(!valueTagBool){ valueTagBool=true; ValtimerIntro[dom] = setInterval(IntroInterval, 3000) } function IntroInterval() { if (valueIndex < index - 1) { valueIndex++ } else { valueIndex = 0 } $(`${dom} .value-tag-index .value-tag-name:eq(${valueIndex})`).addClass( 'value-tag-name-active' ) $(`${dom} .value-tag-index .value-tag-name:eq(${valueIndex})`) .siblings() .removeClass('value-tag-name-active') $(`${dom} .value-content:eq(${valueIndex})`).show() $(`${dom} .value-content:eq(${valueIndex})`).siblings().hide() valueTagBool=true } $(`${dom} .value-tag-index .value-tag-name`) .mouseenter(function () { $(this).addClass('value-tag-name-active') $(this).siblings().removeClass('value-tag-name-active') valueTagBool=false clearInterval(ValtimerIntro[dom]) $(`${dom} .value-content:eq(${$(this).index()})`).show() $(`${dom} .value-content:eq(${$(this).index()})`) .siblings() .hide() }) .mouseleave(function () { if (!valueTagBool) { valueTagBool = true ValtimerIntro[dom] = setInterval(IntroInterval, 3000) } }) } //para鍐呭祵寰幆 function paraForeach(paraItem, templateType) { var HtmlPara = '' paraItem.forEach((para, i) => { var template = '' if (templateType === 'subsidiaryBoxTag') { //blue-tag template = `
${para}
` }else if (templateType === 'subsidiaryBoxFlex') { // subsidiaryBoxFlex template = `
${para.tit}
${para.p}
` } else if (templateType === 'listicon') { //浜у搧绾 if (para.txt) { template = `
${para.txt}
` } else if (para.empty) { template = `
` } else { template = `` } } else if (templateType === 'apsSubTitle') { //APS 浜岀骇鏍囬鍐呭 if (para.first) { template = `
${para.first}
${para.second}
` } else { template = `
${para.beforeBlue}${para.second}${para.blue}
` } } else if (templateType === 'apsTabs') { //APS tabs if (i === 0) { template = `
${para}
` } else { template = `
${para}
` } } else if (templateType === 'introPara') { //姒傝 涓氬姟鐥涚偣 template = `

${para}

` } else if (templateType === 'solutionPara') { //姒傝 瑙e喅鏂规 template = `

${para.bold}${para.txt}

` } else if (templateType === 'backSub') { //瀹㈡埛妗堜緥 涓氬姟鑳屾櫙浜岀骇鍦嗘 template = `
${para}
` } else if (templateType === 'backContent') { //瀹㈡埛妗堜緥 涓氬姟鑳屾櫙鍐呭para if (Object.prototype.toString.call(para) === '[object Object]') { template = `

${para.bold}
${para.txt}

` } else [ (template = `

${para}

`), ] } else if (templateType === 'fanganContent') { //瀹㈡埛妗堜緥 鏂规01before para if (Object.prototype.toString.call(para) === '[object Object]') { //瀹㈡埛妗堜緥 鏂规01before para 鍔犵矖title template = `
${para.bold}

${para.txt}

` } else { template = `

${para}

` } } else if (templateType === 'valueContent') { //瀹㈡埛妗堜緥 value para鍓嶅皬鍦嗗湀 if (Object.prototype.toString.call(para) === '[object Object]') { template = `

${para.bold}${para.txt}

` } else { template = `

${para}

` } } else if (templateType === 'valueNum') { if (para.beforeTxt) { template = `
${para.beforeTxt}${para.num}${para.minnum}
${para.txt}
` } else { template = `
${para.num}${para.minnum}
${para.txt}
` } } HtmlPara = HtmlPara + template }) return HtmlPara } //娓叉煋 瀹㈡埛妗堜緥 鍐呭 4涓猼ab function renderCaseSlide(list, boxDom) { list.forEach((item) => { var HtmljianjieImg = '' if (item.jianjieImg.type === 'img') { const ImgSingle = ` ` HtmljianjieImg = ImgSingle } else { const ImgSingle = `
` HtmljianjieImg = ImgSingle } const HtmlFont = `