PageSourceSearch

https://0599.fun/themes/tuan/js/index.js?v=20260107211

js 0599.fun collected 2026-10-09 04:33:02 UTC 11,398 bytes, 392 lines download raw bytes

1var
2  $loading = $('#loading'),
3  $commentList = $('#hot-ul'),
4  totalHeight = 0,  // 滚动距离 + 窗口高度
5  timer = null,     // 计时器
6  jqueryXhr = null; // jquery-ajax 对象
7var isloading=true;
8var firstslider=0;
9function setcategorylist(id,name)
10{
11	$("#hot-ul").attr("data-categoryid",id);
12	$("#hot-ul").attr("data-page","0");
13	$("#hot-ul").attr("data-total-pages","0");
14	$("#hot-ul").html("");
15	$("#emptymyorder").hide();
16	$("#prompt").hide();
17	sessionStorage.setItem(key1, "") ;
18	sessionStorage.setItem(key2, "") ;
19	main.nextPageFavourableComments(1,1);
20}
21
22var val = 0;
23var timeout = null;
24$(document).ready(function(){ 
25	$("#topsearchBtn").click(function(){
26		var url=$(this).data("url")+"?keyword="+($("#keyword").val())	;
27		window.location.href=url;
28		return false;
29	})
30	$(".category-item li").click(function(){
31		$(".category-item li").removeClass("active");
32		$(this).addClass("active");
33		$("#hot-ul").attr("data-page","0");
34		$("#hot-ul").attr("data-total-pages","0");
35		$("#hot-ul").attr("data-paixu",$(this).attr("data-info"));
36		$("#hot-ul").html("");
37		$("#emptymyorder").hide();
38		$("#prompt").hide();
39		sessionStorage.setItem(key1, "") ;
40	    sessionStorage.setItem(key2, "") ;
41		main.nextPageFavourableComments(1,1);
42	});
43	$("#searchBtn").click(function(){
44		$("#hot-ul").attr("data-keyword",$("#keyword").val());
45		$("#hot-ul").attr("data-page","0");
46		$("#hot-ul").attr("data-total-pages","0");
47		$("#hot-ul").html("");
48		$("#emptymyorder").hide();
49		$("#prompt").hide();
50		sessionStorage.setItem(key1, "") ;
51	    sessionStorage.setItem(key2, "") ;
52		main.nextPageFavourableComments(1,1);				  
53	})
54	if( $("#loadcomment").length>0 )
55    {
56		main.loadcomment();
57	}
58	var totaln=0; 
59	if( $("#hot-ul").length>0 )
60    {
61        // 向下滑动屏幕加载下一页
62        (function(){
63            $(window).scroll(function() {
64				if(isloading)
65				{
66					totalHeight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
67					var totalPages = parseInt($commentList.data('total-pages'));
68					var page = parseInt($commentList.data('page')) + 1;
69					if (totalHeight + 50 >= $(document).height()) {
70						if(totalPages > 0 ){
71							isloading=false;
72							$loading.show();
73							setTimeout(function(){
74								main.nextPageFavourableComments(page,1);
75							}, 50);
76						}
77					}
78				}
79            });
80        })();
81		var p = 1;
82        if (sessionStorage[key2]  && setkill=="1") {
83            p = parseInt(sessionStorage[key2]);
84        }
85		function getdata()
86		{
87			if(totaln>=1000)
88		   {
89			   $(document.body).trigger('wptLoading_view:hide');
90			   main.nextPageFavourableComments(1,p);
91		   }
92		   else{
93			   if( $("#hot-ul").attr('data-lat')=="0" )
94			   {
95				   totaln++;
96				   setTimeout(function(){getdata();},10);
97			   }
98			   else
99			   {
100				   $(document.body).trigger('wptLoading_view:hide');
101				   main.nextPageFavourableComments(1,p);
102			   }
103		   }
104		}
105		if($("#hot-ul").attr('data-lat')=="0" && $("#hot-ul").attr("data-paixu")=="3")
106		{
107			wptLoading("正在定位中...");
108			setTimeout(function(){getdata();},10);
109		}
110		else
111		{
112			main.nextPageFavourableComments(1,p);
113		}
114		
115		if (window.addEventListener && setkill=="1") {
116            window.addEventListener('unload',
117            function() {
118                sessionStorage.setItem(key1, val)
119            },
120            false);
121            window.addEventListener('scroll',
122            function() {
123                clearTimeout(timeout);
124                timeout = setTimeout(function() {
125                    val = window.pageYOffset;
126                },
127                500);
128            },
129            false);
130            document.addEventListener('touchmove',
131            function() {
132                clearTimeout(timeout);
133                timeout = setTimeout(function() {
134                    val = window.pageYOffset;
135                },
136                500);
137            },
138            false);
139        }
140    }
141	$(".morebuy").click(function(){
142		$("#qianggoubg").show();	
143		$("#qianggou").show();						 
144	});
145	$("#qianggoubg,.sku-cancel").click(function(){
146		$("#qianggoubg").hide();	
147		$("#qianggou").hide();						 
148	});
149	$("#selectedNumber").on({
150        blur: function() {
151            var e = $("#selectedNumber").val(),
152            o = $("#maxNumber").val();
153			if(parseInt(e)>parseInt(o) )
154			{
155				e=o;
156			}
157			$("#selectedNumber").val(e);
158            $("#buyNum").text(e);
159        },
160        keydown: function(e) {
161            if (console.log(e.keyCode), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || 8 == e.keyCode)) return ! 1
162        }
163    })
164	 $("#reduceNumber").click(function() {
165        var e = $("#selectedNumber"),
166        o = 1;
167		if(parseInt(e.val()) >1 )
168		{
169			o = parseInt(e.val()) - 1;
170		}
171        e.val(o);
172        $("#buyNum").text(o);
173    })
174    $("#addNumber").click(function() {
175        var e = $("#selectedNumber"),
176        o = $("#maxNumber").val();
177		if(parseInt(o)>parseInt(e.val()) )
178		{
179			o = parseInt(e.val()) + 1;
180		}
181        e.val(o);
182        $("#buyNum").text(o);
183    })
184	if( $(".daojishi").length>0)
185	{
186		main.countdown();
187	}
188})
189
190function replay(a,o)
191{
192	wptRedirect($("#woyaopinglun").attr("href")+'&topid='+a);
193}
194var se;
195var lastid=0;
196var main=
197{
198	countdown:function()
199	{
200		window.clearInterval(se);
201		se=setInterval(function() {
202			$(".daojishi").each(function() { 
203				var t = $(this).attr('data-time');
204				t = t-100;
205				var d=Math.floor(t/1000/60/60/24);
206				var h=Math.floor(t/1000/60/60%24);
207				var m=Math.floor(t/1000/60%60);
208				var s=Math.floor(t/1000%60);
209				if (t > 0) { 
210					var str=" 距结束仅剩 <span class='item d'>"+d+"</span>
210天 <span class='item h'>"+( h<10?"0"+h:h)+"</span>时 <span class='item m'>"+( m<10?"0"+m:m)+"</span>分 <span class='item s'>"+( s<10?"0"+s:s)+"</span>秒 ";
211				}
212				$(this).attr('data-time',t);
213				$(this).html(str); 		
214			})
215		},100);
216	},
217	nextPageFavourableComments:function(page, cc){
218		$loading.show();
219		$(".morecompany").hide();
220		if(cc>5)
221		{
222			sessionStorage.setItem(key1, 0)
223			cc=1;
224		}
225		if(jqueryXhr){
226			// 终止之前的未结束的ajax请求,重新开始新的请求
227			jqueryXhr.abort();
228		}
229		jqueryXhr = $.ajax({
230			url: domainurl+"/tool/tuanlistjson/?i="+$commentList.data('id')+"&version="+new Date(),
231			cache:false,
232			data: {"page":page,"cc": cc,"a":$commentList.attr('data-areaid'),"remen":$commentList.attr('data-remen'),"keyword":$commentList.attr('data-keyword'),"c":$commentList.attr('data-categoryid'),"paixu":$commentList.attr('data-paixu'),"lat":$commentList.attr('data-lat'),"lng":$commentList.attr('data-lng'),"lastid":lastid},
233			type: "post",
234			async: true,        // 异步请求 
235			timeout: 3000,      // 超时时间
236			dataType: "json",
237			complete: function (){
238				// 请求完成
239				jqueryXhr = null;
240			},
241			success: function (resp) {
242				if(resp.state=="success")
243				{
244					var oldpage=page;
245					if(page==1)
246					{
247						page=cc;
248					}
249					$commentList.data('total-pages', resp.count);
250					$commentList.data('page', page);
251					sessionStorage.setItem(key2, page) ;
252					lastid=resp.lastid;
253					setTimeout(function(){
254						$commentList.append(resp.html);
255						$loading.hide();
256						isloading=true;
257						if(oldpage==1 && resp.html=="")
258						{
259							$("#emptymyorder").show();
260						}
261						if( resp.count ==0 && $("#hot-ul ol").length>0)
262							$("#prompt").show();
263						if(oldpage==1 &&  setkill=="1")
264						{   //跳转到上次记录的地方
265							setTimeout(function() {
266								val = sessionStorage[key1] ? sessionStorage[key1] : 0;
267								//alert(val);
268								window.scrollTo(0, val);
269							},10);
270						}
271					}, 1);
272					
273				}
274			},
275			error:function (xhr, ts, err){
276				setTimeout(function(){
277					$loading.hide();
278				}, 500);
279			}
280		});
281	},
282	setarea:function(obj)
283	{
284		$("#hot-ul").attr("data-areaid",obj.data("sub"));
285		$("#nav-area-item").html(obj.data("name"));
286		$("#hot-ul").html("");
287		$("#emptymyorder").hide();
288		$("#prompt").hide();
289		navBarBtn.removeClass('item-active');
290		mask.css('display', 'none');
291		allNavBox.css('display','none');
292		$(".nav-bar").css("position","static").css("top","0px");
293		sessionStorage.setItem(key1, "") ;
294	    sessionStorage.setItem(key2, "") ;
295		main.nextPageFavourableComments(1,1);
296	},
297	setcategory:function(obj)
298	{
299		$("#hot-ul").attr("data-categoryid",obj.data("sub"));
300		$("#nav-category-item").html(obj.data("name"));
301		$("#hot-ul").html("");
302		$("#emptymyorder").hide();
303		$("#prompt").hide();
304		navBarBtn.removeClass('item-active');
305		mask.css('display', 'none');
306		allNavBox.css('display','none');
307		$(".nav-bar").css("position","static").css("top","0px");
308		sessionStorage.setItem(key1, "") ;
309	    sessionStorage.setItem(key2, "") ;
310		main.nextPageFavourableComments(1,1);
311	},
312	loadcomment:function()
313	{
314		if(parseInt($("#loadcomment").data("comments")) == 0)
315		{
316			$("#loadcomment").html("<span>无更多信息</span>");
317			$("#loadcomment").removeAttr("onclick");
318		}
319		else
320		{
321			$.ajax({
322				type: "post",
323				dataType: "json",
324				data: {"page":$("#loadcomment").data("page"),id:$("#loadcomment").data("id"),tuanid:$("#loadcomment").data("tuanid"),"userid":$("#loadcomment").data("userid"),"c":$("#loadcomment").data("comments"),"webid":$("#loadcomment").data("webid")},
325				url: domainurl+"/ajax/tuancommentlistjson/?i="+$("#webstationid").val()+"&version="+new Date(),
326				cache:false,
327				success: function(d){
328					if(d.state== "success") {
329						if(d.count==0)
330						{
331							$("#loadcomment").html("<span>无更多信息</span>");
332							$("#loadcomment").removeAttr("onclick");
333						}
334						$("#loadcomment").data('total-pages', d.count);
335						$("#loadcomment").data('page', ($("#loadcomment").data("page")+1));
336						$("#pinglunlist").append(d.html);
337						
338						$(".wxpreview").click(function()
339						{
340							var imgsSrc = [];
341							function reviewImage(src) {
342								if (typeof window.WeixinJSBridge != 'undefined') {
343									WeixinJSBridge.invoke('imagePreview', {
344										'current' : src,
345										'urls' : imgsSrc
346									});
347								}
348							}
349							var src=$(this).data("src");
350							$(this).parent().parent().find(".wxpreview").each(function(){
351								var n=$(this).data("src");
352								if( n ){
353									imgsSrc.push(n);
354								}															   
355							});
356							reviewImage(src);		
357						})
358					}
359					else
360					{
361						wptAlert(d.msg);
362					}
363				}
364			})
365		}
366	}
367}
368
369
370	
371$(document).ready(function()
372{ 
373	$("#nav-sort li").click(function(){
374		$("#hot-ul").attr("data-paixu",$(this).data("id"));
375		$("#nav-sort-item").html($(this).data("name"));
376		$("#hot-ul").html("");
377		$("#emptymyorder").hide();
378		$("#prompt").hide();
379		navBarBtn.removeClass('item-active');
380		mask.css('display', 'none');
381		allNavBox.css('display','none');
382		$(".nav-bar").css("position","static").css("top","0px");
383		main.nextPageFavourableComments(1);
384	})
385	$(".nav-category li").click(function(){
386		main.setcategory($(this));
387	})
388	$(".nav-area li").click(function(){
389		main.setarea($(this));
390	})
391})
392 

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.