| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518 |
- $(function () {
- //给页面绑定滑轮滚动事件
- $(document).on('scroll', scrollFunc);
- changeTab();
- changeCard();
- changeTabPage();
- //banner 轮播
- var bannerSlide = null;
- bannerSlide = new Swiper('#bannerSlide .swiper-container', {
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: true,
- loop: true,
- autoplay: true,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- pagination: {
- el: '.swiper-pagination',
- type: 'custom',
- renderCustom: function (swiper, current, total) {
- var customPaginationHtml = '';
- for (var i = 0; i < total; i++) {
- if (i === (current - 1)) {
- // if($('.e-commerce-header').length > 0) {
- // if(scrollTop <= 10){
- // $('.e-commerce-header').css({
- // // backgroundImage: "linear-gradient(292deg, #4256e8, #576bff)",
- // })
- // }
- // }
- customPaginationHtml += '<div class="slide-page"><div class="item active-slide"></div></div>';
- } else {
- // if($('.e-commerce-header').length > 0) {
- // if(scrollTop <= 10){
- // $('.e-commerce-header').css({
- // // backgroundImage: "linear-gradient(292deg, #2C64EF,#4589FB)",
- // })
- // }
- // }
- customPaginationHtml += '<div class="slide-page"><div class="item"></div></div>';
- }
- }
- return customPaginationHtml;
- },
- },
- on: {
- slideChange: function () {
- myAnmiate();
- $('.slide-page').on("click", function (e) {
- e.preventDefault();
- e.stopPropagation();
- let index = $('.slide-page').index(this);
- bannerSlide.slideToLoop(index, 1000, false);//切换到第一个slide,速度为1秒
- });
- },
- }
- });
- $("#bannerSlide .swiper-container").hover(function () {
- bannerSlide.autoplay.stop();
- $('.slide-page .item').stop();
- }, function () {
- bannerSlide.autoplay.start();
- myAnmiate();
- });
- if ($('.slide-page .item').length > 0) {
- myAnmiate();
- $('.slide-page').on("click", function (e) {
- e.preventDefault();
- e.stopPropagation();
- let index = $('.slide-page').index(this);
- bannerSlide.slideToLoop(index, 1000, false);//切换到第一个slide,速度为1秒
- });
- }
- //解决方案 swiperSulutionSlide
- var swiperSulutionSlide = null;
- swiperSulutionSlide = new Swiper('#swiperSulutionSlide .swiper-container', {
- spaceBetween: 20,
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: true,
- // loop: true,
- autoplay: false,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- scrollbar: {
- el: '.swiper-scrollbar',
- },
- });
- $("#bannerSlide .swiper-container").hover(function () {
- swiperSulutionSlide.autoplay.stop();
- }, function () {
- swiperSulutionSlide.autoplay.start();
- });
- //小程序
- var swiperSolutionSlide = null;
- swiperSolutionSlide = new Swiper('#swiperSolutionSlide .swiper-container', {
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: true,
- autoplay: false,
- pagination: {
- el: '.swiper-pagination',
- clickable: true,
- }
- });
- //app页面案例
- var appCaseSlide = null;
- if (isPhone() || $('.new-app-case .swiper-slide').length > 5) {
- appCaseSlide = new Swiper('#appCaseSlide .swiper-container', {
- slidesPerView: 5,
- spaceBetween: 20,
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: true,
- loop: true,
- autoplay: true,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- breakpoints: {
- 900: {
- slidesPerView: 3,
- spaceBetween: 16,
- }
- }
- })
- $("#appCaseSlide .swiper-container").hover(function () {
- appCaseSlide.autoplay.stop();
- }, function () {
- appCaseSlide.autoplay.start();
- });
- } else {
- $('#appCaseSlide .swiper-container').addClass('swiper-no-swiping')
- appCaseSlide = new Swiper('#appCaseSlide .swiper-container', {
- slidesPerView: 5,
- spaceBetween: 20,
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: false,
- loop: true,
- autoplay: false,
- noSwiping: true,
- breakpoints: {
- 900: {
- slidesPerView: 3,
- spaceBetween: 16,
- }
- }
- })
- }
- //微信小程序页面案例
- if (isPhone()) {
- var miniProgramCaseSlide = new Swiper('#miniProgramCaseSlide .swiper-container', {
- slidesPerView: 3,
- spaceBetween: 24,
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: false,
- loop: true,
- autoplay: true,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- breakpoints: {
- 900: {
- slidesPerView: 3,
- spaceBetween: 16,
- }
- }
- });
- $("#miniProgramCaseSlide .swiper-container").hover(function () {
- miniProgramCaseSlide.autoplay.stop();
- }, function () {
- miniProgramCaseSlide.autoplay.start();
- });
- } else {
- $('#miniProgramCaseSlide .swiper-container').addClass('swiper-no-swiping')
- var miniProgramCaseSlide = new Swiper('#miniProgramCaseSlide .swiper-container', {
- slidesPerView: 3,
- spaceBetween: 24,
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: false,
- loop: true,
- autoplay: false,
- noSwiping: true,
- breakpoints: {
- 900: {
- slidesPerView: 3,
- spaceBetween: 16,
- }
- }
- });
- }
- //web页面案例
- var webCaseSlide = new Swiper('#webCaseSlide .swiper-container', {
- slidesPerView: 1.5,
- spaceBetween: 24,
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: true,
- autoplay: true,
- loop: true,
- loopedSlides: 5,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- breakpoints: {
- 900: {
- slidesPerView: 1.6,
- spaceBetween: 16,
- }
- }
- });
- $("#webCaseSlide .swiper-container").hover(function () {
- webCaseSlide.autoplay.stop();
- }, function () {
- webCaseSlide.autoplay.start();
- });
- //互联网 案例
- var webInternetCaseSlide = new Swiper('#webInternetCaseSlide .swiper-container', {
- slidesPerView: 1.854,
- spaceBetween: 24,
- centeredSlides: true,
- slideToClickedSlide: false,
- preventClicksPropagation: true,
- autoplay: true,
- loop: true,
- freeMode: false,
- loopedSlides: 5,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- breakpoints: {
- 900: {
- slidesPerView: 1.6,
- spaceBetween: 16,
- }
- }
- });
- $('.internet-case .swiper-slide').hover(function () {
- let slideActive = $('.internet-case .swiper-slide-active').attr('slide');
- let slide = $(this).attr('slide');
- let index = $('.internet-case .swiper-slide').index(this);
- if (slideActive === slide) {
- $('.internet-case .swiper-slide .case-dec').eq(index).css({
- display: 'block',
- })
- }
- }, function () {
- $('.internet-case .swiper-slide .case-dec').css({
- display: 'none',
- })
- });
- $("#webInternetCaseSlide .swiper-container").hover(function () {
- webInternetCaseSlide.autoplay.stop();
- }, function () {
- webInternetCaseSlide.autoplay.start();
- });
- //流程
- var flowNav = new Swiper('#flowNav', {
- slidesPerView: $('#flowNav .swiper-slide').length,
- speed: 700,
- autoplay: true,
- watchSlidesVisibility: true,/*避免出现bug*/
- });
- var flowContent = new Swiper('#flowContent', {
- autoplay: true,
- speed: 700,
- watchSlidesVisibility: true,/*避免出现bug*/
- thumbs: {
- swiper: flowNav,
- },
- breakpoints: {
- 900: {
- pagination: {
- el: '#flowContent .swiper-pagination',
- },
- }
- }
- });
- $(".flow-slide").hover(function () {
- flowNav.autoplay.stop();
- flowContent.autoplay.stop();
- }, function () {
- flowNav.autoplay.start();
- flowContent.autoplay.start();
- })
- $(document).on('click', '.header-menu a[href^="#"]', function (event) {
- event.preventDefault();
- $('html, body').animate({
- scrollTop: $($.attr(this, 'href')).offset().top - 80
- }, 1000);
- if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
- $('.header-menu').slideToggle("1000");
- $('.menu-toggle').toggleClass('active');
- }
- });
- $('.menu-toggle').click(function () {
- event.preventDefault();
- $(this).toggleClass('active');
- $('.header-menu').slideToggle("1000");
- })
- //新app - 自定义滚动条
- if ($('.app-wrap')) {
- scrollBar();
- }
- //App
- if ($('#closed-footer-form').length > 0) {
- footerMin();
- }
- });
- //新app页面自定义滚动条
- function scrollBar() {
- let scrollElement = $('.section-service-process .service-list-warp');
- //获取内容的宽
- var contentWidth = $('.section-service-process .service-list').width();
- //可视区的宽
- var clientWidth = scrollElement.width();
- //比例
- var proportion = clientWidth / contentWidth;
- //滚动条的总宽度 ---- 外层轨道
- var scrollWidth = $('.section-service-process .scroll-box').width();
- //设置内层轨道的宽度
- $('.scroll-box .scroll-step').css({
- width: scrollWidth * proportion,
- });
- //内容最大滚动距离
- var contentMaxScrollLeft = contentWidth - clientWidth;
- scrollElement.on('scroll', function () {
- //内容滚动的left值
- let scrollLeft = scrollElement.scrollLeft();
- //设置滚动条外层轨道的滚动距离 - left
- $('.scroll-box .scroll-step').css({
- left: scrollLeft / contentMaxScrollLeft * (scrollWidth - $('.scroll-box .scroll-step').width()),
- })
- })
- }
- //电商平台
- function scrollFunc() {
- var scrollTop = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset;
- var sectionMore = document.getElementById('section-more-container');
- if (sectionMore) {
- if (scrollTop >= 176) {
- sectionMore.style.bottom = '150px';
- } else {
- sectionMore.style.bottom = scrollTop - 26 + "px";
- }
- }
- if (scrollTop > 0) {
- $('.e-commerce-header').css({
- backgroundImage: "linear-gradient(292deg, #4256e8, #576bff)",
- })
- } else {
- $('.e-commerce-header').css({
- backgroundImage: 'none',
- })
- }
- }
- //物联网-覆盖业务
- function changeTab() {
- let tabTop = $('.internet-work .solution-list-mobile-top .tab');
- let itemTop = $('.section-business-dec-top .section-business-item');
- tabTop.on('click', function () {
- tabTop.removeClass('active');
- itemTop.removeClass('active-content');
- $(this).addClass('active');
- let index = tabTop.index(this);
- itemTop.eq(index).addClass('active-content');
- });
- let tabBottom = $('.internet-work .solution-list-mobile-bottom .tab');
- let itemBottom = $('.section-business-dec-bottom .section-business-item');
- tabBottom.on('click', function () {
- tabBottom.removeClass('active');
- itemBottom.removeClass('active-content');
- let index = tabBottom.index(this);
- $(this).addClass('active');
- itemBottom.eq(index).addClass('active-content');
- });
- //动态设置tab的高度 高度等于宽度
- var width = tabTop.width();
- tabTop.css({
- height: width,
- });
- tabBottom.css({
- height: width,
- });
- }
- //电商 -- 解决方案
- function changeCard() {
- var items = $('.e-commerce-section-solution .solution-item .top');
- var wraps = $('.e-commerce-section-solution .solution-item .wrap');
- var filterBlur = $('.e-commerce-section-solution .solution-item .solution-filter-blur');
- items.on('mouseenter', function () {
- let index = items.index(this);
- filterBlur.removeClass("activeblur");
- filterBlur.eq(index).addClass('activeblur');
- wraps.removeClass('active');
- wraps.eq(index).addClass('active');
- });
- }
- //电商 -- 零售系统
- function changeTabPage() {
- var tabs = $('.section-e-commerce-system .content-list .content-item');
- var tabsContent = $('.section-e-commerce-system .content-dec .item-dec');
- var left = tabs.length > 0 && tabs[0].offsetWidth / 2 + tabs[0].offsetLeft / 2;
- $('.section-e-commerce-system .content-dec .arrow-top').css({
- left: left,
- });
- tabs.on('click', function () {
- tabsContent.removeClass('active');
- let index = tabs.index(this);
- tabsContent.eq(index).addClass('active');
- if (index == 0) {
- $('.section-e-commerce-system .content-dec .arrow-top').css({
- left: left - 5,
- });
- }
- left = tabs[index].offsetWidth / 2 + tabs[index].offsetLeft + tabs[0].offsetLeft / 2;
- $('.section-e-commerce-system .content-dec .arrow-top').css({
- left: left - 5,
- })
- })
- }
- //App footer最小化
- function footerMin() {
- $('#closed-footer-form').on('click', function () {
- $(this).parent().hide();
- $('.min-footer-form-div').show();
- $('.internet-footer-empty-div').css({
- height: "0px"
- })
- });
- $('.min-footer-form-div').on('click', function () {
- $(this).hide();
- $('#closed-footer-form').parent().show();
- $('.internet-footer-empty-div').css({
- height: "166px"
- })
- });
- }
- function myAnmiate() {
- for (var i = 0; i < $('.slide-page .item').length; i++) {
- if ($($('.slide-page .item')[i]).hasClass("active-slide")) {
- $($('.slide-page .item')[i]).animate({
- width: "70px"
- }, 3000, "linear")
- }
- }
- }
- //新的小程序
- $('.solution-section-mini-program .slider-item').on('mouseenter',function(){
- let index = $(this).index();
- let bgImg = 'content-bg-0' + (index+1);
- $('.solution-section-mini-program #content').removeClass();
- $('.solution-section-mini-program #content').addClass(bgImg);
- $('.solution-section-mini-program #content').addClass("content");
- $('.solution-section-mini-program .slider-item').removeClass('active');
- $(this).addClass('active');
- $('.solution-section-mini-program .item-dec').removeClass('active');
- $('.solution-section-mini-program .item-dec').eq(index).addClass('active');
- });
- //
- //
- var liDom = $("#case-content-box .case-nav li");
- var caseListDom = $("#case-content-box .case-list");
- liDom.on('click',function(){
- liDom.removeClass('active');
- $(this).addClass('active');
- var index = $(this).index();
- caseListDom.css({
- display:"none"
- });
- caseListDom.eq(index).css({
- display:'block'
- })
- });
- //左侧了解更多
- $('#section-slide .btn-list a').on('mouseenter',function(){
- $('#section-slide .btn-list a').removeClass('active');
- $(this).addClass('active');
- });
|