new Vue({ el: '#app', data: { pos: 0, searchModelId: 0, headerHeight: 167, headerSearchType: 1, headerSearchTypeSonShow: 0, navHeight: 56, navFixedWhenHeight: 308, menuActive: -1, leftNavIndex: 0, // 鍘熸湁data淇濇寔涓嶅彉 showSearch: false, searchKeyword: '', prodcutsDetailAlbumIndex: 1, prodcutsDetailTabsIndex: 0 }, watch: { indexNewsIndex(v) { this.$nextTick(function () { var indexNewsSwiper = new Swiper('#indexNewsSwiper', { effect: "slider", navigation: { nextEl: '#indexNewsSwiper .swiper-button-next', prevEl: '#indexNewsSwiper .swiper-button-prev', }, speed: 1000, autoplay: { delay: 5000, disableOnInteraction: false }, loop: true }); }) } }, mounted() { new WOW({ callback: function (box) { // 鍔ㄧ敾缁撴潫鍚庡己鍒舵坊鍔 animate__animated 绫 box.classList.add('animate__animated'); } }).init(); var t = this; //swiper var swiper = new Swiper('#homeSwiper', { effect: "slider", pagination: { el: '#homeSwiper .swiper-pagination', clickable: true, }, navigation: { nextEl: '#homeSwiper .swiper-button-next', prevEl: '#homeSwiper .swiper-button-prev', }, speed: 1000, autoplay: { delay: 5000, disableOnInteraction: false }, loop: true }); //productsSwiper var productsSwiper = new Swiper('#productsSwiper', { effect: "slider", navigation: { nextEl: '#productsSwiper .swiper-button-next', prevEl: '#productsSwiper .swiper-button-prev', }, speed: 1000, autoplay: { delay: 5000, disableOnInteraction: false }, loop: false, slidesPerView: 3 }); var historySwiper = new Swiper('#historySwiper', { effect: "slider", navigation: { nextEl: '.history .swiper-button-next', prevEl: '.history .swiper-button-prev', }, speed: 1000, autoplay: false, loop: true, slidesPerView: 5, slidesPerGroup: 1, spaceBetween: 0, centeredSlides: true, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 1, slidesPerGroup: 1, spaceBetween: 0 }, 768: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?68 slidesPerView: 3, slidesPerGroup: 3, spaceBetween: 0 }, 1280: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?280 slidesPerView: 5, slidesPerGroup: 1, spaceBetween: 0, } }, }); }, methods: { /** * * 灏佽鐨勫姞杞藉眰 */ layer_loading: function (msg) { var loading = layer.msg( msg + '...                璇峰嬁鍒锋柊椤甸潰', { icon: 1, time: 3600000, //1灏忔椂鍚庡悗鑷姩鍏抽棴 shade: [0.2] //0.1閫忔槑搴︾殑鐧借壊鑳屾櫙 }); //loading灞 var index = layer.load(3, { shade: [0.1, '#fff'] //0.1閫忔槑搴︾殑鐧借壊鑳屾櫙 }); return loading; }, currentTime: function () { var d = new Date(), str = ''; str += d.getFullYear() + '骞?; str += d.getMonth() + 1 + '鏈?; str += d.getDate() + '鏃 '; str += "鏄熸湡" + "鏃ヤ竴浜屼笁鍥涗簲鍏?.charAt(new Date().getDay()); return '浠婂ぉ鏄細' + str; }, listenScrollTop: function () { let t = this; window.addEventListener('scroll', function (e) { t.pos = document.documentElement.scrollTop; }) }, search: function () { if (this.$refs.keywords.value == '') { layer.msg('璇疯緭鍏ユ悳绱㈠叧閿瓧'); this.$refs.keywords.focus(); return false; } this.$refs.search.submit(); }, openVideo: function (title, url) { layer.open({ title: title, type: 1, skin: 'layui-layer-rim', area: ['650px'], content: '' }); }, toTop: function () { $('html,body').animate({ scrollTop: 0 }); }, playVideo: function () { const video = this.$refs.videoPlayer; if (video) { this.videoPlay = true; // 鏄剧ず瑙嗛 video.play().catch(error => { console.error("鎾斁澶辫触:", error); // 澶勭悊鎾斁琚祻瑙堝櫒闃绘鐨勬儏鍐 }); } }, changeAboutPage6Tab: function (index) { this.aboutPage6TabIndex = index; this.$nextTick(() => { var honorSwiper = new Swiper('#honorSwiper_' + index, { effect: "slider", pagination: { el: '.page6 .swiper-pagination', clickable: true }, navigation: { nextEl: '.page6 .swiper-button-next', prevEl: '.page6 .swiper-button-prev', }, speed: 1000, autoplay: { delay: 10000, disableOnInteraction: false }, loop: false, slidesPerView: 4, slidesPerGroup: 4, spaceBetween: 85, breakpoints: { 320: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?20 slidesPerView: 2, slidesPerGroup: 2, spaceBetween: 15 }, 768: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?68 slidesPerView: 3, slidesPerGroup: 3, spaceBetween: 30 }, 1280: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?280 slidesPerView: 4, slidesPerGroup: 4, spaceBetween: 85, } }, }); }) }, // 鍘熸湁methods淇濇寔涓嶅彉 toggleSearch() { this.showSearch = !this.showSearch; if (this.showSearch) { // 鏄剧ず鎼滅储妗嗗悗锛岃嚜鍔ㄨ仛鐒﹀埌杈撳叆妗 this.$nextTick(() => { document.querySelector('.search-popup input').focus(); }); } }, doSearch() { if (this.searchKeyword.trim() === '') { layer.msg('璇疯緭鍏ユ悳绱㈠唴瀹?); return; } // 绀轰緥锛氳烦杞埌鎼滅储椤甸潰 window.location.href = '/search.html?keywords=' + encodeURIComponent(this.searchKeyword); }, productsSearch() { if ($('#products_keywords').val().trim() === '') { layer.msg('璇疯緭鍏ユ悳绱㈠唴瀹?); return; } // 绀轰緥锛氳烦杞埌鎼滅储椤甸潰 window.location.href = $('#products_url').val() + '?productsKeywords=' + encodeURIComponent($('#products_keywords').val())+'#productslist'; }, changeHomeSolution(title, des, url, bg) { $('#solution-title').html(title); $('#solution-des').html(des); $('#solution-url').attr('href', url); $('#page2').css('background-image', 'url('+bg+')'); } } })