PageSourceSearch

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

js 0599.fun collected 2026-10-09 04:33:05 UTC 14,540 bytes, 478 lines download raw bytes

1var $loading = $('#loading'), $commentList = $('#hot-ul'),totalHeight = 0,  timer = null, jqueryXhr = null;
2var isloading=true;
3var firstslider=0;
4function setcategorylist(id,name)
5{
6	$("#youxuan").hide();
7	$("#hot-ul").attr("data-categoryid",id);
8	$("#hot-ul").attr("data-page","0");
9	$("#hot-ul").attr("data-total-pages","0");
10	$("#hot-ul").html("");
11	$("#emptymyorder").hide();
12	$("#prompt").hide();
13	sessionStorage.setItem(key1, "") ;
14	sessionStorage.setItem(key2, "") ;
15	main.nextPageFavourableComments(1,1);
16}
17
18var timeout = null;
19var val = 0;
20$(document).ready(function(){ 
21	$(window).scroll(function(){
22        var osTop =$(window).scrollTop();
23        if(osTop>=300){
24            $(".bgt-go-top,.go-top").css('display','block');
25        }else{
26            $(".bgt-go-top,.go-top").css('display','none');
27        }
28    });
29    $(".bgt-go-top,.go-top").click(function(){
30		$(window).scrollTop(0);
31    });
32	$(".category-item li").click(function(){
33		$(".category-item li").removeClass("active");
34		$(this).addClass("active");
35		$("#youxuan").hide();
36		$("#hot-ul").attr("data-page","0");
37		$("#hot-ul").attr("data-total-pages","0");
38		$("#hot-ul").attr("data-paixu",$(this).attr("data-info"));
39		$("#hot-ul").html("");
40		$("#emptymyorder").hide();
41		$("#prompt").hide();
42		sessionStorage.setItem(key1, "") ;
43		sessionStorage.setItem(key2, "") ;
44		main.nextPageFavourableComments(1,1);
45	});
46	$(window).scroll(function(){
47		var height = $(window).scrollTop();
48		displaytop(height);
49	});
50	$("#searchBtn").click(function(){
51		$("#youxuan").hide();
52		$("#hot-ul").attr("data-keyword",$("#keyword").val());
53		$("#hot-ul").attr("data-page","0");
54		$("#hot-ul").attr("data-total-pages","0");
55		$("#hot-ul").html("");
56		$("#emptymyorder").hide();
57		$("#prompt").hide();
58		sessionStorage.setItem(key1, "") ;
59	    sessionStorage.setItem(key2, "") ;
60		main.nextPageFavourableComments(1,1);				  
61	})
62	function displaytop(height){
63		if(height>50){$("#fengmian_top").css("background-color","#FF6633");}
64		if(height<=50){$("#fengmian_top").css("background-color","#ed414a");}
65	}
66	if( $("#loadcomment").length>0 )
67    {
68		main.loadcomment();
69	}
70	if( $("#loadbuylist").length>0 )
71    {
72		main.loadbuylist();
73	}
74	if( $("#tuijianyouhui").length>0 )
75    {
76        (function(){
77            $(window).scroll(function() {
78				if(isloading)
79				{
80					totalHeight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
81					var totalPages = parseInt($("#tuijianyouhui").data('total-pages'));
82					var page = parseInt($("#tuijianyouhui").data('page')) + 1;
83					if (totalHeight + 50 >= $(document).height()) {
84						if(totalPages > 0 ){
85							isloading=false;
86							$('.load-more').show();
87							setTimeout(function(){
88								main.nextPageFavourableYouhui(page);
89							}, 50);
90						}
91					}
92				}
93            });
94        })();
95    }
96	if( $("#indexlist").length>0 )
97    {
98        (function(){
99            $(window).scroll(function() {
100				if(isloading)
101				{
102					totalHeight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
103					var totalPages = parseInt($commentList.data('total-pages'));
104					var page = parseInt($commentList.data('page')) + 1;
105					if (totalHeight + 50 >= $(document).height()) {
106						if(totalPages > 0 ){
107							isloading=false;
108							$loading.show();
109							setTimeout(function(){
110								main.nextPageFavourableComments(page,1);
111							}, 1);
112						}
113					}
114				}
115            });
116        })();
117		if($(".category-item .active").length>0)
118		{
119			$("#hot-ul").data("paixu",$(".category-item .active").data("info"));
120		}
121		var p = 1;
122        if (sessionStorage[key2]  ) {
123            p = parseInt(sessionStorage[key2]);
124        }
125	    main.nextPageFavourableComments(1,p);
126	   
127	   if (window.addEventListener) {
128
129            window.addEventListener('unload',
130            function() {
131                sessionStorage.setItem(key1, val)
132            },
133            false);
134
135            window.addEventListener('scroll',
136            function() {
137                clearTimeout(timeout);
138                timeout = setTimeout(function() {
139                    val = window.pageYOffset;
140                },
141                500);
142            },
143            false);
144
145            document.addEventListener('touchmove',
146            function() {
147                clearTimeout(timeout);
148                timeout = setTimeout(function() {
149                    val = window.pageYOffset;
150                },
151                500);
152            },
153            false);
154        }
155    } 
156	$("#qianggoubg,.sku-cancel").click(function(){
157		$("#qianggoubg").hide();	
158		$("#qianggou").hide();						 
159	});
160	$("#selectedNumber").on({
161        blur: function() {
162            var e = $("#selectedNumber").val(),
163            o = $("#maxNumber").val();
164			if(parseInt(e)>parseInt(o) )
165			{
166				e=o;
167			}
168			$("#selectedNumber").val(e);
169            $("#buyNum").text(e);
170        },
171        keydown: function(e) {
172            if (console.log(e.keyCode), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || 8 == e.keyCode)) return ! 1
173        }
174    })
175	 $("#reduceNumber").click(function() {
176        var e = $("#selectedNumber"),
177        o = 1;
178		if(parseInt(e.val()) >1 )
179		{
180			o = parseInt(e.val()) - 1;
181		}
182        e.val(o);
183        $("#buyNum").text(o);
184    })
185    $("#addNumber").click(function() {
186        var e = $("#selectedNumber"),
187        o = $("#maxNumber").val();
188		if(parseInt(o)>parseInt(e.val()) )
189		{
190			o = parseInt(e.val()) + 1;
191		}
192        e.val(o);
193        $("#buyNum").text(o);
194    })
195})
196
197function replay(a,o)
198{
199	wptRedirect($("#woyaopinglun").attr("href")+'&topid='+a);
200}
201var se;
202var main=
203{
204	countdown:function()
205	{
206		window.clearInterval(se);
207		se=setInterval(function() {
208			$(".daojishi").each(function() { 
209				var t = $(this).attr('data-time');
210				t = t-100;
211				var d=Math.floor(t/1000/60/60/24);
212				var h=Math.floor(t/1000/60/60%24);
213				var m=Math.floor(t/1000/60%60);
214				var s=Math.floor(t/1000%60);
215				if (t > 0) { 
216					var str = d + "天" + ( h<10?"0"+h:h) + "时" + ( m<10?"0"+m:m) + "分" + ( s<10?"0"+s:s)+"秒"; 
217				}
218				else { 
219					var str = "进行中……"; 
220				} 
221				$(this).attr('data-time',t);
222				$(this).html(str); 		
223			})
224		},100);
225	},
226	loadpercent:function(youhuiid,result)
227	{
228		$('#precent'+youhuiid).width(result+"%");;
229        document.getElementById('precent' +youhuiid).style.width =result+"%";;
230	},
231	nextPageFavourableYouhui:function(page){
232		$('.load-more').show();
233		if(jqueryXhr){
234			jqueryXhr.abort();
235		}
236		jqueryXhr = $.ajax({
237			url: domainurl+"/asyn/assistyouhuiasynlist/?i="+$("#indexlist").data('id')+"&version="+new Date(),
238			cache:false,
239			data: {"page":page,"s":$("#tuijianyouhui").data('s'),"selfid":$("#tuijianyouhui").data('selfid'),webid:$("#tuijianyouhui").data("webid"),topid:$("#tuijianyouhui").data("topid"),xiao:$("#tuijianyouhui").data("xiao"),key:$("#tuijianyouhui").data("key")},
240			type: "post",
241			async: true,        // 异步请求 
242			timeout: 3000,      // 超时时间
243			dataType: "json",
244			complete: function (){
245				jqueryXhr = null;
246			},
247			success: function (resp) {
248				if(resp.state=="success")
249				{
250					$("#tuijianyouhui").data('total-pages', resp.count);
251					$("#tuijianyouhui").data('page', page);
252					setTimeout(function(){
253						$("#tuijianyouhui").append(resp.html);
254						$('.load-more').hide();
255						isloading=true;
256						if(page==1 && resp.html=="")
257						{
258							$(".homepage-section").hide();
259							$(".afc-orders-empty").show();
260						}
261						if( resp.count <=0 && $("#tuijianyouhui a").length>0)
262							$("#prompt").show();
263					}, 1);
264					
265				}
266			},
267			error:function (xhr, ts, err){
268				setTimeout(function(){
269					$('.load-more').hide();
270				}, 500);
271			}
272		});
273	},
274	nextPageFavourableComments:function(page,cc){
275		$loading.show();
276		$(".morecompany").hide();
277		if(jqueryXhr){
278			jqueryXhr.abort();
279		}
280		if(cc>5)
281		{
282			cc=1;	
283		}
284		jqueryXhr = $.ajax({
285			url: domainurl+"/asyn/qianggouasynlist/?i="+$commentList.data('id')+"&version="+new Date(),
286			cache:false,
287			data: {"page":page,"cc": cc,"a":$commentList.data('areaid'),"keyword":$commentList.data('keyword'),"c":$commentList.data('categoryid'),"paixu":$commentList.data('paixu'),"lat":$commentList.data('lat'),"lng":$commentList.data('lng'),webwuzhekakill:$commentList.data("webwuzhekakill"),webwuzhekaname:$commentList.data("webwuzhekaname"),webid:$commentList.data("webid"),topid:$commentList.data("topid"),xiao:$commentList.data("xiao"),key:$commentList.data("key")},
288			type: "post",
289			async: true,        // 异步请求 
290			timeout: 3000,      // 超时时间
291			dataType: "json",
292			complete: function (){
293				// 请求完成
294				jqueryXhr = null;
295			},
296			success: function (resp) {
297				if(resp.state=="success")
298				{
299					var oldpage=page;
300					if(page==1)
301					{
302						page=cc;
303					}
304					$commentList.data('total-pages', resp.count);
305					$commentList.data('page', page);
306					sessionStorage.setItem(key2, page) ;
307					setTimeout(function(){
308						$commentList.append(resp.html);
309						main.countdown();
310						$loading.hide();
311						isloading=true;
312						if(oldpage==1 && resp.html=="")
313						{
314							$(".morecompany").hide();
315							$("#emptymyorder").show();
316						}
317						else
318						{
319							$(".morecompany").show();	
320						}
321						if( resp.count ==0 && $("#hot-ul li").length>0)
322							$("#prompt").show();
323						if(oldpage==1)
324						{   //跳转到上次记录的地方
325							setTimeout(function() {
326								val = sessionStorage[key1] ? sessionStorage[key1] : 0;
327								window.scrollTo(0, val);
328							},10);
329						}
330					}, 1);
331					
332				}
333			},
334			error:function (xhr, ts, err){
335				setTimeout(function(){
336					$loading.hide();
337				}, 500);
338			}
339		});
340	},
341	setarea:function(obj)
342	{
343		$("#hot-ul").attr("data-areaid",obj.data("sub"));
344		$("#nav-area-item").html(obj.data("name"));
345		$("#hot-ul").html("");
346		$("#emptymyorder").hide();
347		$("#prompt").hide();
348		navBarBtn.removeClass('item-active');
349		mask.css('display', 'none');
350		allNavBox.css('display','none');
351		$(".nav-bar").css("position","static").css("top","0px");
352		sessionStorage.setItem(key1, "") ;
353	    sessionStorage.setItem(key2, "") ;
354		main.nextPageFavourableComments(1,1);
355	},
356	setcategory:function(obj)
357	{
358		$("#hot-ul").attr("data-categoryid",obj.data("sub"));
359		$("#nav-category-item").html(obj.data("name"));
360		$("#hot-ul").html("");
361		$("#emptymyorder").hide();
362		$("#prompt").hide();
363		navBarBtn.removeClass('item-active');
364		mask.css('display', 'none');
365		allNavBox.css('display','none');
366		$(".nav-bar").css("position","static").css("top","0px");
367		sessionStorage.setItem(key1, "") ;
368	    sessionStorage.setItem(key2, "") ;
369		main.nextPageFavourableComments(1,1);
370	},
371	loadbuylist:function(){
372		$.ajax({
373			type: "post",
374			dataType: "json",
375			data: {"page":$("#loadbuylist").data("page"),"total":$("#loadbuylist").data("num"),youhuiid:$("#loadbuylist").data("youhuiid"),"cname":$("#loadbuylist").data("cname"),webid:$("#loadbuylist").data("webid"),topid:$("#loadbuylist").data("topid"),xiao:$("#loadbuylist").data("xiao"),key:$("#loadbuylist").data("key")},
376			url: domainurl+"/asyn/youhuibuasynlist/?i="+$("#webstationid").val()+"&version="+new Date(),
377			cache:false,
378			success: function(d){
379				if(d.state== "success") {
380					if(d.count==0)
381					{
382						$("#loadbuylist").html("<span>没有抢购记录了</span>");
383						$("#loadbuylist").removeAttr("onclick");
384					}
385					$("#loadbuylist").data('total-pages', d.count);
386					$("#loadbuylist").data('page', ($("#loadbuylist").data("page")+1));
387					$("#details02 ul").append(d.html);
388				}
389				else
390				{
391					wptAlert(d.msg);
392				}
393			}
394		})
395	},
396	loadcomment:function()
397	{
398		if(parseInt($("#loadcomment").data("comments")) == 0)
399		{
400			$("#loadcomment").html("<span>无更多信息</span>");
401			$("#loadcomment").removeAttr("onclick");
402		}
403		else
404		{
405			$.ajax({
406				type: "post",
407				dataType: "json",
408				data: {"page":$("#loadcomment").data("page"),id:$("#loadcomment").data("id"),youhuiid:$("#loadcomment").data("youhuiid"),"userid":$("#loadcomment").data("userid"),"c":$("#loadcomment").data("comments"),"webid":$("#loadcomment").data("webid"),topid:$("#loadcomment").data("topid"),xiao:$("#loadcomment").data("xiao"),key:$("#loadcomment").data("key")},
409				url: domainurl+"/asyn/youhuicommentasynlist/?i="+$("#webstationid").val()+"&version="+new Date(),
410				cache:false,
411				success: function(d){
412					if(d.state== "success") {
413						if(d.count==0)
414						{
415							$("#loadcomment").html("<span>无更多信息</span>");
416							$("#loadcomment").removeAttr("onclick");
417						}
418						$("#loadcomment").data('total-pages', d.count);
419						$("#loadcomment").data('page', ($("#loadcomment").data("page")+1));
420						$("#pinglunlist").append(d.html);
421						
422						$(".wxpreview").click(function()
423						{
424							var imgsSrc = [];
425							function reviewImage(src) {
426								if (typeof window.WeixinJSBridge != 'undefined') {
427									WeixinJSBridge.invoke('imagePreview', {
428										'current' : src,
429										'urls' : imgsSrc
430									});
431								}
432							}
433							var src=$(this).data("src");
434							$(this).parent().parent().find(".wxpreview").each(function(){
435								var n=$(this).data("src");
436								if( n ){
437									imgsSrc.push(n);
438								}															   
439							});
440							reviewImage(src);		
441						})
442					}
443					else
444					{
445						wptAlert(d.msg);
446					}
447				}
448			})
449		}
450	}
451}
452
453
454	
455$(document).ready(function()
456{ 
457	$("#nav-sort li").click(function(){
458		$("#hot-ul").attr("data-paixu",$(this).data("id"));
459		$("#nav-sort-item").html($(this).data("name"));
460		$("#hot-ul").html("");
461		$("#emptymyorder").hide();
462		$("#prompt").hide();
463		navBarBtn.removeClass('item-active');
464		mask.css('display', 'none');
465		allNavBox.css('display','none');
466		$(".nav-bar").css("position","static").css("top","0px");
467		sessionStorage.setItem(key1, "") ;
468	    sessionStorage.setItem(key2, "") ;
469		main.nextPageFavourableComments(1,1);
470	})
471	$(".nav-category li").click(function(){
472		main.setcategory($(this));
473	})
474	$(".nav-area li").click(function(){
475		main.setarea($(this));
476	})
477})
478 

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.