From 9ac342cdebca34f39243d4d724709f55dc02baac Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 29 七月 2025 12:01:41 +0800
Subject: [PATCH] 活动列表问题,视频主页图片显示问题

---
 pages/video/home-page.vue |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/pages/video/home-page.vue b/pages/video/home-page.vue
index 340c171..c00838f 100644
--- a/pages/video/home-page.vue
+++ b/pages/video/home-page.vue
@@ -74,6 +74,7 @@
 				  v-for="(item, index) in videoList"
 				  :key="item.id"
 				>
+				  
 				  <image class="video-cover" @click="playAuthorVideo(index)" :src="item.videoContentType === 'video' ? item.coverUrl : item.imgs[0]" mode="aspectFill"></image>
 				  <view class="video-info">
 				    <view class="video-stats">
@@ -103,7 +104,16 @@
 				  :key="item.id"
 				  @click="playCollectVideo(index)"
 				>
-				  <image class="video-cover" :src="item.videoContentType === 'video' ? item.coverUrl : item.imgs[0]" mode="aspectFill"></image>
+				<image v-if="tem.videoContentType === 'img'" class="video-cover" :src="item.imgs[0]" mode="aspectFill"></image>
+					<video v-else class="video-cover" 
+					:src="item.videoUrl" 
+					initial-time='0.01' 
+					muted
+					:controls="false"
+					:show-center-play-btn="false"
+					object-fit="cover"></video>
+	
+				  <!-- <image class="video-cover" :src="getCoverUrl(item)"></image> -->
 				  <view class="video-info">
 				    <view class="video-stats">
 				      <view class="stat">
@@ -123,7 +133,13 @@
 				  :key="item.id"
 				  @click="playLikeVideo(index)"
 				>
-				  <image class="video-cover" :src="item.videoContentType === 'video' ? item.coverUrl : item.imgs[0]" mode="aspectFill"></image>
+				  <video class="video-cover"
+				  :src="item.videoContentType === 'video' ? item.videoUrl : item.imgs[0]" mode="aspectFill" 
+				  initial-time='0.01' 
+				  muted
+				  :controls="false"
+				  :show-center-play-btn="false"
+				  object-fit="cover"></video>
 				  <view class="video-info">
 				    <view class="video-stats">
 				      <view class="stat">
@@ -246,6 +262,13 @@
 	this.getAuthorVideoPage();
   },
   methods: {
+	   getCoverUrl(item) {
+	        if (item.videoContentType === 'video') {
+	          // OSS瑙嗛灏侀潰鍙傛暟锛堝畬鏁存牸寮忥級
+	          return `${item.videoUrl}?x-oss-process=video/snapshot,t_1000,f_jpg,m_fast`
+	        }
+	        return item.imgs?.[0]
+	      },
 	dialogClose() {
 		this.opVideo = {
 			id: '',

--
Gitblit v1.8.0