From 86e6f3a0ad7d196a0cf5cbc55913c48df4d2ae07 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Mon, 28 Oct 2024 02:20:11 +0800 Subject: [PATCH] feat(video-card): show the badge when in following tab --- src/components/VideoCard/VideoCard.vue | 40 ++++++++++++++++++- .../views/Home/components/Following.vue | 6 +++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/components/VideoCard/VideoCard.vue b/src/components/VideoCard/VideoCard.vue index 357da519..d1ae3abf 100644 --- a/src/components/VideoCard/VideoCard.vue +++ b/src/components/VideoCard/VideoCard.vue @@ -50,21 +50,35 @@ export interface Video { viewStr?: string danmaku?: number danmakuStr?: string + publishedTimestamp?: number capsuleText?: string + bvid?: string aid?: number + // used for live + roomid?: number + epid?: number goto?: string /** After set the `url`, clicking the video will navigate to this url. It won't be affected by aid, bvid or epid */ url?: string /** If you want to show preview video, you should set the cid value */ cid?: number - epid?: number + followed?: boolean + liveStatus?: number + tag?: string rank?: number type?: 'horizontal' | 'vertical' | 'bangumi' threePointV2: ThreePointV2[] + + badge?: { + bgColor: string + color: string + iconUrl?: string + text: string + } } const toast = useToast() @@ -97,6 +111,8 @@ const videoUrl = computed(() => { return getCurrentVideoUrl(props.video) else if (props.video.epid) return `https://www.bilibili.com/bangumi/play/ep${props.video.epid}` + else if (props.video.roomid) + return `https://live.bilibili.com/${props.video.roomid}` else return '' }) @@ -396,6 +412,28 @@ provide('getVideoType', () => props.type!) +
+ LIVE +
+ +
+ {{ video.badge.text }} +
+