$(function() {
    //设计团队0
    var swiperWi = new Swiper('.design-team-wicket', {
        pagination: {
            el: '.swiper-pagination',
            clickable: true,
        },
        autoplay: {
            delay: 5000,
            stopOnLastSlide: false,
            disableOnInteraction: false,
        },
        loop: true,
        navigation: {
            nextEl: '.button-next',
            prevEl: '.button-prev',
        },
        loop: true,
        navigation: {
            nextEl: '.swiper-button-wicket-next',
            prevEl: '.swiper-button-wicket-prev',
        }
    });


    //设计团队
    var swiper = new Swiper('.design-team', {
        slidesPerView: 5,
        spaceBetween: 30,
        autoplay: {
            delay: 2000,
            stopOnLastSlide: false,
            disableOnInteraction: false,
        },
        loop: true,
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        }
    });

    //首页banner
    var swipers = new Swiper('.banner-container', {
        pagination: {
            el: '.swiper-pagination',
            clickable: true,
        },
        autoplay: {
            delay: 5000,
            stopOnLastSlide: false,
            disableOnInteraction: false,
        },
        loop: true,
        navigation: {
            nextEl: '.button-next',
            prevEl: '.button-prev',
        },
    });

    //华浔产品
    var swiperEr = new Swiper('.hxcp', {
        pagination: {
            el: '.swiper-pagination-hxcp',
            clickable: true
        }
    });


    $(".product-tab").each(function() {
        $(this).find("span").each(function(key, value) {
            $(this).click(function() {
                swiperEr.slideTo(key, 1000, false); //切换到第一个slide，速度为1秒
            })
        })
    });

    /*======next======*/
    $(".case-left>span").hover(function() {
        var index = $(this).index();
        $(".case-pic>div").hide();
        $(".case-left>span").removeClass('case-left-check');
        $(".case-pic>div").eq(index).show();
        $(".case-left>span").eq(index).addClass('case-left-check');
    });

    $('.layer-demolist').on('click', function() {
        var file_path = $(this).attr('data');
        var title = $(this).attr('title')
        var loadstr = '<video width="100%" height="100%"  controls="controls" autobuffer="autobuffer"  autoplay="autoplay" loop="loop" style="position:fixed!important;top:42px;left:0;"><source src="' + file_path + '" type="video/mp4"></source></video>'
        layer.open({
            type: 1,
            title: title,
            area: ['730px', '460px'],
            shade: 0,
            closeBtn: 1,
            content: loadstr,
        });
    })
})