ImageAlbumCard.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <el-col style="padding-right: 7px; padding-left: 7px">
  3. <div style="cursor: pointer">
  4. <el-card :body-style="{ padding: '0px' }" class="card">
  5. <router-link target="_blank" :to="`/vod/image/${imageAlbum.albumId}`">
  6. <div class="imgs">
  7. <el-image
  8. lazy
  9. fit="cover"
  10. :src="imageAlbum.coverUrl"
  11. class="coverImg"
  12. />
  13. <span style="position: absolute; bottom: 0; right: 0; color:white">
  14. <i class="el-icon-picture-outline">{{imageAlbum.total}}</i>
  15. </span>
  16. </div>
  17. </router-link>
  18. <div style="padding: 14px">
  19. <router-link target="_blank" :to="`/vod/image/${imageAlbum.albumId}`">
  20. <span style="left: 0;margin-bottom: 0px;color: black;">{{ imageAlbum.albumName | ellipsis }}</span>
  21. </router-link>
  22. </div>
  23. <!-- <div style="padding: 14px">
  24. <span style="left: 0;margin-bottom: 0px;color: black;">
  25. <router-link target="_blank" :to="`/vod/user/${imageAlbum.userId}`"><i class="el-icon-user"> {{ imageAlbum.username }} </i></router-link> · {{ imageAlbum.pubDate }}
  26. </span>
  27. </div>-->
  28. </el-card>
  29. </div>
  30. </el-col>
  31. </template>
  32. <script>
  33. import { handleVisited } from 'assets/js/utils'
  34. export default {
  35. name: 'ImageAlbumCard',
  36. filters: {
  37. ellipsis(value) {
  38. if (!value) return ''
  39. const max = 20
  40. if (value.length > max) {
  41. return value.slice(0, max) + '...'
  42. }
  43. return value
  44. }
  45. },
  46. props: {
  47. imageAlbum: {
  48. type: Object,
  49. default: null
  50. },
  51. // 时间前的描述
  52. dateTit: {
  53. type: String,
  54. default: ''
  55. }
  56. },
  57. methods: {
  58. getVisited(visited) {
  59. return handleVisited(visited)
  60. }
  61. }
  62. }
  63. </script>
  64. <style scoped>
  65. .time {
  66. font-size: 15px;
  67. color: #999;
  68. }
  69. .bottom {
  70. margin-top: 13px;
  71. line-height: 12px;
  72. }
  73. .tit {
  74. font-weight: 700;
  75. font-size: 18px;
  76. height: 50px;
  77. overflow: hidden;
  78. text-overflow: ellipsis;
  79. display: -webkit-box;
  80. -webkit-line-clamp: 2; /*行数*/
  81. -webkit-box-orient: vertical;
  82. }
  83. .num {
  84. position: relative;
  85. font-size: 15px;
  86. padding-top: 9px;
  87. }
  88. /*处于手机屏幕时*/
  89. @media screen and (max-width: 768px) {
  90. .tit {
  91. font-weight: 600;
  92. font-size: 12px;
  93. height: 32px;
  94. }
  95. .time {
  96. font-size: 10px;
  97. color: #999;
  98. }
  99. .num {
  100. font-size: 9px;
  101. padding-top: 3px;
  102. }
  103. .bottom {
  104. margin-top: 2px;
  105. line-height: 7px;
  106. }
  107. .coverImg {
  108. height: 120px !important;
  109. }
  110. }
  111. .coverImg {
  112. width: 100%;
  113. height: 175px;
  114. display: block;
  115. }
  116. .clearfix:before,
  117. .clearfix:after {
  118. display: table;
  119. content: "";
  120. }
  121. .clearfix:after {
  122. clear: both;
  123. }
  124. .card {
  125. margin-bottom: 20px;
  126. transition: all 0.6s; /*所有属性变化在0.6秒内执行动画*/
  127. }
  128. /*.card:hover {
  129. !*鼠标放上之后元素变成1.06倍大小*!
  130. transform: scale(1.06);
  131. }*/
  132. .imgs {
  133. position: relative;
  134. }
  135. .play-icon {
  136. position: absolute;
  137. /*top: -15px;*/
  138. right: 2%;
  139. bottom: 5px;
  140. z-index: 7;
  141. width: 40px;
  142. }
  143. </style>