//璁剧疆椤甸潰鏄剧ず var sHeight = 0; var isChangeViewPort = false; var isAboutUs=false; function setViewport() { $(window).resize(function() { viewPortResize(); }); viewPortResize(); } function viewPortResize() { sHeight = $(window).height(); if (isChangeViewPort) { return; } isChangeViewPort = true; $("#viewportDom").attr("content", "width=device-width"); var width = $(window).width(); if (width > 1024) { $("#viewportDom").attr("content", "width=device-width,user-scalable=no"); $("#global-nav .nav").show(); $("#global-nav .menubg").hide(); } else { //console.log(width); $("#viewportDom").attr("content", "width=750,user-scalable=no"); // $("#global-nav .menubg,#global-nav .nav").hide(); $("#global-nav .menu").removeClass("close"); } setTimeout(function() { isChangeViewPort = false; }, 100) } //璁剧疆瀵艰埅 function setNavFn(isHome) { if (!isHome) { $("#global-nav").addClass("on"); } $(window).scroll(function() { $("#commhover").remove(); var scrollTop = $(window).scrollTop(); if (isHome) { //棣栭〉瀵艰埅鏁堟灉 if (scrollTop >= 960 - 100) { $("#global-nav").addClass("on"); } else { $("#global-nav").removeClass("on"); } } if (isHome || isAboutUs) { //棣栭〉鏍稿績浼樺娍鏁板瓧鏁堟灉 if(isAboutUs){ var theSwfNumlist = $("#aboutIntro .center .left .statistics .num .code"); }else{ var theSwfNumlist = $("#indexHxys .right .defaultPart .item .code"); } for (var i = 0; i < theSwfNumlist.length; i++) { if (theSwfNumlist[i].className.indexOf("noswf") > -1) { if ($(theSwfNumlist[i]).offset().top <= sHeight + scrollTop) { $(theSwfNumlist[i]).removeClass("noswf"); shownumswf(theSwfNumlist[i]); } } else { if ($(theSwfNumlist[i]).offset().top > sHeight + scrollTop) { $(theSwfNumlist[i]).addClass("noswf"); $(theSwfNumlist[i]).attr("cur", "0"); } } } } }) //鎵嬫満鐗堢洰褰 $("#global-nav .menu").click(function() { if (this.className.indexOf("close") > -1) { $("#global-nav .menu").removeClass("close"); $("#global-nav .menubg,#global-nav .nav").hide(); } else { $("#global-nav .menu").addClass("close"); $("#global-nav .menubg,#global-nav .nav").show(); } }) $("#global-nav .menubg").click(function() { return; $("#global-nav .menu").removeClass("close"); $("#global-nav .menubg,#global-nav .nav").hide(); }) } //鏁板瓧瀹氭椂鍙樺寲 function shownumswf(theObj) { var obj=$(theObj); var max=obj.attr("maxnum"); var step=parseInt(max/50);//涔熷彲浠ュ睘鎬ч噷闈㈣嚜瀹氫箟step var num=0; var timmer=setInterval(function () { num+=step+1; obj.text(num) if(num>=max) { obj.text(max) clearInterval(timmer); } },100) return; var cur = parseFloat($(theObj).attr("cur")); var max = parseFloat($(theObj).attr("maxnum")); if (cur < max) { // cur += (max / 10); cur += 1; }else{ // cur=max; } $(theObj).attr("cur", cur); $(theObj).html(Math.floor(cur)); if (cur < max) { setTimeout(() => { shownumswf(theObj); }, 30) } } //棣栭〉璧勮川杞挱鍥 function indexAptitudeSwiper() { new Swiper(".aptitudeSwiper .swiper", { autoplay:true, slidesPerView: "auto", spaceBetween: 35, navigation: { nextEl: ".aptitudeSwiper .swiperbuttonnext", prevEl: ".aptitudeSwiper .swiperbuttonprev", }, breakpoints: { 320: { slidesPerView: 1, spaceBetween: 0, }, 1025: { slidesPerView: "auto", spaceBetween: 35, } } }); } //棣栭〉鐐瑰嚮鏍稿績浼樺娍 function clickHxys() { $("#indexHxys .left .list .item").hover(function() { $("#indexHxys .left .list .item").removeClass("on"); var templist = $("#indexHxys .left .list .item"); for (var i = 0; i < templist.length; i++) { $(templist[i]).find("img").attr("src", $(templist[i]).attr("srca")); } $(this).addClass("on"); $(this).find("img").attr("src", $(this).attr("srcb")); $("#indexHxys .right .oneGroupPart").css("background-image", "url(" + $(this).attr("bg") + ")"); var txtList = $(this).attr("txts").split("|"); var thehtml = ""; for (var i = 0; i < txtList.length; i++) { thehtml += "
" + txtList[i] + "
"; } $("#indexHxys .right .oneGroupPart").html(thehtml); $("#indexHxys .right .oneGroupPart").addClass("show"); }, function() { $(this).find("img").attr("src", $(this).attr("srca")); $("#indexHxys .left .list .item").removeClass("on"); $("#indexHxys .right .oneGroupPart").css("background-image", "url()"); $("#indexHxys .right .oneGroupPart").html(''); $("#indexHxys .right .oneGroupPart").removeClass("show"); }) } //棣栭〉妗堜緥绫诲埆杞挱 var caseSortSwiperObj = null; function caseSortSwiper() { //PC var itemlist = $("#indexCase .pictabs .item"); var theW = 0; for (var i = 0; i < itemlist.length; i++) { theW += $(itemlist[i]).width() + 72; console.log($(itemlist[i]).width() + 72); } $("#indexCase .pictabs .swiper .swiper-slide").css({ width: theW + "px" }); new Swiper("#indexCase .pictabs .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: { //el: "#indexCase .pictabs .swiper-scrollbar", }, mousewheel: true, }); $("#indexCase .pictabs .item").click(function() { var index = $(this).index(); $("#indexCase .pictabs .item").removeClass("on"); $(this).addClass("on"); $("#indexCase .pcList .list").hide(); $($("#indexCase .pcList .list").get(index)).show(); }) //鎵嬫満 caseSortSwiperObj = new Swiper("#indexCase .phonetabs .swiper", { spaceBetween: 35, navigation: { nextEl: "#indexCase .phonetabs .swiperbuttonnext", prevEl: "#indexCase .phonetabs .swiperbuttonprev", }, on: { slideChangeTransitionEnd: function() { var index = this.realIndex; $("#indexCase .phoneList .list").hide(); $($("#indexCase .phoneList .list").get(index)).show(); }, } }); $("#indexCase .phoneList .list").hide(); $($("#indexCase .phoneList .list").get(0)).show(); } //棣栭〉妗堜緥杞挱鍥 function casePhoneSwiper(num) { var swiper = new Swiper("#casePhoneSwiper" + num, { pagination: { el: "#casePhoneSwiper" + num + " .swiper-pagination", }, }); } //棣栭〉鏂伴椈杞挱鍥 function newsSwiper() { $("#indexNews .phoneList").html($("#indexNews .pcList .swiper-wrapper").html()); new Swiper("#indexNews .pcList .swiper", { slidesPerView: 'auto', spaceBetween: 25, navigation: { nextEl: "#indexNews .pcList .swiperbuttonnext", prevEl: "#indexNews .pcList .swiperbuttonprev", } }); } //璁剧疆鐖嗙牬鐩殑 function setBlowupPurpose(isBz) { if (isBz) { $("#thePurpose .phoneList").html($("#thePurpose .swiper-slide").html()); var itemlist = $("#thePurpose .swiper-slide .item") $("#thePurpose .swiper-slide").css({ width: Math.floor(itemlist.length * (427 + 38) - 38) + "px" }); new Swiper("#thePurpose .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: {}, mousewheel: true }); } else { $("#thePurpose2 .phoneList").html($("#thePurpose2 .swiper-slide").html()); var itemlist = $("#thePurpose2 .swiper-slide .item") $("#thePurpose2 .swiper-slide").css({ width: Math.floor(itemlist.length * (245 + 34) - 34) + "px" }); new Swiper("#thePurpose2 .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: {}, mousewheel: true }); } } //璁剧疆鐖嗙牬绯荤粺浼樺娍 function setSuperiorityMain(isBz) { if (isBz) { $('#superiorityMain .item').hover(function() { $("#commhover").remove(); var offset = $(this).offset(); var w = $(this).width() + 10; var h = $(this).height(); $("body").append("
"); $("body").append("
"); }, function() { $("#commhover").remove(); }) } else { $('#superiorityMain2 .item').hover(function() { $("#commhover").remove(); var offset = $(this).offset(); var w = $(this).width() + 10; var h = $(this).height(); $("body").append("
"); $("body").append("
"); }, function() { $("#commhover").remove(); }) } } //璁剧疆鐖嗙牬鐩戞祴绯荤粺 function setMonitorBlowup() { var itemlist = $("#monitorBlowup .left .item") var maxw = 0; for (var i = 0; i < itemlist.length; i++) { maxw += $(itemlist[i]).width() + 90; } $("#monitorBlowup .left .item").click(function() { $("#monitorBlowup .left .item").removeClass("on"); $(this).addClass("on"); var index = $(this).index(); $("#monitorBlowup .left .group .one").hide(); $($("#monitorBlowup .left .group .one").get(index)).show(); }) if(maxw<$("#monitorBlowup .left .tabs").width()){ $("#monitorBlowup .left .item").css({ width:(100/itemlist.length)+"%", boxSizing:'border-box' }); return; }else{ $("#monitorBlowup .left .swiper-slide").css({ // width: maxw + "px" }); } new Swiper("#monitorBlowup .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: {}, mousewheel: true }); } //鐖嗙牬绯荤粺鍔熻兘 function setSysAbility() { $("#sysAbility .centerA .left .list .item").click(function() { $(this).addClass("on").siblings().removeClass("on"); var index = $(this).index(); $($("#sysAbility .centerA .right .bg .one").get(index)).addClass("on").siblings().removeClass("on"); }) var itemlist = $("#sysAbility .centerB .list .item") var maxw = itemlist.length * (315 + 33) - 33; $("#sysAbility .centerB .list .swiper-slide").css({ width: maxw + "px" }); var theHtml = '
'; for (var i = 0; i < itemlist.length; i++) { theHtml += '
' + itemlist[i].outerHTML + '
'; } theHtml += "
"; $("#sysAbility .centerB .listphone").html(theHtml); new Swiper("#sysAbility .centerB .list .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: {}, mousewheel: true }); new Swiper("#sysAbility .centerB .listphone .swiper", { slidesPerView: 2, spaceBetween: 25, slidesPerGroup: 2, pagination: { el: "#sysAbility .centerB .listphone .swiper-pagination", clickable: true, }, }); } //鐖嗙牬妗堜緥 function setCaseMain() { $("#caseMain .phonelist").html($("#caseMain .list").html()); new Swiper("#caseMain .list .swiper", { slidesPerView: "auto", spaceBetween: 23, navigation: { nextEl: "#caseMain .list .swiperbuttonnext", prevEl: "#caseMain .list .swiperbuttonprev", } }); new Swiper("#caseMain .phonelist .swiper", { slidesPerView: 2, grid: { rows: 2, fill: 'row', }, spaceBetween: 20, navigation: { nextEl: "#caseMain .phonelist .swiperbuttonnext", prevEl: "#caseMain .phonelist .swiperbuttonprev", } }); } //浜у搧鍒楄〃绫诲埆 function publicListTabs() { $("#productList .tabsphone").html($("#productList .tabs").html()); var itemlist = $("#productList .tabs .item") var maxw = 0; for (var i = 0; i < itemlist.length; i++) { maxw += $(itemlist[i]).width() + 28 + 62; } maxw -= 28; $("#productList .tabs .swiper-slide").css({ width: maxw + "px" }); new Swiper("#productList .tabs .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: {}, mousewheel: true }); var itemlist = $("#productList .tabsphone .item") var maxw = 0; for (var i = 0; i < itemlist.length; i++) { maxw += $(itemlist[i]).width() + 28 + 62; } maxw -= 28; $("#productList .tabsphone .swiper-slide").css({ // width: maxw + "px" }); new Swiper("#productList .tabsphone .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: {}, mousewheel: true }); } //浜у搧璇︾粏椤佃疆鎾浘 function productShowSwiper() { var swiper = new Swiper(".mySwiper", { spaceBetween: 10, slidesPerView: 4, freeMode: true, watchSlidesProgress: true, breakpoints: { 320: { slidesPerView: 5, spaceBetween: 10, } } }); var swiper2 = new Swiper(".mySwiper2", { spaceBetween: 10, navigation: { nextEl: ".productShowInfo .left .swiperbuttonnext", prevEl: ".productShowInfo .left .swiperbuttonprev", }, thumbs: { swiper: swiper, }, }); } //浜戝钩鍙扮被鍒 function terraceSort() { $("#terraceSortList .tabsphone").html($("#terraceSortList .tabs").html()); var itemlist = $("#terraceSortList .tabs .item") var maxw = 0; for (var i = 0; i < itemlist.length; i++) { maxw += $(itemlist[i]).width() + 28 + 65; } maxw -= 28; $("#terraceSortList .tabs .swiper-slide").css({ width: maxw + "px" }); new Swiper("#terraceSortList .tabs .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: {}, mousewheel: true }); var itemlist = $("#terraceSortList .tabsphone .item") var maxw = 0; for (var i = 0; i < itemlist.length; i++) { maxw += $(itemlist[i]).width() + 28 + 62; } maxw -= 28; $("#terraceSortList .tabsphone .swiper-slide").css({ width: maxw + "px" }); new Swiper("#terraceSortList .tabsphone .swiper", { direction: "horizontal", slidesPerView: "auto", freeMode: true, scrollbar: {}, mousewheel: true }); } //浜戝钩鍙板钩鍙扮畝浠 function setSuperiority() { $("#terraceContent .middle .superiority .phonelist").html($( "#terraceContent .middle .superiority .list .swiper-wrapper").html()); new Swiper(".superiority .list .swiper", { slidesPerView: 3, navigation: { nextEl: ".superiority .list .swiperbuttonnext", prevEl: ".superiority .list .swiperbuttonprev", } }); } //浜戝钩鍙板姛鑳芥ā鍧 function setFunctionmodele() { $("#terraceContent .middle .functionmodele .tabs .item").hover(function() { $("#terraceContent .middle .functionmodele .tabs .item").removeClass("on"); $(this).addClass("on") var index = $(this).index(); $("#terraceContent .middle .functionmodele .content .onegrouup").hide(); $($("#terraceContent .middle .functionmodele .content .onegrouup").get(index)).show(); }, function() { }) } //鏈嶅姟鏀寔浜у搧瑙嗛 var theVideoId=""; function setProductVideo() { var itemlist=$("#productVideo .center .content .right .swiper .item"); var theHtml=""; for(var i=0;i0){ theHtml+=" style='display:none;'"; } theHtml+=">" theHtml+="
"; theHtml+="
"; if(/\.mp4$/i.test(videourl)){ theHtml+="
" }else{ theHtml+="
") $("#productVideo .center .content .left .video").show(); document.getElementById("thevideoobj").play && document.getElementById("thevideoobj").play(); }) $("#productVideo .center .content .left .play").click(function(){ var video_obj=$("#thevideoobj"); $("#productVideo .center .content .left .video").show(); video_obj.attr("src2") && video_obj.attr("src",video_obj.attr("src2")) video_obj.play && video_obj.play(); }) var swiper = new Swiper("#productVideo .center .content .right .swiper", { slidesPerView: 1, grid: { rows: 7, }, spaceBetween:0, navigation: { nextEl: "#productVideo .center .content .right .swiperbuttonnextA", prevEl: "#productVideo .center .content .right .swiperbuttonprevA", } }); } //鍏充簬鎴戜滑鍘嗙▼ function setAboutCourse(){ var swiper = new Swiper(".mySwiper", { spaceBetween: 0, slidesPerView: 7, freeMode: true, watchSlidesProgress: true, navigation: { nextEl: ".thumbs .gotonext", prevEl: ".thumbs .gotopre", }, breakpoints: { 320: { slidesPerView: 3, spaceBetween: 0, }, 1025:{ slidesPerView: 7, spaceBetween: 0, } } }); var swiper2 = new Swiper(".mySwiper2", { autoplay: { delay: 5000, stopOnLastSlide: false, disableOnInteraction: true, }, spaceBetween: 0, navigation: { nextEl: ".info .gotonext", prevEl: ".info .gotopre", }, thumbs: { swiper: swiper, }, }); } //璁剧疆鍏充簬鎴戜滑璧勮川 function seAboutAptitude(num){ for(var i=0;i1000){ showError("鍐呭澶暱"); return false; } return true; },function(data){ if(data.state=="success"){ showSuccess("鎭枩鎮ㄧ暀瑷€鎻愪氦鎴愬姛锛佽阿璋㈡偍鐨勫弽棣?); document.getElementById("theForm").reset(); }else{ showError(data.msg); } }); } /** * 鎻愮ず閿欒 * @param msg */ function showError(msg) { var url = arguments[1] ? arguments[1] : ""; top.layer.alert(msg, { icon: 5, skin: 'layer-ext-moon', closeBtn: 0 }, function (index) { if (url !== "") { top.location.href = url; } else { top.layer.close(index); } }); } /** * 鎻愮ず鎴愬姛 * @param msg */ function showSuccess(msg) { var url = arguments[1] ? arguments[1] : ""; top.layer.alert(msg, { icon: 6, skin: 'layer-ext-moon', closeBtn: 0 }, function (index) { if (url !== "") { top.layer.close(index); location.href = url; } else { top.layer.close(index); } }); } //浜у搧鎵嬪唽鍒囨崲 function setCpsc() { var swipertemp = new Swiper("#handbook .swiper", { effect: 'slide', pagination: { el: ".pageinfoB", clickable: true, bulletClass:'item', bulletActiveClass:'on', renderBullet: function (index, className) { return '' + (index + 1) + ""; }, }, }); }