PageSourceSearch

https://0599.fun/themes/shop/js/shop.js?v=202601072

js 0599.fun collected 2026-10-09 04:32:57 UTC 5,288 bytes, 207 lines download raw bytes

1$.extend($, {
2    autoScrolling: function(wrapper, margin_top) {
3        if ($('.topline_wrap').length > 0) {
4            $(wrapper).find('ul').animate({
5                marginTop: margin_top
6            },
7            500,
8            function() {
9                $(this).css({
10                    marginTop: '0px'
11                }).find('li').slice(0, 1).appendTo($(this))
12            })
13        }
14    }
15}); 
16
17$(function(){
18	if($("#swiper-container_menu .swiper-slide").length>1)
19	{
20		var mySwiper = new Swiper('#swiper-container_menu',{
21			pagination: '.pagination',
22			loop:true,
23			grabCursor: true,
24			autoplay: 3000,
25			autoplayDisableOnInteraction: false,
26			paginationClickable: true
27		})
28	}
29	if($(".notice_wrap li").length>2)
30	{
31		setInterval(function() {
32			$.autoScrolling('.notice_wrap', '-1rem');
33		},
34		5000);
35	}
36	//返回顶部
37	$(window).scroll(function() {
38		if ($(this).scrollTop() > 100) {
39			$('.AN_top').show().unbind('click').bind('click',
40			function() {
41				$(window).scrollTop(0);
42			});
43			var tops=$(".recommend_item").offset().top;
44			var docs=document.body.clientHeight;
45			if($(this).scrollTop() > (tops+docs+650)){
46				$("#search").addClass('fixed');
47			}else{
48				$("#search").removeClass('fixed');
49			};
50		} else {
51			$('.AN_top').hide();
52		}
53	});
54	$.init();
55});
56
57var $loading = $('#loading'),
58  totalHeight = 0,  // 滚动距离 + 窗口高度
59  timer = null,     // 计时器
60  jqueryXhr = null; // jquery-ajax 对象
61var isloading=true;
62var isshow=0;
63
64var timeout = null;
65var val = 0;
66
67$(document).ready(function(){ 
68	//返回顶部
69	$(window).scroll(function() {
70		if($(this).scrollTop() > 100) {
71			$("#gotop").show();
72		} else {
73			$("#gotop").hide();
74		};
75	});
76	$("#gotop").click(function() {
77		$(window).scrollTop(0);
78		$("#gotop").hide();
79	});
80
81	
82	$("#searchBtn").click(function(){
83		var url=$(this).data("url")+"&keyword="+($("#keyword").val())	;
84		window.location.href=url;
85	})
86	if( $("#indexlist").length>0 )
87    {
88		// 向下滑动屏幕加载下一页
89        (function(){
90             $(window).scroll(function() {
91				if(isloading)
92				{
93					totalHeight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
94					var totalPages = parseInt($('#indexlist').data('total-pages'));
95					var page = parseInt($('#indexlist').data('page')) + 1;
96					if (totalHeight + 150 >= $(document).height()) {
97						if(totalPages > 0 ){
98							isloading=false;
99							$('#loading').show();
100							setTimeout(function(){
101								main.nextPageFavourableComments(page, 1);
102							}, 50);
103						}
104					}
105				}
106            });
107        })();
108		
109		var p = 1;
110        if (sessionStorage[key2]  && setkill=="1") {
111            p = parseInt(sessionStorage[key2]);
112        }
113	    main.nextPageFavourableComments(1,p);
114		
115		if (window.addEventListener && setkill=="1") {
116
117            window.addEventListener('unload',
118            function() {
119                sessionStorage.setItem(key1, val)
120            },
121            false);
122
123            window.addEventListener('scroll',
124            function() {
125                clearTimeout(timeout);
126                timeout = setTimeout(function() {
127                    val = window.pageYOffset;
128                },
129                500);
130            },
131            false);
132
133            document.addEventListener('touchmove',
134            function() {
135                clearTimeout(timeout);
136                timeout = setTimeout(function() {
137                    val = window.pageYOffset;
138                },
139                500);
140            },
141            false);
142        }
143    }
144});
145
146
147var main={
148	nextPageFavourableComments:function(page,cc){
149		$loading.show();
150		if(jqueryXhr){
151			// 终止之前的未结束的ajax请求,重新开始新的请求
152			jqueryXhr.abort();
153		}
154		if(cc>20)
155		{
156			sessionStorage.setItem(key1, 0)
157			cc=1;
158		}
159		jqueryXhr = $.ajax({
160			url: domainurl+"/tool/shoplistjson/?i="+$("#indexlist").data('id')+"&version="+new Date(),
161			cache:false,
162			data: {"page":page,"cc": cc,"size":20,"remai":1,"paixu":$("#indexlist").data('paixu')},
163			type: "post",
164			async: true,        // 异步请求 
165			timeout: 3000,      // 超时时间
166			dataType: "json",
167			complete: function (){
168				jqueryXhr = null;
169			},
170			success: function (resp) {
171				if(resp.state=="success")
172				{
173					var oldpage=page;
174					if(page==1)
175					{
176						page=cc;
177					}
178					$('#indexlist').data('total-pages', resp.count);
179					$('#indexlist').data('page', page);
180					sessionStorage.setItem(key2, page) ;
181					
182					setTimeout(function(){
183						$("#indexlist").append(resp.html);
184						$loading.hide();
185						isloading=true;
186						var imgwidth=$(".sjlists01111").width();
187						$(".sjlists01111").height(imgwidth);
188						if(oldpage==1 && setkill=="1")
189						{   //跳转到上次记录的地方
190							setTimeout(function() {
191								val = sessionStorage[key1] ? sessionStorage[key1] : 0;
192								//alert(val);
193								window.scrollTo(0, val);
194							},10);
195						}
196					}, 1);
197					
198				}
199			},
200			error:function (xhr, ts, err){
201				setTimeout(function(){
202					$loading.hide();
203				}, 500);
204			}
205		});
206	}	
207}

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.