/**
 * Created by jiale on 2022/2/14.
 */

jQuery(document).ready(function($) {

    //展会活动轮播
    var screen_width = window.screen.width;
    var screen_height = window.screen.height;

    //根据屏幕分辨率判断是否是手机
    if(screen_width < 500 && screen_height < 900){
        mobile_flag = true;
        $('.blog-listnewsflash').slick({
            "autoplay": false,
            "autoplaySpeed": 5000,
            "speed":600,
            "infinite":false,
            "dots": true,
            "arrows": false,
            "slidesPerRow":1,
            "slidesToShow": 1,
            "slidesToScroll": 1,
            // "rows":1,
            "centerPadding":"50px",
        });
           $('.recommend-video').slick({
             "autoplay": true,
             "autoplaySpeed": 5000,
             "speed":1000,
             "infinite":true,
             "dots": true,
             "arrows": true,
            //  prevArrow: '<div class="slick-prev"></div>',
            //  // “下一个”箭头自定义HTML
            //  nextArrow: '<div class="slick-next"></div>',
             "centerMode": false,
             "rows":1,
             "slidesPerRow":1,
            "slidesToShow": 1,
            "slidesToScroll": 1,
             "draggable":true,
             "swipe":true,
             "touchMove":true,
         });

    }else if(screen_width < 800){


        $('.blog-listnewsflash').slick({
            "autoplay": false,
            "autoplaySpeed": 5000,
            "speed":600,
            "infinite":false,
            "dots": true,
            "arrows": false,
            "slidesPerRow":1,
            "slidesToShow": 1,
            "slidesToScroll": 1,
            // "rows":1,
            "centerPadding":"50px",
        });

    }
    else {
        mobile_flag = false;
    }

    $('.newsflash-vert').slick({
        "autoplay": false,
        "autoplaySpeed": 5000,
        "speed":600,
        "infinite":false,
        "dots": true,
        "arrows": false,
        "rows":1,
        "centerPadding":"50px",

    });


    $('.eventshome').slick({
        "autoplay": false,
        "autoplaySpeed": 5000,
        "speed":600,
        "infinite":false,
        "dots": true,
        "arrows": false,
        "slidesToShow": 2,
        "slidesToScroll": 2,
        "rows":1,
        "centerPadding":"50px",
        "responsive":[
            {
                breakpoint:800,
                settings:{
                    "autoplay": false,
                    "autoplaySpeed": 5000,
                    "speed":600,
                    "infinite":false,
                    "dots": true,
                    "arrows": false,
                    "slidesPerRow":1,
                    "slidesToShow": 1,
                    "slidesToScroll": 1,
                }
            }
        ]
    });



    $('.newsflash-vertnewsflash').slick({
        "autoplay": false,
        "autoplaySpeed": 5000,
        "speed":600,
        "infinite":false,
        "dots": true,
        "arrows": false,
        "rows":1,
        "centerPadding":"50px",

    });

    $('.rongyuzhengshu').slick({
        "autoplay": true,
        "autoplaySpeed": 5000,
        "speed":1000,
        "infinite":true,
        "dots": false,
        "arrows": true,
        prevArrow: '<div class="slick-prev"></div>',
        // “下一个”箭头自定义HTML
        nextArrow: '<div class="slick-next"></div>',
        centerMode: true,
        centerPadding:"0",
        "rows":1,
        "slidesToShow": 5,
        "draggable":true,
        "swipe":true,
        "touchMove":true,
        "responsive": [
                {
                    breakpoint: 1280,
                    settings: {
                        arrows: true,
                        centerMode:false,
                        centerPadding: '',
                        slidesToShow: 2
                    }
                },
                {
                    breakpoint: 500,
                    settings: {
                        arrows: false,
                        centerMode: false,
                        centerPadding: '0',
                        slidesToShow: 1,

                    }
                },
            ],
    });
    $('.rongyuzhengshu2').slick({
        "autoplay": true,
        "autoplaySpeed": 5000,
        "speed":1000,
        "infinite":true,
        "dots": false,
        "arrows": true,
        prevArrow: '<div class="slick-prev"></div>',
        // “下一个”箭头自定义HTML
        nextArrow: '<div class="slick-next"></div>',
        "centerMode": true,
        "rows":1,
        "slidesToShow": 5,
        "centerPadding":"0",
        "draggable":true,
        "swipe":true,
        "touchMove":true,
        "responsive": [
            {
                breakpoint: 1280,
                settings: {
                    arrows: true,
                    centerMode:false,
                    centerPadding: '',
                    slidesToShow: 2
                }
            },
            {
                breakpoint: 500,
                settings: {
                    arrows: false,
                    centerMode: false,
                    centerPadding: '0',
                    slidesToShow: 1
                }
            },
        ],
    });
    $('.rongyuzhengshu3').slick({
        "autoplay": true,
        "autoplaySpeed": 5000,
        "speed":1000,
        "infinite":true,
        "dots": false,
        "arrows": true,
        prevArrow: '<div class="slick-prev"></div>',
        // “下一个”箭头自定义HTML
        nextArrow: '<div class="slick-next"></div>',
        "centerMode": false,
        "rows":1,
        "slidesToShow": 3,
        "centerPadding":"50px",
        "draggable":true,
        "swipe":true,
        "touchMove":true,
        "responsive": [
            {
                breakpoint: 1280,
                settings: {
                    arrows: true,
                    centerMode:false,
                    centerPadding: '',
                    slidesToShow: 2
                }
            },
            {
                breakpoint: 500,
                settings: {
                    arrows: false,
                    centerMode: false,
                    centerPadding: '0',
                    slidesToShow: 1
                }
            },
        ],
    });


if ($(".recommend-video .span1").length>3){
         $('.recommend-video').slick({
             "autoplay": true,
             "autoplaySpeed": 5000,
             "speed":1000,
             "infinite":true,
             "dots": true,
             "arrows": true,
             prevArrow: '<div class="slick-prev"></div>',
             // “下一个”箭头自定义HTML
             nextArrow: '<div class="slick-next"></div>',
             "centerMode": false,
             "rows":1,
             "slidesToShow": 3,
             "draggable":true,
             "swipe":true,
             "touchMove":true,
             "responsive": [
                 {
                     breakpoint: 1280,
                     settings: {
                         arrows: true,
                         centerMode:false,
                         centerPadding: '',
                         slidesToShow: 2
                     }
                 },
                 {
                     breakpoint: 500,
                     settings: {
                         arrows: false,
                         centerMode: false,
                         centerPadding: '0',
                         slidesToShow: 1
                     }
                 },
             ],
         });
     } else {
        $(".recommend-video").css({"margin":"unset","width":"100%"});
     }


 $(".Home-banner ul").slick({
        autoplay: true,
        autoplaySpeed: 3000,
        speed:1000,
        slidesToShow: 1,
        slidesToScroll: 1,
        arrows:false,
        draggable:true,
        touchMove:true,
        swipe:true,
        infinite:true,
        dots:true,
        centerPadding:"50px",
        responsive:[{
            breakpoint: 800,
            settings: {
                autoplay: true,
                dots:false,

            }
        }]

    })

        $('.shfw-t_f1btop').slick({
            slidesToShow: 5,
             asNavFor: '.shfw-t_f1bk2box',
            responsive: [
                {
                    breakpoint: 481,
                    settings: {
                        arrows:false,
                        slidesToShow: 3,
                        slidesToScroll: 1,
                        draggable:true,
                        touchMove:true,
                        infinite:false,

                    }
                },
            ]

        });

        $('.shfw-t_f1bk2box').slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            arrows:false,
            asNavFor: '.shfw-t_f1btop',
            draggable:true,
            touchMove:true,
            swipe:true,
            infinite:false,
        });
        $('.shfw-t_f1btopli').click(function () {

            var shu = $(this).stop().attr('data-num');
            $('.shfw-t_f1bk2box').slick('slickGoTo', shu);

        });
        $('.shfw-t_f1bk2rg').mCustomScrollbar({
            axis: "y",  //滚动条方向
            scrollbarPosition: "outside",  //设置滚动条相对于内容的位置
            theme: "dark-2",  //滚动条主题
            mouseWheelPixels:300,
        });


})