From f789745d11cc231036e10060615fc8c79a1b9cc5 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Mon, 18 Mar 2024 01:21:01 +0800 Subject: [PATCH 1/5] feat(VideoCard): add more button option to video card --- src/components/VideoCard/VideoCard.vue | 152 ++++-------------- .../views/Home/components/ForYou.vue | 62 ++++++- 2 files changed, 87 insertions(+), 127 deletions(-) diff --git a/src/components/VideoCard/VideoCard.vue b/src/components/VideoCard/VideoCard.vue index ddc88ac2..f28334dd 100644 --- a/src/components/VideoCard/VideoCard.vue +++ b/src/components/VideoCard/VideoCard.vue @@ -34,12 +34,18 @@ interface Props { rank?: number topRightContent?: boolean showPreview?: boolean + moreBtn?: boolean + moreBtnActive?: boolean } const props = withDefaults(defineProps(), { topRightContent: true, }) +const emit = defineEmits<{ + (e: 'moreClick', event: MouseEvent): MouseEvent +}>() + const videoUrl = computed(() => { if (props.bvid || props.aid) return `https://www.bilibili.com/video/${props.bvid ?? `av${props.aid}`}` @@ -70,8 +76,6 @@ const wValue = computed((): string => { const isDislike = ref(false) const isInWatchLater = ref(false) const isHover = ref(false) -// const dislikeReasonId = ref(null) -const showPopCtrl = ref(false) const contentVisibility = ref<'auto' | 'visible'>('auto') const mouseEnterTimeOut = ref() const mouseLeaveTimeOut = ref() @@ -141,60 +145,9 @@ function handelMouseLeave() { }, 300) } -// function submitDislike( -// reasonID: number, -// goto: string, -// id: string, -// mid: number, -// rid: number, -// tagID: number, -// ) { -// browser.runtime -// .sendMessage({ -// contentScriptQuery: 'submitDislike', -// accessKey: accessKey.value, -// reasonID, -// goto, -// id, -// mid, -// rid, -// tagID, -// }) -// .then((res) => { -// if (res.code === 0) { -// isDislike.value = true -// dislikeReasonId.value = reasonID -// } -// }) -// } - -// function undoDislike( -// reasonID: number, -// goto: string, -// id: string, -// mid: number, -// rid: number, -// tagID: number, -// ) { -// browser.runtime -// .sendMessage({ -// contentScriptQuery: 'undoDislike', -// accessKey, -// reasonID, -// goto, -// id, -// mid, -// rid, -// tagID, -// }) -// .then((res) => { -// if (res.code === 0) { -// isDislike.value = false -// dislikeReasonId.value = null -// showPopCtrl.value = false -// } -// }) -// } +function handleMoreBtnClick(event: MouseEvent) { + emit('moreClick', event) +}