index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <section>
  3. <!--工具条-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <div class="nowTime">
  6. <i class="fa fa-clock-o"></i>
  7. {{currentTime}}
  8. </div>
  9. </el-col>
  10. <!-- 卡片列表 -->
  11. <div>
  12. <el-col :span="6" v-for="(item, index) in 12" :key="item" class="one_div">
  13. <el-card :body-style="{ padding: '0px' }" shadow="hover" class="one_card">
  14. <div class="one_card_img">
  15. <el-image :src="index==0?require('../../assets/image/047_S.jpg'):require('../../assets/image/noPic.png')" class="image" lazy></el-image>
  16. <div :id="'over'+index" class="over">
  17. <el-button type="primary" plain @click.native="jumpTo(item)"><i class="fa fa-link"></i> 所有截图</el-button>
  18. </div>
  19. </div>
  20. <div class="one_card_txt">
  21. <span>在玩游戏呢!!!!!</span>
  22. <div class="bottom clearfix">
  23. <el-link><i class="fa fa-circle"></i> 吴涛涛</el-link>
  24. <time class="time">9点59分59秒</time>
  25. </div>
  26. </div>
  27. </el-card>
  28. </el-col>
  29. </div>
  30. </section>
  31. </template>
  32. <script>
  33. import util from '../../common/js/util'
  34. export default {
  35. data() {
  36. return {
  37. filters: {
  38. keyName: ''
  39. },
  40. user: JSON.parse(sessionStorage.getItem('user')),
  41. timer: "",
  42. currentTime: util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd hh:mm:ss'),
  43. }
  44. },
  45. methods: {
  46. getTime() {
  47. var _this = this; //声明一个变量指向Vue实例this,保证作用域一致
  48. this.timer = setInterval(function() {
  49. _this.currentTime = util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd hh:mm:ss');
  50. }, 1000);
  51. },
  52. jumpTo(id) {
  53. this.$router.push('/desktop/' + id);
  54. }
  55. },
  56. created() {
  57. this.getTime();
  58. },
  59. mounted() {
  60. },
  61. beforeDestroy() {
  62. if (this.timer) {
  63. clearInterval(this.timer);
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .nowTime {
  70. height: 35px;
  71. line-height: 28px;
  72. font-size: 18px;
  73. color: #20a0ff;
  74. margin-left: 10px;
  75. i {
  76. margin-right: 10px;
  77. }
  78. }
  79. .one_div {
  80. padding: 15px;
  81. .one_card {
  82. .one_card_img {
  83. position: relative;
  84. .image {
  85. width: 100%;
  86. }
  87. .over {
  88. display: none;
  89. width: 100%;
  90. height: 98%;
  91. background: rgba(0,0,0,0.2);
  92. position: absolute;
  93. top: 0;
  94. text-align: center;
  95. }
  96. }
  97. .one_card_txt {
  98. padding: 13px;
  99. .bottom {
  100. margin-top: 13px;
  101. line-height: 12px;
  102. i {
  103. color: #9ED0FF;
  104. margin-right: 5px;
  105. }
  106. .time {
  107. float: right;
  108. margin-top: 2px;
  109. color: #999;
  110. }
  111. }
  112. }
  113. }
  114. .one_card:hover {
  115. .one_card_img {
  116. .over {
  117. display: block!important;
  118. }
  119. }
  120. }
  121. }
  122. </style>
  123. <style lang="scss">
  124. .image {
  125. .el-image__inner {
  126. height: 11.6vw!important;
  127. }
  128. }
  129. .one_card_img {
  130. .over {
  131. .el-button {
  132. margin-top: 25%;
  133. }
  134. }
  135. }
  136. </style>