|
180 | 180 | <div v-if="currentEpisodeUrl" class="play-actions"> |
181 | 181 | <a-button type="primary" size="large" @click="playVideo" class="play-btn"> |
182 | 182 | <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'" /> |
186 | 187 | </template> |
187 | | - {{ isNovelContent ? '开始阅读' : isComicContent ? '开始看漫画' : '播放视频' }} |
| 188 | + {{ smartPlayButton.text }} |
188 | 189 | </a-button> |
189 | 190 | <a-button @click="copyPlayUrl" class="copy-btn"> |
190 | 191 | <template #icon> |
@@ -321,7 +322,8 @@ import { |
321 | 322 | IconEye, |
322 | 323 | IconBook, |
323 | 324 | IconImage, |
324 | | - IconRefresh |
| 325 | + IconRefresh, |
| 326 | + IconSound |
325 | 327 | } from '@arco-design/web-vue/es/icon' |
326 | 328 |
|
327 | 329 | const route = useRoute() |
@@ -562,6 +564,48 @@ const isComicContent = computed(() => { |
562 | 564 | return showComicReader.value |
563 | 565 | }) |
564 | 566 |
|
| 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 | +
|
565 | 609 | // 方法 |
566 | 610 |
|
567 | 611 | const loadVideoDetail = async () => { |
|
0 commit comments