From e4f0862bd8af0ac1c7aab59904b69dd071526aff Mon Sep 17 00:00:00 2001
From: inleft <inleft@qq.com>
Date: Fri, 12 Aug 2022 23:59:41 +0800
Subject: [PATCH] 视频模块添加播放历史

---
 src/components/mini/box16-videoDetail.vue |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/src/components/mini/box16-videoDetail.vue b/src/components/mini/box16-videoDetail.vue
index 7071b88..d093711 100644
--- a/src/components/mini/box16-videoDetail.vue
+++ b/src/components/mini/box16-videoDetail.vue
@@ -1,12 +1,12 @@
 <template>
 	<div>
-		<div class="boxMain">
-			<videoPlayBox ref="videoPlayBox"></videoPlayBox>
+		<div class="boxMain ">
+			<videoPlayBox ref="videoPlayBox" @swichPlay="swichPlay"></videoPlayBox>
 		</div>
-		<div style="padding: 20px 20px 5px;margin-bottom: 20px;" class="myShadow">
+		<div style="padding: 20px 20px 5px;margin-bottom: 20px;" class="myShadow fadeInLeft">
 			<pre>{{introduce}}</pre>
 		</div>
-		<div class="articleComment">
+		<div class="articleComment fadeInRight">
 			<comment ref="myComment" :articleId="articleId" :isAllowedComment="isAllowedComment" :foldReply="true" />
 		</div>
 	</div>
@@ -59,11 +59,16 @@
 					url: "",
 					type: "normal",
 					title: "",
+					introduce: "",
 					id: ""
 				}
 			}
 		},
 		methods: {
+			swichPlay(videoData) {
+				this.introduce = videoData.introduce;
+				this.$refs.myComment.updateCommentList(videoData.id);
+			},
 			showVideo(item) {
 				//防止重复加载
 				this.lastArticleId = this.articleId;
@@ -78,6 +83,10 @@
 				this.loadData();
 			},
 			loadData() {
+
+				if (this.$refs.videoPlayBox.isPlaying) {
+					this.$message.info("上个视频正在播放中")
+				}
 
 				if (this.myLock) {
 					this.$message.info("正在努力加载中..", 3)
@@ -113,6 +122,7 @@
 					this.videoData.url = res.data.articleFileURL;
 					this.videoData.img = res.data.coverFileURL;
 					this.videoData.title = res.data.title;
+					this.videoData.introduce = res.data.introduce;
 					this.videoData.id = res.data.id;
 
 
@@ -126,7 +136,8 @@
 
 					this.myLock = !this.myLock;
 					if (this.lastArticleId != this.articleId) {
-						_this.$refs.videoPlayBox.changePlay(this.videoData)
+						let tempParam = JSON.parse(JSON.stringify(this.videoData))
+						_this.$refs.videoPlayBox.startPlay(tempParam)
 					}
 				})
 
@@ -145,6 +156,7 @@
 	}
 
 	.boxMain {
+		user-select: none;
 		display: flex;
 		justify-content: center;
 		padding: 5px 20px;

--
Gitblit v1.9.1