VideoLine.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div class="video-info flex" @click="goDetail">
  3. <van-image width="110" height="70" fit="cover" radius="12" :src="info.cover" />
  4. <div class="content">
  5. <div class="title text-white van-multi-ellipsis--l2 text-sm">{{ info.title }}</div>
  6. <div class="text-[#00FFE4] text-xs" v-if="history">观看至第1集</div>
  7. <div class="text text-xs text-[#61657A] flex justify-between">
  8. <span>虐恋·{{ info.totalEpisodes }}集</span>
  9. <span> {{ info.playCount }}播放</span>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script setup>
  15. import { useRouter } from 'vue-router'
  16. const props = defineProps({
  17. history: {
  18. type: Boolean,
  19. default: false
  20. },
  21. info: {
  22. type: Object,
  23. default: () => {
  24. return {}
  25. }
  26. }
  27. })
  28. const router = useRouter()
  29. function goDetail() {
  30. router.push({
  31. name: 'video',
  32. query: {
  33. id: props.info.id
  34. }
  35. })
  36. }
  37. </script>
  38. <style lang="less" scoped>
  39. .video-info {
  40. .content {
  41. flex-grow: 1;
  42. overflow: hidden;
  43. display: flex;
  44. flex-direction: column;
  45. justify-content: space-between;
  46. margin-left: 12px;
  47. }
  48. }
  49. </style>