-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·501 lines (429 loc) · 25.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no,maximum-scale=1.0">
<title>网站评选</title>
<link rel="stylesheet" href="layui-master/dist/css/layui.css">
<link rel="stylesheet" href="style/css/index.css">
</head>
<body>
<div class="layui-fluid the_back">
<div class="layui-row">
<div class="layui-col-md12">
<div id="div_back"><img src="style/img/back.jpg"></div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md12">
<div class="div_head"></div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md10 layui-col-md-offset1 the_body">
<div class="layui-row container_head">
<div class="layui-col-md5 layui-col-md-offset1">
<div class="body_title">
<h1 class="get_h1">2017西安邮电大学网站评选投票</h1>
</div>
</div>
<div class="layui-col-md4 layui-col-md-offset1 layui-col-sm10 layui-col-xs10 layui-col-sm-offset1 layui-col-xs-offset1">
<table class="layui-table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>候选作品</th>
<th>投票人次</th>
<th>访问量</th>
</tr>
</thead>
<tbody>
<tr>
<td class="vote_info">xxx</td>
<td class="vote_info">xxx</td>
<td class="vote_info">xxx</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="layui-row container_intro">
<div class="layui-col-md12 head_intro">
<p class="a_intro">
为加强我校信息化建设,提高校内各类网站的建设水平,充分发挥耳机网站在教学、科研、管理、生活等方面的作用,鼓励特色网站及互联网应用的建设和发展,促进我校校园网络文化建设,增强学校软实力,本着“以评促建,以评促管”的原则,学校将于2017年10月--11月开展2017年度各类网站和互联网应用评比活动。
</p>
<p class="a_intro">
参选对象分为学院组、职能部门组、特色网站组和互联网应用组。
</p>
</div>
</div>
<div class="layui-row container_body">
<div class="layui-tab" lay-filter="check_tab">
<ul class="layui-tab-title" id="the_tab" >
<li class="layui-this layui-btn li_one" style="margin-left: 0.2rem">互联网应用组</li>
<li class="layui-btn li_two">特色网站组</li>
<li class="layui-btn li_three">学院组</li>
<li class="layui-btn li_four">职能部门组</li>
</ul>
<div class="layui-tab-content layui-col-md12">
<div class="layui-tab-item layui-show">
<div class="layui-row layui-col-space18" id="the_app"></div>
</div>
<div class="layui-tab-item">
<div class="layui-row layui-col-space18" id="the_web"></div>
</div>
<div class="layui-tab-item">
<div class="layui-row layui-col-space18" id="the_college"></div>
</div>
<div class="layui-tab-item">
<div class="layui-row layui-col-space18" id="the_goverment"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="layui-row">
<div class="layui-col-md6 layui-col-md-offset3 layui-col-sm6 layui-col-sm-offset3 layui-col-xs6 layui-col-xs-offset3 layui-btn layui-btn-big" id="the_load">
点击加载
</div>
</div>
<div class="layui-row footer">
<div class="layui-col-md10 layui-col-md-offset1 foot_one">
<div class="layui-col-md-8 layui-col-sm-8 layui-col-xs-8 foot_body">
<div class="layui-row">
<div class="layui-col-md8 layui-col-sm8 layui-col-xs8 foot_left">
<img src="https://zypc.xupt.edu.cn/images/xupt-logo.png" class="xupt_logo">
<p class="copyright">© 2017 西安邮电大学信息中心 智邮普创工作室</p>
<p class="address">地址:图书馆514室 电话:88166083</p>
</div>
<div class="layui-col-md4 layui-col-sm4 layui-col-xs4 foot_right">
<a href="http://www.xupt.org" target="_blank"><img class="zypc_logo" src="https://zypc.xupt.edu.cn/images/xyzx-qrcode.png"></a>
</div>
</div>
</div>
</div>
<div class="layui-col-sm12 layui-col-xs12 foot_two" style="text-align: center;">
<p style="font-size: 1.3rem;display: inline-block">© 2017 西安邮电大学信息中心
<a href="https://zypc.xupt.edu.cn/" style="font-size: 1.3rem;color:#1aa194;display: inline-block;">智邮普创工作室</a>
</p>
</div>
</div>
</div>
<script src="layui-master/dist/layui.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script>
//获取点击值
function get_num(p) {
var get_dad = p.parentNode;
var get_son = get_dad.parentNode.parentNode.childNodes[0];
var the_text = get_son.innerText;
var get_hidetype = p.childNodes[0].innerText;
localStorage.setItem('get_hidetype',get_hidetype);
localStorage.setItem('the_check',the_text);
console.log(the_text)
layer.open({
type: 2,
shadeClose:true,
title: '作品详情',
area: ['90%', '90%'],
content: 'http://wzpb.xupt.org/details.html'
});
//window.location.href="http://wzpb.xupt.org/details.html";
}
//获取参赛信息表
//模拟关注度 后期加入火焰特效
$.post('detail.php',{m:"get_sum"},function(data){
var new_data = JSON.parse(data);
document.getElementsByClassName("vote_info")[0].innerHTML = new_data.all_pro;
document.getElementsByClassName("vote_info")[1].innerHTML = new_data.all_ticket;
document.getElementsByClassName("vote_info")[2].innerHTML = new_data.all_ticket*2;
});
//获取倒计时
function getime() {
var EndTime = new Date('2017/11/13 00:00:00');
var NowTime = new Date();
var t = EndTime.getTime() - NowTime.getTime();
var d = 0;
var h = 0;
var m = 0;
var s = 0;
if (t >= 0) {
d = Math.floor(t / 1000 / 60 / 60 / 24);
h = Math.floor(t / 1000 / 60 / 60 % 24);
m = Math.floor(t / 1000 / 60 % 60);
s = Math.floor(t / 1000 % 60);
}
var fina_time = d + "天" + h + "小时" + m + "分钟" + s + "秒";
$('#now_date').text(fina_time);
}
setInterval(getime,0);
localStorage.setItem('page_one',1);
localStorage.setItem('page_two',1);
localStorage.setItem('page_three',1);
localStorage.setItem('page_four',1);
localStorage.setItem('the_tab',1);
</script><!--页面动态模块-->
<script>
//加载票数初始化
$.ajax({
url:'detail.php',
type:'post',
data: {
m:'init_ticket'
}
});
//加载页面初始数据模块
$.post('detail.php',
{
m: 'get_infor',
type: 1,
p: 1
}
,function (res) {
//检查是否有数据 有则返回默认八个长度的数组对象(不足则返回相应长度的数组对象),无则返回false
var the_res = JSON.parse(res);
if (the_res)
{
var res = the_res;
for (var i = 0; i<res.length ;i++ )
{
$.ajax({
async:false,
type:'post',
url: 'detail.php',
data: {
m: 'get_rank',
type: 1,
a_name: res[i].a_name
},
success: function (data) {
var the_res = JSON.parse(data);
if(res[i].img_addr == null )
{
res[i].img_addr ='./style/img/404.png'
}
$('#the_app').append("<div class='layui-col-md4 layui-col-sm12 layui-col-xs12 the_item'><div class='the_ele layui-row'><div class='layui-col-md12'<div class='detail_pic'><img src=\"" + res[i].img_addr + "\"> </div></div><div class='layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-xs-offset1 layui-col-sm-offset1 layui-col-md-offset1'><div class='detail_titlea' style='padding: 0rem 3rem'><h3 class='the_url url_first'>" + res[i].a_name + "</h3></div><div class='detail_titleb'><h3 class='the_url'>" + res[i].u_name + "</h3></div><div class='detail_rink'><div class='rink_block'> <p>当前票数</p><span name='test'>" + res[i].ticket + "</span></div><div class='rink_block'><p>当前名次</p><span name='test1'>" + the_res.rank +"</span></div><div class='detail_vote'><div onclick='get_num(this)' id='vote_button'><span style='display: none'>"+ res[i].type + "</span>查看详情并投票</div></div></div></div></div></div");
},
error: function (XMLHttpRequest, textStatus, errorThrown){
console.log(XMLHttpRequest + textStatus + errorThrown);
}
})
}
}
});
$.post('detail.php',
{
m: 'get_infor',
type: 2,
p: 1
}
,function (res) {
//检查是否有数据 有则返回默认八个长度的数组对象(不足则返回相应长度的数组对象),无则返回false
var the_res = JSON.parse(res);
if (the_res)
{
var res = the_res;
for (var i = 0; i<res.length ;i++ )
{
$.ajax({
async:false,
type:'post',
url: 'detail.php',
data: {
m: 'get_rank',
type: 2,
a_name: res[i].a_name
},
success: function (data) {
var the_res = JSON.parse(data);
if (res[i].img_addr == null) {
res[i].img_addr = './style/img/404.png'
}
$('#the_web').append("<div class='layui-col-md4 layui-col-sm12 layui-col-xs12 the_item'><div class='the_ele layui-row'><div class='layui-col-md12'<div class='detail_pic'><img src=\"" + res[i].img_addr + "\"> </div></div><div class='layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-xs-offset1 layui-col-sm-offset1 layui-col-md-offset1'><div class='detail_titlea' style='padding: 0rem 3rem'><h3 class='the_url url_first'>" + res[i].a_name + "</h3></div><div class='detail_titleb' style='white- space: nowrap'><h3 class='the_url'>" + res[i].u_name + "</h3></div><div class='detail_rink'><div class='rink_block'> <p>当前票数</p><span id='test'>" + res[i].ticket + "</span></div><div class='rink_block'><p>当前名次</p><span id='test1'>" + the_res.rank + "</span></div><div class='detail_vote'><div onclick='get_num(this)' id='vote_button'><span style='display: none'>" + res[i].type + "</span>查看详情并投票</div></div></div></div></div></div");
}
})
}
}
});
$.post('detail.php',
{
m: 'get_infor',
type: 3,
p: 1
}
,function (res) {
//检查是否有数据 有则返回默认八个长度的数组对象(不足则返回相应长度的数组对象),无则返回false
var the_res = JSON.parse(res);
if (the_res)
{
var res = the_res;
for (var i = 0; i<res.length ;i++ )
{
$.ajax({
async:false,
type:'post',
url: 'detail.php',
data: {
m: 'get_rank',
type: 3,
a_name: res[i].a_name
},
success: function (data) {
var the_res = JSON.parse(data);
if (res[i].img_addr == null) {
res[i].img_addr = './style/img/404.png'
}
$('#the_college').append("<div class='layui-col-md4 layui-col-sm12 layui-col-xs12 the_item'><div class='the_ele layui-row'><div class='layui-col-md12'<div class='detail_pic'><img src=\"" + res[i].img_addr + "\"> </div></div><div class='layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-xs-offset1 layui-col-sm-offset1 layui-col-md-offset1'><div class='detail_titlea' style='padding: 0rem 3rem'><h3 class='the_url url_first'>" + res[i].a_name + "</h3></div><div class='detail_titleb' style='white- space: nowrap'><h3 class='the_url'>" + res[i].u_name + "</h3></div><div class='detail_rink'><div class='rink_block'> <p>当前票数</p><span id='test'>" + res[i].ticket + "</span></div><div class='rink_block'><p>当前名次</p><span id='test1'>" + the_res.rank + "</span></div><div class='detail_vote'><div onclick='get_num(this)' id='vote_button'><span style='display: none'>" + res[i].type + "</span>查看详情并投票</div></div></div></div></div></div");
}
})
}
}
});
$.post('detail.php',
{
m: 'get_infor',
type: 4,
p: 1
}
,function (res) {
//检查是否有数据 有则返回默认八个长度的数组对象(不足则返回相应长度的数组对象),无则返回false
var the_res = JSON.parse(res);
if (the_res)
{
var res = the_res;
for (var i = 0; i<res.length ;i++ )
{
$.ajax({
async:false,
type:'post',
url: 'detail.php',
data: {
m: 'get_rank',
type: 4,
a_name: res[i].a_name
},
success: function (data) {
var the_res = JSON.parse(data);
if (res[i].img_addr == null) {
res[i].img_addr = './style/img/404.png'
}
$('#the_goverment').append("<div class='layui-col-md4 layui-col-sm12 layui-col-xs12 the_item'><div class='the_ele layui-row'><div class='layui-col-md12'<div class='detail_pic'><img src=\"" + res[i].img_addr + "\"> </div></div><div class='layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-xs-offset1 layui-col-sm-offset1 layui-col-md-offset1'><div class='detail_titlea' style='padding: 0rem 3rem'><h3 class='the_url url_first'>" + res[i].a_name + "</h3></div><div class='detail_titleb' style='white- space: nowrap'><h3 class='the_url'>" + res[i].u_name + "</h3></div><div class='detail_rink'><div class='rink_block'> <p>当前票数</p><span id='test'>" + res[i].ticket + "</span></div><div class='rink_block'><p>当前名次</p><span id='test1'>" + the_res.rank + "</span></div><div class='detail_vote'><div onclick='get_num(this)' id='vote_button'><span style='display: none'>" + res[i].type + "</span>查看详情并投票</div></div></div></div></div></div");
}
})
}
}
});
//点击加载更多
$('#the_load').click(function () {
$('#the_load').prepend('<i id="the_action" class="layui-icon" style="font-size: 5rem;">ဂ</i> ');
var the_tab = parseInt(localStorage.getItem('the_tab'));
if (the_tab == 1)
{
var page = parseInt(localStorage.getItem('page_one'));
} else if (the_tab == 2) {
var page = parseInt(localStorage.getItem('page_two'));
} else if (the_tab == 3) {
var page = parseInt(localStorage.getItem('page_three'));
} else if (the_tab == 4) {
var page = parseInt(localStorage.getItem('page_four'));
} else{}
//加载下一页
$.ajax({
async:false,
type: 'post',
url: 'detail.php',
data: {
m: 'get_infor',
type: the_tab,
p: page + 1
},
success: function (data) {
//检查是否有数据 有则返回默认六个长度的数组对象(不足则返回相应长度的数组对象),无则返回false
var the_res = JSON.parse(data);
$('#the_action').remove();
if (the_res.result===false) {
layer.msg('没有啦', {
icon: 7,
time: 3000, //2秒关闭(如果不配置,默认是3秒)
area: ['15rem','6rem']
}, function(){
//do something
});
} else {
var res = the_res;
for (var i = 0; i < res.length; i++) {
$.ajax({
async:false,
type:'post',
url: 'detail.php',
data: {
m: 'get_rank',
type: the_tab,
a_name: res[i].a_name
},
success: function (data) {
var the_tabb = parseInt(localStorage.getItem('the_tab'));
var the_res = JSON.parse(data);
if (res[i].img_addr == null) {
res[i].img_addr = './style/img/404.png'
}
if (the_tabb == 1)
{
$('#the_app').append("<div class='layui-col-md4 layui-col-sm12 layui-col-xs12 the_item'><div class='the_ele layui-row'><div class='layui-col-md12'<div class='detail_pic'><img src=\"" + res[i].img_addr + "\"> </div></div><div class='layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-xs-offset1 layui-col-sm-offset1 layui-col-md-offset1'><div class='detail_titlea' style='padding: 0rem 3rem'><h3 class='the_url url_first'>" + res[i].a_name + "</h3></div><div class='detail_titleb' style='white- space: nowrap'><h3 class='the_url'>" + res[i].u_name + "</h3></div><div class='detail_rink'><div class='rink_block'> <p>当前票数</p><span id='test'>" + res[i].ticket + "</span></div><div class='rink_block'><p>当前名次</p><span id='test1'>" + the_res.rank + "</span></div><div class='detail_vote'><div onclick='get_num(this)' id='vote_button'><span style='display: none'>" + res[i].type + "</span>查看详情并投票</div></div></div></div></div></div");
}
else if (the_tabb==2)
{
$('#the_web').append("<div class='layui-col-md4 layui-col-sm12 layui-col-xs12 the_item'><div class='the_ele layui-row'><div class='layui-col-md12'<div class='detail_pic'><img src=\"" + res[i].img_addr + "\"> </div></div><div class='layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-xs-offset1 layui-col-sm-offset1 layui-col-md-offset1'><div class='detail_titlea' style='padding: 0rem 3rem'><h3 class='the_url url_first'>" + res[i].a_name + "</h3></div><div class='detail_titleb' style='white- space: nowrap'><h3 class='the_url'>" + res[i].u_name + "</h3></div><div class='detail_rink'><div class='rink_block'> <p>当前票数</p><span id='test'>" + res[i].ticket + "</span></div><div class='rink_block'><p>当前名次</p><span id='test1'>" + the_res.rank + "</span></div><div class='detail_vote'><div onclick='get_num(this)' id='vote_button'><span style='display: none'>" + res[i].type + "</span>查看详情并投票</div></div></div></div></div></div");
}
else if(the_tab == 3)
{
$('#the_college').append("<div class='layui-col-md4 layui-col-sm12 layui-col-xs12 the_item'><div class='the_ele layui-row'><div class='layui-col-md12'<div class='detail_pic'><img src=\"" + res[i].img_addr + "\"> </div></div><div class='layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-xs-offset1 layui-col-sm-offset1 layui-col-md-offset1'><div class='detail_titlea' style='padding: 0rem 3rem'><h3 class='the_url url_first'>" + res[i].a_name + "</h3></div><div class='detail_titleb' style='white- space: nowrap'><h3 class='the_url'>" + res[i].u_name + "</h3></div><div class='detail_rink'><div class='rink_block'> <p>当前票数</p><span id='test'>" + res[i].ticket + "</span></div><div class='rink_block'><p>当前名次</p><span id='test1'>" + the_res.rank + "</span></div><div class='detail_vote'><div onclick='get_num(this)' id='vote_button'><span style='display: none'>" + res[i].type + "</span>查看详情并投票</div></div></div></div></div></div");
}
else if(the_tab == 4){
$('#the_goverment').append("<div class='layui-col-md4 layui-col-sm12 layui-col-xs12 the_item'><div class='the_ele layui-row'><div class='layui-col-md12'<div class='detail_pic'><img src=\"" + res[i].img_addr + "\"> </div></div><div class='layui-col-xs10 layui-col-sm10 layui-col-md10 layui-col-xs-offset1 layui-col-sm-offset1 layui-col-md-offset1'><div class='detail_titlea' style='padding: 0rem 3rem'><h3 class='the_url url_first'>" + res[i].a_name + "</h3></div><div class='detail_titleb' style='white- space: nowrap'><h3 class='the_url'>" + res[i].u_name + "</h3></div><div class='detail_rink'><div class='rink_block'> <p>当前票数</p><span id='test'>" + res[i].ticket + "</span></div><div class='rink_block'><p>当前名次</p><span id='test1'>" + the_res.rank + "</span></div><div class='detail_vote'><div onclick='get_num(this)' id='vote_button'><span style='display: none'>" + res[i].type + "</span>查看详情并投票</div></div></div></div></div></div");
} else {}
}
})
}
var the_tabb = parseInt(localStorage.getItem('the_tab'));
if(the_tabb==1)
{
var turnnum = parseInt(localStorage.getItem('page_one')) + 1;
localStorage.setItem('page_one',turnnum);
} else if(the_tabb==2) {
var turnnum = parseInt(localStorage.getItem('page_two')) + 1;
localStorage.setItem('page_two',turnnum);
} else if(the_tabb==3) {
var turnnum = parseInt(localStorage.getItem('page_three')) + 1;
localStorage.setItem('page_three',turnnum);
} else if(the_tabb==4) {
var turnnum = parseInt(localStorage.getItem('page_four')) + 1;
localStorage.setItem('page_four',turnnum);
} else {}
}
}
})
});
//切换类型模块
layui.use(['element','layer'], function(){
var element = layui.element;
var layer = layui.layer;
element.on('tab(check_tab)', function(data){
//加载另外一个类型
var the_tab = data.index + 1;
localStorage.setItem('the_tab',the_tab);
});
});
</script>
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</body>
</html>