forked from fouber/lottery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
result.html
executable file
·90 lines (88 loc) · 2.66 KB
/
result.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
<!DOCTYPE html>
<html>
<head>
<meta name="screen-orientation" content="portrait">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"/>
<title>年会抽奖小程序</title>
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/wall.css">
<style type="text/css">
.wall {
overflow: scroll;
background-repeat: repeat;
}
::-webkit-scrollbar {
display: none;
}
body, html {
width: 100%;
height: 100%;
}
.mask {
-webkit-filter:blur(5px);
filter:blur(5px);
}
#main {
-webkit-transition: all 1s;
transition: all 1s;
}
.result-list {
text-align: center;
color: #4de7c8;
font-size: 30px;
line-height: 50px;
margin-top: 50px;
margin-bottom: 50px;
font-family: '幼圆';
}
.result-title {
text-align: center;
color: #4de7c8;
font-size: 40px;
margin-top: 100px;
font-family: '幼圆';
}
</style>
</head>
<body>
<div id="main" class="wall">
<div class="result-title">获奖名单</div>
<div class="result-list" v-for="result in results">
<div v-for="item in result">
{{item}}
</div>
</div>
</div>
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript">
new Vue({
el: '#main',
data: {
results: []
},
mounted () {
let vm = this
let locals = window.localStorage
let str_results = []
// 遍历(排除choosed)
for(let i = 0; i<localStorage.length; i++){
if (localStorage.key(i) !== 'choosed') {
str_results.push(localStorage.getItem(localStorage.key(i)))
}
}
// 分割每个string, 并将</br>换成空格
let results = []
for(let nameList of str_results) {
let temp = JSON.parse(nameList)
temp = temp.map(item => {return item.replace('<br/>', ' ')})
results.push(temp)
}
// 根据长度进行排序,名单短的放在前面
results = results.sort((x, y) => { return x.length - y.length;})
this.results = results
},
})
</script>
</body>
</html>