StatusCard.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <el-card :body-style="{ padding: '0px' }" class="card">
  3. <el-row>
  4. <el-col :md="3">
  5. <router-link target="_blank" :to="`/user/` + status.user.userId">
  6. <el-avatar>
  7. <el-image :src="status.user.avatarUrl" />
  8. </el-avatar>
  9. </router-link>
  10. </el-col>
  11. <el-col :md="12">
  12. <el-row>
  13. <router-link target="_blank" :to="`/user/` + status.user.userId">
  14. <span>{{ status.user.screenName }}</span>
  15. </router-link>
  16. </el-row>
  17. <el-row>
  18. <span>{{ status.createdAt }} 来自 微博网页版</span>
  19. </el-row>
  20. </el-col>
  21. </el-row>
  22. <el-row>
  23. <span v-html="status.text" />
  24. </el-row>
  25. <el-row v-if="status.imageUrls.length !== 0">
  26. <el-col :md="6" v-for="imageUrl in status.imageUrls" :key="imageUrl.thumbnailUrl">
  27. <el-image
  28. lazy
  29. fit="cover"
  30. class="coverImg"
  31. :src="imageUrl.thumbnailUrl"
  32. @click="showImage(status.imageUrls)">
  33. </el-image>
  34. </el-col>
  35. </el-row>
  36. <el-row v-if="status.audioUrl !== undefined && status.audioUrl !== null">
  37. <audio-card :audio="ddd"></audio-card>
  38. </el-row>
  39. </el-card>
  40. </template>
  41. <script>
  42. import AudioCard from 'components/card/AudioCard'
  43. export default {
  44. name: 'StatusCard',
  45. components: { AudioCard },
  46. props: {
  47. status: {
  48. type: Object,
  49. default: null
  50. },
  51. // 时间前的描述
  52. dateTit: {
  53. type: String,
  54. default: ''
  55. }
  56. },
  57. methods: {
  58. showImage(imageUrls) {
  59. const imgs = []
  60. for (const i of imageUrls) {
  61. imgs.push(i.originalUrl)
  62. }
  63. this.$viewerApi({
  64. images: imgs,
  65. options: {
  66. movable: true,
  67. fullscreen: false,
  68. keyboard: true
  69. }
  70. })
  71. },
  72. }
  73. }
  74. </script>
  75. <style scoped>
  76. .time {
  77. font-size: 15px;
  78. color: #999;
  79. }
  80. .bottom {
  81. margin-top: 13px;
  82. line-height: 12px;
  83. }
  84. .tit {
  85. font-weight: 700;
  86. font-size: 18px;
  87. height: 50px;
  88. overflow: hidden;
  89. text-overflow: ellipsis;
  90. display: -webkit-box;
  91. -webkit-line-clamp: 2; /*行数*/
  92. -webkit-box-orient: vertical;
  93. }
  94. .num {
  95. position: relative;
  96. font-size: 15px;
  97. padding-top: 9px;
  98. }
  99. /*处于手机屏幕时*/
  100. @media screen and (max-width: 768px) {
  101. .tit {
  102. font-weight: 600;
  103. font-size: 12px;
  104. height: 32px;
  105. }
  106. .time {
  107. font-size: 10px;
  108. color: #999;
  109. }
  110. .num {
  111. font-size: 9px;
  112. padding-top: 3px;
  113. }
  114. .bottom {
  115. margin-top: 2px;
  116. line-height: 7px;
  117. }
  118. .coverImg {
  119. height: 120px !important;
  120. }
  121. }
  122. .coverImg {
  123. width: 100%;
  124. height: 175px;
  125. display: block;
  126. }
  127. .clearfix:before,
  128. .clearfix:after {
  129. display: table;
  130. content: "";
  131. }
  132. .clearfix:after {
  133. clear: both;
  134. }
  135. .card {
  136. margin-bottom: 20px;
  137. transition: all 0.6s; /*所有属性变化在0.6秒内执行动画*/
  138. }
  139. /*.card:hover {
  140. !*鼠标放上之后元素变成1.06倍大小*!
  141. transform: scale(1.06);
  142. }*/
  143. .imgs {
  144. position: relative;
  145. }
  146. .play-icon {
  147. position: absolute;
  148. /*top: -15px;*/
  149. right: 2%;
  150. bottom: 5px;
  151. z-index: 7;
  152. width: 40px;
  153. }
  154. </style>