From 2e24923ed954974c3b134fae89cc23b64f4406b8 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 03 六月 2025 18:41:18 +0800
Subject: [PATCH] 视频主页-视频播放接口适配

---
 pages/video/home-page.vue |   39 +++++++++++++++++++++++++++++++--------
 1 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/pages/video/home-page.vue b/pages/video/home-page.vue
index a16c832..11cc980 100644
--- a/pages/video/home-page.vue
+++ b/pages/video/home-page.vue
@@ -65,7 +65,7 @@
 				  class="video-item" 
 				  v-for="(item, index) in videoList" 
 				  :key="item.id"
-				  @click="playVideo(index)"
+				  @click="playAuthorVideo(index)"
 				>
 				  <image class="video-cover" :src="item.coverUrl" mode="aspectFill"></image>
 				  <view class="video-info">
@@ -85,7 +85,7 @@
 				  class="video-item" 
 				  v-for="(item, index) in collectVideoList" 
 				  :key="item.id"
-				  @click="playVideo(index)"
+				  @click="playCollectVideo(index)"
 				>
 				  <image class="video-cover" :src="item.coverUrl" mode="aspectFill"></image>
 				  <view class="video-info">
@@ -212,9 +212,11 @@
 		getAuthorVideoPage(this.videoQuery).then(res => {
 			this.videoList = res.data.data
 			this.videoTotal = res.data.total
+			if(res.data.data.length < this.videoQuery.pageSize) {
+				this.nomoreVideo = true;
+			}
 		})
 	},
-	// 鑾峰彇浣滃搧淇℃伅
     // 鍒囨崲鍏虫敞鐘舵��
     toggleFollow() {
       if(this.userInfo.hasSub) {
@@ -260,16 +262,37 @@
 		this.collectVideoQuery.authorId = this.authorId
 		getAuthorCollectVideoPage(this.collectVideoQuery).then(res => {
 			this.collectVideoList = res.data.data
+			if(res.data.data.length < this.collectVideoQuery.pageSize) {
+				this.nomoreCollectVideo = true;
+			}
 		})
 	},
-    // 鎾斁瑙嗛
-    playVideo(index) {
-      const videoItem = this.videoList[index];
+    // 鎾斁浣滆�呰棰�
+    playAuthorVideo(index) {
+	  const playInfo = {
+		  videoList: this.videoList,
+		  nomore: this.nomoreVideo,
+		  pageNumber: this.videoQuery.pageNumber,
+		  playIndex: index
+	  }
+	  uni.setStorageSync("playInfo", playInfo)
       uni.navigateTo({
-        url: `/pages/video/play?id=${videoItem.id}`
+        url: `/pages/video/video-play?authorId=${this.authorId}&videoFrom=author`
       });
     },
-    
+    // 鎾斁鏀惰棌瑙嗛
+    playAuthorVideo(index) {
+      const playInfo = {
+    	  videoList: this.collectVideoList,
+    	  nomore: this.nomoreCollectVideo,
+    	  pageNumber: this.collectVideoQuery.pageNumber,
+    	  playIndex: index
+      }
+      uni.setStorageSync("playInfo", playInfo)
+      uni.navigateTo({
+        url: `/pages/video/video-play?authorId=${this.authorId}&videoFrom=collect`
+      });
+    },
     // 缂栬緫涓汉璧勬枡
     editProfile() {
       uni.navigateTo({

--
Gitblit v1.8.0