加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
result.html 2.66 KB
一键复制 编辑 原始数据 按行查看 历史
fouber 提交于 2019-01-31 19:23 . chmod result.html
<!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>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化