Skip to content

Commit 3719a78

Browse files
author
Taois
committed
feat:详情页根据不同站源类型显示播放视频、音频、漫画等
1 parent 9f0603c commit 3719a78

File tree

1 file changed

+49
-5
lines changed

1 file changed

+49
-5
lines changed

dashboard/src/views/VideoDetail.vue

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,12 @@
180180
<div v-if="currentEpisodeUrl" class="play-actions">
181181
<a-button type="primary" size="large" @click="playVideo" class="play-btn">
182182
<template #icon>
183-
<icon-play-arrow v-if="!isNovelContent && !isComicContent" />
184-
<icon-book v-else-if="isNovelContent" />
185-
<icon-image v-else-if="isComicContent" />
183+
<icon-play-arrow v-if="smartPlayButton.icon === 'icon-play-arrow'" />
184+
<icon-book v-else-if="smartPlayButton.icon === 'icon-book'" />
185+
<icon-image v-else-if="smartPlayButton.icon === 'icon-image'" />
186+
<icon-sound v-else-if="smartPlayButton.icon === 'icon-sound'" />
186187
</template>
187-
{{ isNovelContent ? '开始阅读' : isComicContent ? '开始看漫画' : '播放视频' }}
188+
{{ smartPlayButton.text }}
188189
</a-button>
189190
<a-button @click="copyPlayUrl" class="copy-btn">
190191
<template #icon>
@@ -321,7 +322,8 @@ import {
321322
IconEye,
322323
IconBook,
323324
IconImage,
324-
IconRefresh
325+
IconRefresh,
326+
IconSound
325327
} from '@arco-design/web-vue/es/icon'
326328
327329
const route = useRoute()
@@ -562,6 +564,48 @@ const isComicContent = computed(() => {
562564
return showComicReader.value
563565
})
564566
567+
// 智能播放按钮配置 - 根据站源名称标识显示不同的按钮文本和图标
568+
const smartPlayButton = computed(() => {
569+
// 获取当前站源名称
570+
const siteName = currentSiteInfo.value?.name || ''
571+
572+
// 根据站源名称的标识判断内容类型
573+
if (siteName.includes('[书]')) {
574+
return {
575+
text: '开始阅读',
576+
icon: 'icon-book'
577+
}
578+
} else if (siteName.includes('[听]')) {
579+
return {
580+
text: '播放音频',
581+
icon: 'icon-sound'
582+
}
583+
} else if (siteName.includes('[画]')) {
584+
return {
585+
text: '查看图片',
586+
icon: 'icon-image'
587+
}
588+
} else {
589+
// 默认情况,也要考虑现有的小说和漫画判断逻辑
590+
if (isNovelContent.value) {
591+
return {
592+
text: '开始阅读',
593+
icon: 'icon-book'
594+
}
595+
} else if (isComicContent.value) {
596+
return {
597+
text: '查看图片',
598+
icon: 'icon-image'
599+
}
600+
} else {
601+
return {
602+
text: '播放视频',
603+
icon: 'icon-play-arrow'
604+
}
605+
}
606+
}
607+
})
608+
565609
// 方法
566610
567611
const loadVideoDetail = async () => {

0 commit comments

Comments
 (0)