PageSourceSearch

https://yoltx.com/Public/En/js/base-v3.0.min.js

js yoltx.com collected 2026-10-07 15:01:31 UTC 35,707 bytes, 1,013 lines download raw bytes

1(function (window) {
2    var ys = {};
3    if (window.ys) {
4        ys = window.ys
5    };
6    var lenis;
7    // 滚动条隐藏与显示
8    var scrollbar = {
9        $html: $("html"),
10        $body: $("body"),
11        originalBodyPad: null,
12        scrollbarWidth: 0,
13        hide: function () {
14            this.$body = $("body");
15            this.checkScrollbar();
16            this.setScrollbar();
17            this.$html.css("overflow", "hidden");
18            // if (this.isMobileSafari()) {
19            //     this.$html.css({
20            //         width: "100%",
21            //         position: "fixed"
22            //     });
23            // }
24        },
25        show: function () {
26            this.$body = $("body");
27            this.$html.removeAttr("style");
28            this.resetScrollbar();
29        },
30        checkScrollbar: function () {
31            var fullWindowWidth = window.innerWidth
32            if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
33                var documentElementRect = document.documentElement.getBoundingClientRect();
34                fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
35            }
36            this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth;
37            this.scrollbarWidth = this.measureScrollbar();
38        },
39        setScrollbar: function () {
40            var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
41            this.originalBodyPad = document.body.style.paddingRight || ''
42            if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this
43                .scrollbarWidth)
44        },
45        measureScrollbar: function () {
46            var scrollDiv = document.createElement('div');
47            scrollDiv.style.position = "absolute";
48            scrollDiv.style.top = "-9999px";
49            scrollDiv.style.width = "50px";
50            scrollDiv.style.height = "50px";
51            scrollDiv.style.overflow = "scroll";
52
53            this.$body.append(scrollDiv);
54            var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
55            this.$body[0].removeChild(scrollDiv);
56            return scrollbarWidth;
57        },
58        resetScrollbar: function () {
59            this.$body.css('padding-right', 0);
60        },
61        isMobileSafari: function () {
62            var ua = navigator.userAgent.toLowerCase();
63            var isChrome = ua.indexOf("chrome") != -1;
64            var isSafari = ua.indexOf("safari") != -1;
65            var isMobile = ua.indexOf("safari") != -1;
66
67            if (!isChrome && isSafari && isMobile) {
68                return 1;
69            } else {
70                return 0;
71            }
72        }
73    };
74    ys.scrollbar = scrollbar;
75
76    /**
77     *
78     * @description 回到顶部
79     * @param {Number} duration - 时间(ms)
80     * 
81     */
82    function goTop(duration) {
83        var duration = duration || 500;
84        $("html,body").stop().animate({
85            scrollTop: 0,
86        }, duration)
87    };
88    ys.goTop = goTop;
89
90    /**
91     *
92     * @description 当滚动条离开最顶部给选择元素加一个类名isfixed
93     * @param {String} selector - css选择器
94     * 
95     */
96    function isFixed(selector) {
97        var $obj = $(selector);
98        $(function () {
99            judgeTop()
100        });
101        $(window).on("scroll", judgeTop);
102        $(window).on("load", judgeTop);
103        $(window).on("resize", judgeTop);
104
105        function judgeTop() {
106            if ($(window).scrollTop() > 0) {
107                $obj.addClass("isfixed");
108            } else {
109                $obj.removeClass("isfixed");
110            }
111        }
112    }
113    ys.isFixed = isFixed;
114
115    /**
116     *
117     * @description banner轮播视频初始化
118     * @param {String} selector - css选择器
119     * 
120     */
121    function banVideo(selector) {
122        var $obj = $(selector);
123        var autoplay = true;
124        if ($(window).width() > 1200 && $obj.find("video").length > 0) {
125            init();
126
127            function init() {
128                firstVideo();
129                videoEnd();
130                afterChange();
131            }
132            // 检验第一屏是否有视频
133            function firstVideo() {
134                var $firSlide = $obj.find(".slick-slide[data-slick-index=0]");
135                var $video = $firSlide.find("video");
136                // autoplay自动播放
137                if ($video.length > 0) {
138                    $obj.slick('slickPause');
139                    // 如果轮播只有一个循环播放
140                    if ($obj.get(0).slick.slideCount < 2) {
141                        $video.attr("loop", "loop");
142                    };
143                    if ($video.get(0).paused) {
144                        setTimeout(function () {
145                            $video.get(0).play();
146                        }, 100)
147                    }
148                } else {
149                    $obj.slick('slickPlay');
150                }
151            }
152            // 切换到下一张是否有视频
153            function afterChange() {
154                $obj.on('afterChange', function (event, slick, index) {
155                    // 视频暂停并回到第一帧
156                    $obj.find("video").each(function () {
157                        var video = $(this).get(0);
158                        video.pause();
159                        video.currentTime = 0;
160                    });
161                    // 有视频则暂停轮播
162                    var $nowSlide = $(slick.$slides[index]);
163                    var $video = $nowSlide.find("video");
164                    if ($video.length > 0) {
165                        $obj.slick('slickPause');
166                        $video.get(0).play();
167                    } else {
168                        if (autoplay) {
169                            $obj.slick('slickPlay');
170                        }
171                    };
172                });
173            };
174            // 视频播完切换到下一张
175            function videoEnd() {
176                $obj.find("video").each(function () {
177                    var video = $(this).get(0);
178                    video.onended = function () {
179                        if (autoplay) {
180                            $obj.slick("next");
181                            $obj.slick('slickPlay');
182                        }
183                    };
184                });
185            };
186        } else {
187            $obj.slick('play');
188        };
189        var banvideo = {
190            play: function () {
191                $obj.slick('slickPlay');
192                autoplay = true;
193            },
194            pause: function () {
195                autoplay = false;
196                $obj.slick('slickPause');
197            }
198        }
199        return banvideo;
200    };
201    ys.banVideo = banVideo;
202
203    /**
204     *
205     * @description 下拉选择
206     * @param {String} selector - css选择器
207     * 
208     */
209    function select(selector, callback) {
210        var $obj = $(selector);
211        $obj.find(".ys_select_li").each(function () {
212            var index = $(this).index();
213            if ($(this).attr("data-id") == undefined) {
214                $(this).attr("data-id", index);
215            }
216            $(this).attr("data-value", $(this).text());
217        });
218        $obj.find(".ys_select_hd").click(function (e) {
219            e.stopPropagation();
220            // var target = $(this).siblings(".ys_select_bd").get(0);
221            $(this).toggleClass("on");
222            if ($(this).parents(".ys_select").hasClass("zindex")) { //收回
223                $(this).siblings(".ys_select_bd").removeClass("showscroll");
224                $(this).siblings(".ys_select_bd").stop().slideUp(function () {
225                    $(this).parents(".ys_select").removeClass("zindex");
226                });
227            } else { //展开
228                var self = this;
229                setTimeout(function () {
230                    $(self).parents(".ys_select").addClass("zindex");
231                }, 200);
232                $(this).siblings(".ys_select_bd").stop().slideDown(function () {
233                    $(this).mCustomScrollbar("update");
234                    $(this).addClass("showscroll");
235                });
236            }
237
238            $(".ys_select_hd").not(this).removeClass("on");
239            $(".ys_select_hd").not(this).siblings(".ys_select_bd").removeClass("showscroll").stop().slideUp();
240            var self = this;
241            setTimeout(function () {
242                $(".ys_select_hd").not(self).parents(".ys_select").removeClass("zindex");
243            }, 200);
244        })
245        $obj.find(".ys_select_bd").on("click", ".ys_select_li", function () {
246            var selectShow = $(this).text();
247            var realVal = $(this).data("value");
248            var data = $(this).data();
249            $(this).parents(".ys_select_bd").siblings(".ys_select_hd").find(".ys_select_show").val(selectShow);
250            $(this).parents(".ys_select_bd").siblings(".ys_select_hd").find(".ys_select_real").attr("data-id", data.id).val(realVal).trigger("change");
251            $(this).addClass("on").siblings().removeClass("on");
252            if (callback) {
253                callback(data);
254            }
255        });
256        // 点击页面关闭
257        $("body").click(function () {
258            $(".ys_select_hd").removeClass("on");
259            $(".ys_select_bd").removeClass("showscroll").stop().slideUp(function () {
260                $(this).parents(".ys_select").removeClass("zindex");
261            });
262        });
263        // 滚动条
264        $obj.find(".ys_select_bd").mCustomScrollbar({
265            axis: "y",
266            scrollInertia: 500,
267            theme: 'dark',
268            scrollbarPosition: "outside"
269        });
270    };
271    ys.select = select;
272
273    /**
274     * 
275     * @description 弹窗蒙层
276     * @param {String} btn  弹窗触发按钮(选择器) 
277     * @param {String} modal     对应弹窗(选择器)
278     * @param {String} scrollEle     滚动条元素(选择器)
279     * @param {Function} data     数据对应
280     * 
281     */
282    function modal(btn, modal, scrollEle, data) {
283        var $modal = $(modal);
284        // 显示
285        $("body").on("click", btn, function () {
286            var $btn = $(this);
287            $modal.stop().fadeIn();
288            //数据处理
289            if (data) {
290                appendData(data);
291
292                function appendData(data) {
293                    $.each(data, function (index, item) {
294                        var dataType = item[2];
295                        var $fromEle = $btn.find(item[0]).length > 0 ? $btn.find(item[0]) : $btn;
296                        if (dataType == "text" || !dataType) {
297                            $modal.find(item[1]).text($fromEle.text());
298                        };
299                        if (dataType == "img") {
300                            $modal.find(item[1]).attr({
301                                "src": $fromEle.attr("src")
302                            });
303                        };
304                        if (dataType == "attr") {
305                            console.log(item[3], $fromEle);
306                            $modal.find(item[1]).html($fromEle.attr(item[3]));
307                        };
308                        if (dataType == "html") {
309                            $modal.find(item[1]).html($fromEle.html());
310                        };
311                    });
312                }
313            };
314            scrollbar.hide();
315            lenis.stop();
316        });
317        // 关闭
318        $("body").on("click", ".ys_modal_close", function () {
319            $(this).parents(modal).stop().fadeOut(function () {
320                scrollbar.show();
321                lenis.start();
322                if (data) {
323                    $.each(data, function (index, item) {
324                        $modal.find(item[1]).empty();
325                    });
326                }
327            });
328        });
329        // 滚动条
330        var scrollEle = scrollEle ? scrollEle : ".ys_modal_content";
331        if (scrollEle != "noscroll") {
332            $modal.find(scrollEle).mCustomScrollbar({
333                axis: "y",
334                scrollInertia: 500,
335                theme: 'dark',
336            });
337        } else {
338            $modal.find(".ys_modal_content").addClass("noscroll")
339        };
340
341    };
342    ys.modal = modal;
343
344    /**
345     *
346     * @description 视频弹窗
347     * @param {selector} selector - css选择器
348     * @param {Boolean} autoplay - 是否弹窗自动播放video
349     * 
350     */
351    function videomodal(selector, autoplay) {
352        var $videomodal;
353        // 插入视频模版
354        if ($(".ys_videom").length > 0) {
355            $videomodal = $(".ys_videom");
356        } else {
357            var videomodal =
358                '<div class="ys_videom">' +
359                '<div class="ys_videom_container">' +
360                '<div class="ys_videom_close">' +
361                '<i class="iconfont icon-close"></i>' +
362                '</div>' +
363                '<div class="ys_videom_content">' +
364                '<div class="ys_videom_iframebox"></div>' +
365                '</div>' +
366                '</div>' +
367                '</div>';
368            $videomodal = $(videomodal);
369            $("body").append($videomodal);
370        }
371
372        var Vmodal = {
373            $self: $videomodal,
374            close: function () {
375                scrollbar.show();
376                lenis.start();
377                $videomodal.hide();
378                $videomodal.find(".ys_videom_video").remove();
379                $videomodal.find(".ys_videom_iframebox").hide().find("iframe").remove();
380
381            },
382            show: function () {
383                scrollbar.hide();
384                lenis.stop();
385                $videomodal.show();
386            }
387        }
388
389        $("body").on("click", selector, function () {
390            // 视频类型是video还是iframe
391            var videoType = $(this).attr("data-type");
392            //src
393            var videoSrc = $(this).attr("data-src");
394            if (videoType == "video") { // 视频
395                if ($videomodal.find(".ys_videom_video").length > 0) {
396                    $videomodal.find(".ys_videom_video").remove();
397                }
398                //video视频封面图
399                var videoPoster = $(this).data("poster");
400                var $video = $('<video playsinline x5-video-player-type="h5" controls class="ys_videom_video"></video>')
401                if ($(window).width() < 767 && videoSrc.indexOf("http") != -1) {
402                    $video = $('<video muted playsinline x5-video-player-type="h5" controls class="ys_videom_video"></video>')
403                    $video.get(0).muted = false;
404                }
405                $video.append($("<source src=" + videoSrc + ">"));
406                $video.attr("poster", videoPoster);
407                $videomodal.find(".ys_videom_content").append($video);
408                $video.stop().show();
409                if (autoplay) {
410                    $video.get(0).play();
411                }
412            } else if (videoType == "iframe") { // iframe
413                $videomodal.find(".ys_videom_iframebox").stop().show().html(videoSrc);
414            } else {
415                return;
416            };
417            Vmodal.show();
418        });
419
420
421        $videomodal.on("click", ".ys_videom_close", function () {
422            Vmodal.close();
423        });
424    }
425    ys.videomodal = videomodal;
426
427    /**
428     *
429     * @description 滚动条初始化
430     * @param {String} selector - css选择器
431     * @param {Boolean} inside - 滚动条占用内容区
432     * @param {String} inside - 滚动条方向
433     * 
434     */
435    function mCustomScrollbarInit(selector, inside, axis) {
436        var $obj = $(selector);
437        scrollbarAxis = axis ? axis : "y";
438        scrollbarPosition = inside ? "inside" : "outside";
439        $obj.mCustomScrollbar({
440            axis: scrollbarAxis,
441            scrollInertia: 500,
442            theme: 'dark',
443            scrollbarPosition: scrollbarPosition,
444        });
445    };
446    ys.mCustomScrollbarInit = mCustomScrollbarInit;
447
448    /**
449     *
450     * @description 数字滚动
451     * @param {String} selector - css选择器
452     * @param {Boolean} addZero - 是否补0
453     * @param {Number} speed - 滚动速度(ms)
454     * 
455     */
456    function numRoll(selector, addZero, speed) {
457        var $ele = $(selector);
458        var speed = speed || 1000;
459        $ele.appear(function () {
460            var realContent = $(this).text();
461            $(this).width($(this).width());
462            var content = $(this).data("to");
463            if (!content) {
464                content = realContent;
465            };
466            var to = parseFloat(content.toString().replace(/,/g, ""));
467            var length = parseInt(to).toString().length;
468            var hasDou = false;
469            var contentArr = content.toString().split(",");
470            if (contentArr[1]) {
471                hasDou = true;
472            };
473            if (addZero) {
474                formatter = function (value, options) {
475                    var myValue = value.toFixed(options.decimals);
476                    var valLength = parseInt(myValue).toString().length;
477                    for (var i = 0; i < (length - valLength); i++) {
478                        myValue = "0" + myValue;
479                    }
480                    if (hasDou) {
481                        myValue = toThousands(myValue);
482                    }
483                    return myValue;
484                }
485            } else {
486                formatter = function (value, options) {
487                    var myValue = value.toFixed(options.decimals);
488                    if (hasDou) {
489                        myValue = toThousands(myValue);
490                    }
491                    return myValue;
492                }
493            }
494
495
496            function toThousands(num) {
497                return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
498            }
499
500            $(this).countTo({
501                speed: speed,
502                refreshInterval: 60,
503                formatter: formatter,
504                onComplete: function () {
505                    $(this).removeAttr("style");
506                    $(this).text(realContent);
507                }
508            });
509        });
510    }
511    ys.numRoll = numRoll;
512
513
514    /**
515     *
516     * @description 解决bshare乱码
517     * @param {String} title - 分享的标题文字
518     * @param {String} summary - 分享的内容文字
519     * 
520     */
521    function shareInit(title, summary) {
522        var title = title ? encodeURI(title) : encodeURI($("h1").text());
523        var summary = summary ? encodeURI(summary) : encodeURI($("p").eq(0).text().replace(" ", ""));
524        // bShare.addEntry({
525        //     title: title,
526        //     summary: summary
527        // });
528        // 微信
529        $(".ys_share_wechat").click(function () {
530            var $wechatpop;
531            // 插入微信分享二维码弹窗
532            if ($(".ys_wechat").length > 0) {
533                $wechatpop = $(".ys_wechat");
534            } else {
535                var wechatpop =
536                    '<div class="ys_wechat">' +
537                    '<div class="ys_wechat_cont">' +
538                    '<div id="qrcode">' +
539                    '<div class="ys_wechat_cont_parga">' +
540                    '<p></p>' +
541                    '</div>' +
542                    '<div class="ys_wechat_cont_btn">' +
543                    '<i class="iconfont icon-close"></i>' +
544                    '</div>' +
545                    '</div>' +
546                    '</div>' +
547                    '</div>';
548                $wechatpop = $(wechatpop);
549                $("body").append($wechatpop);
550            }
551            var length = $(".ys_wechat_cont canvas").length;
552            console.log(length);
553            if (length > 0) {
554                $(".ys_wechat_cont canvas").remove();
555            }
556            var urlho = window.location.href;
557            $('#qrcode').qrcode(urlho);
558            $(".ys_wechat").stop().fadeIn();
559            scrollbar.hide();
560            lenis.stop();
561
562            $wechatpop.on("click", ".ys_wechat_cont_btn", function () {
563                $(".ys_wechat").stop().fadeOut(function () {
564                    scrollbar.show();
565                    lenis.start();
566                });
567            });
568        })
569        // 微博
570        if ($(".ys_share_sinaminiblog").length > 0) {
571            var blogUrlf = (window.location.href);
572            var blogLink = 'https://service.weibo.com/share/share.php?url=' + blogUrlf + '&title=' + title + ' - ' + summary;
573            var blogTitle = $(".ys_share_sinaminiblog").attr("title");
574            $(".ys_share_sinaminiblog").attr("title", blogTitle).css("cursor", "pointer").click(function () {
575                window.open(blogLink, "_blank");
576            });
577        }
578        // Twitter
579        if ($(".ys_share_twitter").length > 0) {
580            var twiUrlf = (window.location.href);
581            console.log(twiUrlf);
582            var twiLink = 'https://twitter.com/intent/tweet?text=' + title + " " + twiUrlf;
583            var twiTitle = $(".ys_share_twitter").attr("title");
584            $(".ys_share_twitter").attr("title", twiTitle).css("cursor", "pointer").click(function () {
585                window.open(twiLink, "_blank");
586            });
587        }
588        // Facebook
589        if ($(".ys_share_facebook").length > 0) {
590            var faceUrlf = (window.location.href);
591            console.log(faceUrlf);
592            var faceLink = 'https://www.facebook.com/share.php?src=bm&u=' + faceUrlf;
593            var faceTtitle = $(".ys_share_facebook").attr("title");
594            $(".ys_share_facebook").attr("title", faceTtitle).css("cursor", "pointer").click(function () {
595                window.open(faceLink, "_blank");
596            });
597        }
598    }
599    ys.shareInit = shareInit;
600
601    /**
602     *
603     * @description 侧边固定
604     * @param {String} nav - 侧边导航最外面的盒子
605     * @param {String} area - 侧边导航显示的区域
606     * 
607     */
608    function asideNav(nav, area) {
609        var nav = $(nav);
610        var area = $(area);
611        // 初始化
612        asideInit();
613        // 页面加载完重新初始化
614        $(window).on("load", function () {
615            asideInit();
616        });
617        // 页面尺寸改变重新初始化
618        $(window).resize(function () {
619            asideInit();
620        });
621        // 滚动事件监听
622        $(window).scroll(function () {
623            getInto();
624        });
625
626        function getInto() {
627            var heightb = $(window).scrollTop();
628            var contentTop = area.offset().top;
629            var contentBot = (contentTop + area.height()) - $(window).scrollTop() - nav.height();
630            // console.log(heightb,contentTop,contentBot);
631            if (heightb > contentTop) {
632                nav.addClass('ys_fixed');
633            } else {
634                nav.removeClass('ys_fixed');
635            }
636            if (contentBot < 0) {
637                nav.addClass('ys_notfixed');
638
639            } else {
640                nav.removeClass('ys_notfixed');
641            }
642        }
643
644        function asideInit() {
645            getInto();
646        }
647    }
648    ys.asideNav = asideNav;
649    /**
650     *
651     * @description 移动端导航初始化
652     * @param {Number} style - 
653     * 
654     */
655    function phNavInit(style) {
656        switch (style) {
657            case 1:
658                phNavInit1();
659                break;
660            case 2:
661                phNavInit2();
662                break;
663            case 3:
664                phNavInit3();
665                break;
666            case 4:
667                phNavInit4();
668                break;
669            default:
670                phNavInit1();
671        }
672
673        function phNavInit1() {
674            // menu按钮点击
675            $(".ys_phnav_menubtn").click(function () {
676                // 显示隐藏滚动条
677                if ($(this).hasClass("on")) {
678                    ys.scrollbar.show();
679                    ys.lenisStart();
680                } else {
681                    ys.scrollbar.hide();
682                    ys.lenisStop();
683                }
684                // 按钮样式
685                $(this).toggleClass("on");
686                // 下拉展开
687                $(".ys_phnav_menu").stop().slideToggle();
688            });
689
690            // nav点击展开
691            $(".ys_phnav_lisbox").click(function () {
692                var $subNav = $(this).siblings("ul");
693                if ($subNav.length > 0) {
694                    $(this).find(".ys_phnav_icon").toggleClass("on");
695                    $subNav.stop().slideToggle();
696                }
697                $(this).parent().siblings().find("ul").stop().slideUp();
698                $(this).parent().siblings().find(".ys_phnav_icon").removeClass("on");
699            });
700
701            $(".ys_phnav_lisbox a").click(function (e) {
702                e.stopPropagation();
703            });
704        }
705
706        function phNavInit2() {
707            // 搜索下拉
708            $(".ys_phnavss_btn").click(function (e) {
709                e.stopPropagation();
710                $(".ys_phnavss_xl").stop().slideToggle();
711                if ($(".ys_phnav_menubtn").hasClass("on")) {
712                    $(".ys_phnav_menubtn").trigger("click");
713                }
714                $(this).toggleClass("on");
715            });
716            $(".ys_phnavss_xl").click(function (e) {
717                e.stopPropagation();
718            });
719            $("body").click(function () {
720                $(".ys_phnavss_xl").stop().slideUp();
721            })
722            // menu按钮点击
723            $(".ys_phnav_menubtn").click(function (e) {
724                e.stopPropagation();
725                if ($(".ys_phnavss_btn").hasClass("on")) {
726                    $(".ys_phnavss_btn").trigger("click");
727                }
728                // 显示隐藏滚动条
729                if ($(this).hasClass("on")) {
730                    ys.scrollbar.show();
731                    ys.lenisStart();
732                } else {
733                    ys.scrollbar.hide();
734                    ys.lenisStop();
735                    $(".ys_phnav2_lang_modal").removeClass("on");
736                }
737                // 按钮样式
738                $(this).toggleClass("on");
739                // 下拉展开
740                $(".ys_phnav_menu").toggleClass("on");
741            });
742
743            // nav点击展开
744            $(".ys_phnav_lisbox").click(function () {
745                var $subNav = $(this).siblings("ul");
746                if ($subNav.length > 0) {
747                    $(this).find(".ys_phnav_icon").toggleClass("on");
748                    $subNav.stop().slideToggle();
749                }
750                $(this).parent().siblings().find("ul").stop().slideUp();
751                $(this).parent().siblings().find(".ys_phnav_icon").removeClass("on");
752            });
753
754            $(".ys_phnav_lisbox a").click(function (e) {
755                e.stopPropagation();
756            });
757
758            // 语言弹框
759            $(".ys_phnav2_lang_btn").click(function () {
760                $(".ys_phnav2_lang_modal").addClass("on");
761            });
762
763            $(".ys_phnav2_lang_back").click(function () {
764                $(".ys_phnav2_lang_modal").removeClass("on");
765            });
766        }
767
768        function phNavInit3() {
769            // 搜索弹窗
770            ys.modal(".ys_phnavss_btn", ".ys_phnavss_modal");
771            // menu按钮点击
772            $(".ys_phnav_menubtn").click(function () {
773                // 隐藏滚动条
774                ys.scrollbar.hide();
775                ys.lenisStop();
776                // 按钮样式
777                $(this).addClass("on");
778                $(".ys_phnav_menu").addClass("on");
779            });
780            //menu关闭按钮点击
781            $(".ys_phmenu_close").click(function () {
782                // 显示滚动条
783                ys.scrollbar.show();
784                ys.lenisStart();
785                // 按钮样式
786                $(".ys_phnav_menubtn").removeClass("on");
787                $(".ys_phnav_menu").removeClass("on");
788            });
789
790            // nav点击展开
791            $(".ys_phnav_lisbox").click(function () {
792                var $subNav = $(this).siblings(".ys_phsubnav_modal");
793                if ($subNav.length > 0) {
794                    $subNav.addClass("on");
795                }
796            });
797
798            $('.ys_phnav_lisbox a').click(function (e) {
799                e.stopPropagation();
800            });
801
802            // nav返回点击
803            $(".ys_phsubnav_close").click(function () {
804                $(this).parents(".ys_phsubnav_modal").eq(0).removeClass("on");
805            });
806
807            // 语言下拉
808            $(".ys_phnav3_lang_hd").click(function () {
809                $(this).toggleClass("on");
810                $(".ys_phnav3_lang_bd").stop().slideToggle();
811            });
812
813            $('.ys_phnav3_lang_hd a').click(function (e) {
814                e.stopPropagation();
815            });
816
817        }
818
819        function phNavInit4() {
820            // 搜索弹窗
821            ys.modal(".ys_phnavss_btn", ".ys_phnavss_modal")
822            // menu按钮点击
823            $(".ys_phnav_menubtn").click(function () {
824                // 显示隐藏滚动条
825                if ($(this).hasClass("on")) {
826                    ys.scrollbar.show();
827                    ys.lenisStart();
828                } else {
829                    ys.scrollbar.hide();
830                    ys.lenisStop();
831                }
832                // 按钮样式
833                $(this).toggleClass("on");
834                // 下拉展开
835                $(".ys_phnav_menu").stop().slideToggle();
836            });
837
838            // nav点击展开
839            $(".ys_phnav_lisbox").click(function () {
840                var $subNav = $(this).siblings("ul");
841                if ($subNav.length > 0) {
842                    $(this).find(".ys_phnav_icon").toggleClass("on");
843                    $subNav.stop().slideToggle();
844                }
845                $(this).parent().siblings().find("ul").stop().slideUp();
846                $(this).parent().siblings().find(".ys_phnav_icon").removeClass("on");
847            });
848
849            $(".ys_phnav_lisbox a").click(function (e) {
850                e.stopPropagation();
851            });
852        }
853
854    }
855    ys.phNavInit = phNavInit;
856
857    /**
858     *
859     * @description 通过js调用animate.css的动画
860     * @param {String} ele - 动画的元素
861     * @param {String} animate - 动画的名字
862     * @param {Function} callback - 动画执行完的回调函数
863     * 
864     */
865    function animateCss(ele, animate, callback) {
866        var $ele = $(ele);
867        var duration = $ele.css("animation-duration");
868        duration == '0s' ? duration = 1000 : duration = parseFloat(duration) * 1000;
869        $ele.addClass('animated ' + animate);
870        if (callback == "show") {
871            $ele.stop().show();
872        };
873        setTimeout(function () {
874            if (callback == "hide") {
875                $ele.stop().hide();
876            } else if (callback != "show" && callback) {
877                callback();
878            }
879            $ele.removeClass(animate);
880        }, duration);
881
882    };
883    ys.animateCss = animateCss;
884
885    //检查页面是否缩放
886    function checkViewport() {
887        //FF 谷歌
888        if (window.devicePixelRatio > 1 || window.devicePixelRatio < 1) {
889            alert('当前页面缩放比例异常,请设置成100%')
890        }
891        //IE
892        if (window.screen.deviceXDPI != window.screen.logicalXDPI) {
893            alert('当前页面缩放比例异常,请设置成100%')
894        }
895    }
896    ys.checkViewport = checkViewport;
897
898    // 重新加载main.css和midea.css
899    function reloadCss() {
900        $("link").each(function () {
901            var href = $(this).attr("href");
902            if (href.indexOf("main.css") > 0 || href.indexOf("media.css") > 0) {
903                $(this).attr("href", href + '?' + new Date().getTime());
904            }
905        });
906    }
907    ys.reloadCss = reloadCss;
908
909    // 暂停所有slick轮播
910    function stopSlick() {
911        $(".slick-slider").slick("pause");
912    }
913    ys.stopSlick = stopSlick;
914
915    /**
916     *
917     * @description 锚点定位
918     * @param {String} reg - 路由拼接
919     * @param {Number} navHeight - pc导航高度
920     * @param {Number} time - 滑动的时间
921     */
922    function yxtop(reg, navHeight, time) {
923        $(window).on("load", function () {
924            init(reg, navHeight, time);
925        });
926
927        function init(reg, navHeight, time) {
928            var reg = reg || "tp=";
929            var navHeight = navHeight || $(".ys_hd_pc").height() || 0;
930            var time = time || 500;
931            if ($(window).width() < 1200) {
932                navHeight = 64;
933            }
934            var strArr = (window.location.href).split(reg);
935            if (!isNaN(strArr[1])) {
936                $("html,body").animate({
937                    scrollTop: $('[data-page="' + strArr[1] + '"]').offset().top - navHeight
938                }, time);
939            }
940        }
941    }
942    ys.yxtop = yxtop;
943
944    // 页面平滑滚动
945    function yxlenis() {
946        lenis = new Lenis()
947
948        lenis.on('scroll', (e) => {
949            // console.log(e)
950        })
951
952        function raf(time) {
953            lenis.raf(time)
954            requestAnimationFrame(raf)
955        }
956
957        requestAnimationFrame(raf)
958    }
959    ys.yxlenis = yxlenis;
960
961    function lenisStop() {
962        lenis.stop();
963    }
964    ys.lenisStop = lenisStop;
965
966    function lenisStart() {
967        lenis.start();
968    }
969    ys.lenisStart = lenisStart;
970
971    /**
972     * @description 判断是否为IE浏览器
973     *
974     */
975    function isIE() {
976        if (!!window.ActiveXObject || "ActiveXObject" in window) {
977            return true;
978        } else {
979            return false;
980        }
981    }
982    ys.isIE = isIE;
983
984    // a链接拼接字符串
985    function concatHref(str, selector) {
986        var $ele = selector ? $(selector) : $("a");
987        $ele.each(function () {
988            var oldHref = $(this).attr("href");
989            if (oldHref && oldHref != undefined) {
990                if (oldHref.indexOf("javascript") == -1) {
991                    if (oldHref.indexOf("?") == -1) {
992                        oldHref = oldHref + "?";
993                    }
994                    $(this).attr("href", oldHref + str)
995                }
996            }
997        })
998    }
999    ys.concatHref = concatHref;
1000
1001    // slick滚动到自动轮播
1002    function slickAuto(accy) {
1003        var accy = accy || 0;
1004        $(this).appear(function () {
1005            $(this).slick("play");
1006        }, {
1007            accY: accy
1008        })
1009    }
1010    $.fn.slickAuto = slickAuto;
1011
1012    window.ys = ys;
1013}(window));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.