/*
 * @Author: mjy
 * @Date: 2020-1-14
 */
// $(document).ready(function() {
//     $('#fullpage').fullpage({
//         scrollOverflow: true,
//         scrollingSpeed: 1200,
//     })
// })

window.onload = function() {

    // $('.header-nav-l').css('height', $(window).height() + 'px');
    $('.header-nav .tit').click(function(e) {
        e.stopPropagation();
        if ($('.header-nav').width() > $('.header-nav .tit').width()) {
            $('.header .logo .img2').hide();
            $('.header .logo .img1').show();
            $('.header-nav').animate({ width: '1.1rem' });
            $('.header-nav').css('height', $('.header-nav .tit').height() + .14 + 'rem');
        } else {
            $('.header-nav').css('height', $(window).height() + 'rem');
            $('.header-nav').animate({ width: '5.3rem' });
            $('.header .logo .img1').hide();
            $('.header .logo .img2').show();
        }
        $(document).click(function() {
            if ($('.header-nav').width() > $('.header-nav .tit').width()) {
                $('.header .logo .img2').hide();
                $('.header .logo .img1').show();
                $('.header-nav').animate({ width: '1.1rem' });
                $('.header-nav').css('height', $('.header-nav .tit').height() + .14 + 'rem');
            }
        })
    })

    //首页头条轮播
    jQuery(".index-headline .headline-item").simpleSwitch({
        playTime: 4000,
        type: 'top',
    });


    var swiper3 = new Swiper('.index-wrap5-box', {
        loop: true,
        navigation: {
            nextEl: '.index-wrap5 .next',
            prevEl: '.index-wrap5 .prev',
        },
        autoplay: {
            delay: 4000,
            disableOnInteraction: false,
        },
    });

    var swiper4 = new Swiper('.index-wrap1-tab', {
        loop: true,
        pagination: {
            el: '.index-wrap1-tab .pagination',
            clickable: true,
        },
        autoplay: {
            delay: 4000,
            disableOnInteraction: false,
        },
    });


    $('.index-switch').tabSwitch({
        tabHead: '.index-tit .tit',
        tabCont: '.index-item',
        cur: 'cur'
    });

    //回到顶部
    $(".go-top").click(function() {
        $("html,body").animate({ scrollTop: 0 }, 500);
    })
    $(window).scroll(function() {
        var gun = $(document).scrollTop();
        if (gun <= 400) {
            $(".go-top").hide()
        } else {
            $(".go-top").show()
        }
    });

    var mySwiper1 = new Swiper('.box', {
        direction: 'vertical',
    });
    var mySwiper2 = new Swiper('.sec-section', { //子swiper
        direction: 'vertical',
        nested: true,
        //resistanceRatio: 0,
        slidesPerView: 'auto',
        freeMode: true,
        scrollbar: {
            el: '.sec-scrollbar',
        },
    })
    var mySwiper5 = new Swiper('.fir-section', { //子swiper
        direction: 'vertical',
        nested: true,
        //resistanceRatio: 0,
        slidesPerView: 'auto',
        freeMode: true,
        scrollbar: {
            el: '.fir-scrollbar',
        },
    })

    // 首页回到顶部
    $(".sec-section .go-top").click(function() {
        mySwiper2.slideTo(0, 500, false);
    })

    var uri = window.location.pathname;
    if (uri.indexOf("/qzfbm/") >= 0 || uri.indexOf("/qzfzj/") >= 0) {
        $('.mb2-position a').attr('href','')
    }
};