feat: 首页播放视频与tab重复问题处理
This commit is contained in:
@@ -8,7 +8,23 @@
|
||||
hover-stay-time="80"
|
||||
@tap="handleCardTap(panoramaMainCards[0])"
|
||||
>
|
||||
<video
|
||||
v-if="isMp4Video(panoramaMainCards[0].coverImageUrl)"
|
||||
class="absolute inset-0 h-full w-full"
|
||||
:src="panoramaMainCards[0].coverImageUrl"
|
||||
autoplay
|
||||
loop
|
||||
muted
|
||||
:controls="false"
|
||||
:show-center-play-btn="false"
|
||||
:show-play-btn="false"
|
||||
:show-fullscreen-btn="false"
|
||||
:show-mute-btn="false"
|
||||
:enable-progress-gesture="false"
|
||||
object-fit="cover"
|
||||
/>
|
||||
<image
|
||||
v-else
|
||||
class="absolute inset-0 h-full w-full"
|
||||
:src="panoramaMainCards[0].coverImageUrl"
|
||||
mode="aspectFill"
|
||||
@@ -144,6 +160,10 @@ const activeOtherCard = computed(() => {
|
||||
return panoramaOtherCards.value[activeSwiperIndex.value] || panoramaOtherCards.value[0];
|
||||
});
|
||||
|
||||
const isMp4Video = (url) => {
|
||||
return typeof url === "string" && /\.mp4(?:[?#].*)?$/i.test(url.trim());
|
||||
};
|
||||
|
||||
const handleSwiperChange = (event) => {
|
||||
activeSwiperIndex.value = Number(event.detail?.current || 0);
|
||||
};
|
||||
|
||||
@@ -78,6 +78,7 @@ const handleContentScroll = (e) => {
|
||||
/// 点击主景区
|
||||
const handleMainPanoramaClick = () => {
|
||||
isMainPanoramaGuide.value = true;
|
||||
discoveryTabs.value = [];
|
||||
discoveryCards.value = [];
|
||||
exploreCards.value = [];
|
||||
discoveryQuickQuestions.value = [];
|
||||
|
||||
Reference in New Issue
Block a user