PageSourceSearch

https://www.bookschina.com/js/HeavenRed.js

js bookschina.com collected 2026-09-24 21:13:30 UTC 9,250 bytes, 205 lines download raw bytes

1// 
2$(document).ready(function () {   
3    jQuery.cookie = function (name, value, options) {
4        if (typeof value != 'undefined') {
5            options = options || {};
6            if (value === null) {
7                value = '';
8                options = $.extend({}, options);
9                options.expires = -1;
10            }
11            var expires = '';
12            if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
13                var date;
14                if (typeof options.expires == 'number') {
15                    date = new Date();
16                    date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
17                } else {
18                    date = options.expires;
19                }
20                expires = '; expires=' + date.toUTCString();
21            }
22            var path = options.path ? '; path=' + (options.path) : '';
23            var domain = options.domain ? '; domain=' + (options.domain) : '';
24            var secure = options.secure ? '; secure' : '';
25            document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
26        } else {
27            var cookieValue = null;
28            if (document.cookie && document.cookie != '') {
29                var cookies = document.cookie.split(';');
30                for (var i = 0; i < cookies.length; i++) {
31                    var cookie = jQuery.trim(cookies[i]);
32                    if (cookie.substring(0, name.length + 1) == (name + '=')) {
33                        cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
34                        break;
35                    }
36                }
37            }
38            return cookieValue;
39        }
40    };
41    console.log($.cookie("isHint"));
42    console.log($.cookie("isHint") != 'yes');
43    console.log($.cookie("isperpetual"));
44    console.log($.cookie("isperpetual") != 'yes');
45    if ($.cookie("isHint") != 'yes') {
46        if ($.cookie("isperpetual") != 'yes') {
47            heavenRed(0);
48        }
49    }
50    function heavenRed(num) {
51        console.log(num);
52        $.ajax({
53            type: 'get',
54            url: "/ashx/ActityLingQuan.ashx",
55            data: { action: 4, type: num },
56            dataType: 'json',
57            success: function (data) {
58                console.log(data);
59                if (num == 0) {
60                    if (data.status != 200) {
61                        if (data.status==-1) {
62                            $(".luckPuP,.luckBox").show();
63                        }
64                        return false;
65                    } else {
66                        $(".luckPuP,.luckBox").show();
67                    }
68                } else {                    
69                    if (data.status == 200) {
70                        $(".hint,.take").hide();
71                        $(".luckPuP,.luckBox,.ticketBox").show();
72                        $(".luckbook").addClass("pitch");
73                        $(".ticketBox").find("h5").text(data.title);
74                        $(".ticketBox").find("dt strong").text(data.Price)
75                        $(".ticketBox").find("dd span em").text(data.PriceReStrict)
76                        $(".ticketBox").find("p").text(data.instructions);
77                        $(".ticketBox").find(".tickBtn a").attr("href", data.urlPc);
78                    } else if (data.status == -1) {
79                        window.location = '//www.bookschina.com/RegUser/login.aspx?url=' + location.href;
80                    }
81                }
82            },
83            error: function () {  }
84        });
85    }
86
87    $(".luckBox").on("click", ".hint", function () {
88        var $this = $(this);
89        console.log($this.hasClass("cur"));        
90        $.cookie("isperpetual", 'yes', { expires: 3});
91        if ($this.hasClass("cur")) {
92            return false;
93        } else {
94            $this.addClass("cur");
95            $(".luckPuP,.luckBox").hide();
96           // $.cookie("isHint", 'yes', { expires: 1 / 144 });
97        }
98    })
99
100    $(".luckBox").on("click", ".closeBtn", function () {
101        var $this = $(this);
102        $(".luckPuP,.luckBox").hide();
103        $.cookie("isHint", 'yes', { expires: 1 / 144 });
104    })
105
106    $(".luckBox").on("click", ".take", function () {
107        var $this = $(this);
108        heavenRed(1);
109    })
110	
111	
112	
113	
114	//  == 10
115	timeBnanner(0)
116	
117	var actionType = 10;
118			if(actionType == 10){
119				    const cssText = `.luckFull {z-index: 999; background-color: rgba(0, 0, 0, 0.65);  position: fixed; pointer-events: auto; top: 0;  left: 0; display:none;  width: 100%;  height: 100%;}
120				.luckFullCon{ width:351px; height:396px; top:0px; bottom:0px; margin:auto auto; left:0px; right:0px; z-index:1000; position: fixed;  display:none;} 
121				.luckbook1{ background:url("//image31.bookschina.com/pro-images/group14th/quanbg.png?id=00") no-repeat top center; background-size:351px 396px; width:351px; height:396px; position: absolute; margin:auto auto;left:0px; right:0px; top:0px; animation: box2 cubic-bezier(1, 0, 0.45, 0) 1.5s 1;}
122				.takeBtn{ position: absolute; width: 90px; height:90px; bottom: 85px; margin: 0 auto; left: 0px; right: 0px; border-radius:50%; }
123				.luckFullCon.star1{ width:325px; height:385px;  } 
124				.luckFullCon.star2{ width:325px; height:479px; }  
125				.luckFullCon.star3{ width:325px; height:578px;}  
126				.luckbook1.star1 {width:325px; height:385px;  background:url("//image31.bookschina.com/pro-images/group14th/Star1.png?id=1") no-repeat top center; background-size:325px 385px;  }
127				.luckbook1.star2{width:325px; height:479px;  background:url("//image31.bookschina.com/pro-images/group14th/Star2.png?id=1") no-repeat top center; background-size:325px 479px; }
128				.luckbook1.star3{width:325px; height:578px;  background:url("//image31.bookschina.com/pro-images/group14th/Star3.png?id=1") no-repeat top center; background-size:325px 578px; }
129				.luckFullCon .closeFull1{  background:url("//image31.bookschina.com/pro-images/group14th/quan.png?id=0") no-repeat top center; background-size:47px 46px; position:absolute; top:0px; text-align:center; width:47px; margin:0 auto; height:46px;right:0px; margin-left:-23.5px; font-size:0px; color:transparent; cursor:pointer; }
130				.luckbook1 .tickBtn{width: 190px;bottom: 64px; height: 60px; left: 0px; right: 0px; margin:.0px auto; position:absolute; display:none;}
131				.luckbook1 .tickBtn a{ display:block; width:100%; height:100%;}
132				@keyframes box2 {  from {  top: -650px;  }
132 to {  top: calc(100% - 220px); } }`;
133				    // 创建style标签
134				    const style = document.createElement('style');
135				    style.type = 'text/css';
136				    // 写入样式内容
137				    style.innerHTML = cssText;
138				    // 插入head头部
139				    document.head.appendChild(style);
140					
141					 const htmlStr = `
142	        <div class="luckFull"></div>
143	        <div class="luckFullCon">
144	            <div class="luckbook1">
145	                <div class="takeBtn"></div>
146	                <div class="tickBtn"><a href="//tuan.bookschina.com">&nbsp;</a></div>
147	            </div>
148	            <div class="closeFull1">关闭</div>
149	        </div>
150	    `;
151	    // 插入到body末尾
152	    document.body.insertAdjacentHTML('beforeend', htmlStr);
153			}
154			
155			
156			
157	function timeBnanner(num) {
158	    console.log(num);
159	    $.ajax({
160	        type: 'get',
161	        url: "/ashx/ActityLingQuan.ashx",
162	        data: { action: 10, type: num },
163	        dataType: 'json',
164	        success: function (data) {
165	            console.log(data);
166	            if (num == 0) {
167	                if (data.status != 200) {
168	                    if (data.status == -1) {
169	                        $(".luckFull,.luckFullCon").show();
170	                    }
171	                    return false;
172	                } else {
173	                    $(".luckFull,.luckFullCon").show();
174	                }
175	            } else {
176	                if (data.status == 200) {
177	                    if (data.msg == 1) {
178	                        $(".luckFullCon").addClass("star1");
179	                        $(".luckbook1").addClass("star1");
180	                    } else if (data.msg == 2) {
181	                        $(".luckFullCon").addClass("star2");
182	                        $(".luckbook1").addClass("star2");
183	                    } else {
184	                        $(".luckFullCon").addClass("star3");
185	                        $(".luckbook1").addClass("star3");
186	                    }
187	                    $(".luckbook1 .tickBtn").show(); //.luckFull,.luckFullCon,
188	                    $(".takeBtn").hide();
189	                    
190	                } else if (data.status == -1) {
191	                    window.location = '//www.bookschina.com/RegUser/login.aspx?url=' + location.href;
192	                }
193	            }
194	        },
195	        error: function () { }
196	    });
197	}
198	$(".luckFullCon").on("click", ".takeBtn", function () { timeBnanner(1); })
199	$(".luckFullCon").on("click", ".closeFull1", function () { $('.luckFull').hide()  ; $('.luckFullCon').hide()})
200	
201	
202	
203	
204
205})

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.