video-card.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!-- TODO 使用 item-card 页面替换 -->
  2. <template>
  3. <!-- padding-left: 10px; padding-right: 10px; -->
  4. <div style="width: 320px">
  5. <router-link :to="`/video/${videoInfo.videoId}`">
  6. <v-img
  7. :src="videoInfo.coverUrl"
  8. outlined
  9. aspect-ratio="1.77"
  10. />
  11. </router-link>
  12. <v-row>
  13. <v-col cols="2">
  14. <router-link :to="`/u/${videoInfo.userId}`">
  15. <v-avatar size="48">
  16. <v-img :src="videoInfo.avatarUrl" />
  17. </v-avatar>
  18. </router-link>
  19. </v-col>
  20. <v-col cols="10">
  21. <p style="font-size: 15px; margin-bottom: 0px;color: black;">
  22. <router-link :to="`/video/${videoInfo.videoId}`" style="color: black;"> {{ videoInfo.title }} </router-link>
  23. </p>
  24. <p style="font-size: 10px; color: #606060;">
  25. <router-link :to="`/u/${videoInfo.userId}`"> {{ videoInfo.username }}</router-link>
  26. <br>
  27. {{ videoInfo.viewCount }} 观看 <span v-html="`&nbsp;&nbsp;`" />
  28. {{ videoInfo.commentCount }} 评论 <span v-html="`&nbsp;&nbsp;`" />
  29. <span v-text="TimeUtil.timeToNowStrning(videoInfo.pubDate)" />
  30. </p>
  31. </v-col>
  32. </v-row>
  33. </div>
  34. </template>
  35. <script>
  36. import TimeUtil from '@/utils/time-util.vue'
  37. export default {
  38. name: 'UserVideoCard',
  39. props: {
  40. video: {
  41. type: Object,
  42. default: () => {}
  43. }
  44. },
  45. data() {
  46. return {
  47. TimeUtil,
  48. videoInfo: this.video
  49. }
  50. },
  51. created() {
  52. }
  53. }
  54. </script>
  55. <style>
  56. </style>