mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
feat: add play all button to FavoritesPop & WatchLaterPop
This commit is contained in:
@@ -17,12 +17,16 @@ const isLoading = ref<boolean>(false)
|
||||
const noMoreContent = ref<boolean>(false)
|
||||
const favoriteVideosWrap = ref<HTMLElement>() as Ref<HTMLElement>
|
||||
|
||||
const favoritesPageUrl = computed(() => {
|
||||
const viewAllUrl = computed((): string => {
|
||||
return `//space.bilibili.com/${getUserID()}/favlist?fid=${
|
||||
activatedMediaId.value
|
||||
}`
|
||||
})
|
||||
|
||||
const playAllUrl = computed((): string => {
|
||||
return `https://www.bilibili.com/list/ml${activatedMediaId.value}`
|
||||
})
|
||||
|
||||
watch(activatedMediaId, (newVal: number, oldVal: number) => {
|
||||
if (newVal === oldVal)
|
||||
return
|
||||
@@ -148,12 +152,20 @@ defineExpose({
|
||||
{{ activatedFavoriteTitle }}
|
||||
</h3>
|
||||
|
||||
<a
|
||||
:href="favoritesPageUrl" :target="isHomePage() ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
flex="~" items="center"
|
||||
>
|
||||
<span text="sm">{{ $t('common.view_all') }}</span>
|
||||
</a>
|
||||
<div flex="~ gap-4">
|
||||
<a
|
||||
:href="playAllUrl" :target="isHomePage() ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
flex="~" items="center"
|
||||
>
|
||||
<span text="sm">{{ $t('common.play_all') }}</span>
|
||||
</a>
|
||||
<a
|
||||
:href="viewAllUrl" :target="isHomePage() ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
flex="~" items="center"
|
||||
>
|
||||
<span text="sm">{{ $t('common.view_all') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main flex="~" overflow-hidden rounded="$bew-radius">
|
||||
|
||||
@@ -7,6 +7,13 @@ import { isHomePage, removeHttpFromUrl } from '~/utils/main'
|
||||
const watchLaterList = reactive<VideoItem[]>([])
|
||||
const isLoading = ref<boolean>()
|
||||
|
||||
const viewAllUrl = computed((): string => {
|
||||
return 'https://www.bilibili.com/watchlater/#/list'
|
||||
})
|
||||
const playAllUrl = computed((): string => {
|
||||
return 'https://www.bilibili.com/list/watchlater'
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
getAllWatchLaterList()
|
||||
})
|
||||
@@ -65,12 +72,21 @@ function getAllWatchLaterList() {
|
||||
{{ $t('topbar.watch_later') }}
|
||||
</div>
|
||||
</div>
|
||||
<a
|
||||
href="https://www.bilibili.com/watchlater/#/list" :target="isHomePage() ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
flex="~ items-center"
|
||||
>
|
||||
<span text="sm">{{ $t('common.view_all') }}</span>
|
||||
</a>
|
||||
|
||||
<div flex="~ gap-4">
|
||||
<a
|
||||
:href="playAllUrl" :target="isHomePage() ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
flex="~" items="center"
|
||||
>
|
||||
<span text="sm">{{ $t('common.play_all') }}</span>
|
||||
</a>
|
||||
<a
|
||||
:href="viewAllUrl" :target="isHomePage() ? '_blank' : '_self'" rel="noopener noreferrer"
|
||||
flex="~" items="center"
|
||||
>
|
||||
<span text="sm">{{ $t('common.view_all') }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- watchLater wrapper -->
|
||||
|
||||
Reference in New Issue
Block a user