result.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="screen-orientation" content="portrait">
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"/>
  7. <title>获奖名单</title>
  8. <link rel="icon" type="image/x-icon" href="img/favicon.ico" />
  9. <link rel="stylesheet" type="text/css" href="css/reset.css">
  10. <link rel="stylesheet" type="text/css" href="css/wall.css">
  11. <style type="text/css">
  12. .wall {
  13. overflow: scroll;
  14. background-repeat: repeat;
  15. }
  16. ::-webkit-scrollbar {
  17. display: none;
  18. }
  19. body, html {
  20. width: 100%;
  21. height: 100%;
  22. }
  23. .mask {
  24. -webkit-filter:blur(5px);
  25. filter:blur(5px);
  26. }
  27. #main {
  28. -webkit-transition: all 1s;
  29. transition: all 1s;
  30. }
  31. .result-list {
  32. text-align: center;
  33. color: #4de7c8;
  34. font-size: 30px;
  35. line-height: 50px;
  36. margin-top: 50px;
  37. margin-bottom: 50px;
  38. font-family: '幼圆';
  39. }
  40. .result-title {
  41. text-align: center;
  42. color: #4de7c8;
  43. font-size: 40px;
  44. margin-top: 100px;
  45. font-family: '幼圆';
  46. }
  47. </style>
  48. </head>
  49. <body>
  50. <div id="main" class="wall">
  51. <div class="result-title">获奖名单</div>
  52. <div class="result-list" v-for="result in results">
  53. <div v-for="item in result">
  54. {{item}}
  55. </div>
  56. </div>
  57. </div>
  58. <script type="text/javascript" src="js/vue.js"></script>
  59. <script type="text/javascript">
  60. new Vue({
  61. el: '#main',
  62. data: {
  63. results: []
  64. },
  65. mounted () {
  66. let vm = this
  67. let locals = window.localStorage
  68. let str_results = []
  69. // 遍历(排除choosed)
  70. for(let i = 0; i<localStorage.length; i++){
  71. if (localStorage.key(i) !== 'choosed') {
  72. str_results.push(localStorage.getItem(localStorage.key(i)))
  73. }
  74. }
  75. // 分割每个string, 并将</br>换成空格
  76. let results = []
  77. for(let nameList of str_results) {
  78. let temp = JSON.parse(nameList)
  79. temp = temp.map(item => {return item.replace('<br/>', ' ')})
  80. results.push(temp)
  81. }
  82. // 根据长度进行排序,名单短的放在前面
  83. results = results.sort((x, y) => { return x.length - y.length;})
  84. this.results = results
  85. },
  86. })
  87. </script>
  88. </body>
  89. </html>