From c9928dd4f6d25e2339ea1400f59ec58674a927a7 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 19 六月 2025 20:07:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 pages/tabbar/index/home.vue |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/pages/tabbar/index/home.vue b/pages/tabbar/index/home.vue
index d0904d5..ade53fe 100644
--- a/pages/tabbar/index/home.vue
+++ b/pages/tabbar/index/home.vue
@@ -232,7 +232,7 @@
 <script>
 import { getRecommendVideos, savePlayRecord, subscribe, getVideoComments, addVideoComment, thubmsUpComment, cancelThubmsUpComment } from "@/api/video.js";
 import { changeCollect } from "@/api/collect.js";
-import { saveShare } from "@/api/share.js";
+import { saveShare, saveShareClickRecord } from "@/api/share.js";
 import { silentLogin } from "@/api/connect.js";
 import { getUserInfo } from "@/api/members";
 import storage from "@/utils/storage.js";
@@ -328,11 +328,16 @@
   onHide() {
   	this.startHidenTime = Date.now()
   },
-  onLoad() {
+  onLoad(option) {
 	  const token = storage.getAccessToken();
 	  if (! token) {
 		  this.wxSilentLogin(() => {
 			  this.loadVideos();
+			  // 鍒ゆ柇鏄笉鏄偣鍑诲垎浜摼鎺ヨ繘鏉ョ殑
+			  if (option.userId && option.videoId) {
+				  // 淇濆瓨鍒嗕韩鐐瑰嚮璁板綍
+				  saveShareClickRecord({refId: option.videoId, shareUserId: option.userId})
+			  }
 		  })
 	  } else { 
 		this.loadVideos();
@@ -712,6 +717,9 @@
 		if (this.videoContexts[this.currentIndex]) {
 			this.videoContexts[this.currentIndex].play();
 		}
+		// 璁剧疆褰撳墠鎾斁瑙嗛鐨勬�绘椂闀�
+		this.duration = this.videoList[this.currentIndex].videoDuration;
+		this.formartDuration = this.sliderFormatTime(this.duration);
     },
     
     // 鏀惰棌/鍙栨秷鏀惰棌
@@ -752,6 +760,11 @@
 		console.log(id, index, "瑙﹀彂鎾斁");
 		if(index === this.currentIndex) {
 			this.currentVideoIsPlaying = true;
+			if(! this.duration) {
+				// 璁剧疆褰撳墠鎾斁瑙嗛鐨勬�绘椂闀�
+				this.duration = this.videoList[this.currentIndex].videoDuration;
+				this.formartDuration = this.sliderFormatTime(this.duration);
+			}
 		} else {
 			this.currentVideoIsPlaying = false;
 			return
@@ -765,6 +778,7 @@
 			const duration = Date.now() - this.startPauseTime
 			this.totalPauseTime += duration
 		}
+		
     },
     
     // 瑙嗛鏆傚仠浜嬩欢
@@ -841,9 +855,9 @@
 	},
 	// 鑾峰彇瑙嗛鎬绘椂闀�
 	onLoadedMetadata(e) {
-	  this.duration = e.detail.duration;
-	  this.formartDuration = this.sliderFormatTime(this.duration);
-	  console.log("瑙嗛鎬绘椂闀�", this.duration);
+	  // this.duration = e.detail.duration;
+	  // this.formartDuration = this.sliderFormatTime(this.duration);
+	  // console.log("瑙嗛鎬绘椂闀�", this.duration);
 	},
 	// 淇濆瓨鎾斁璁板綍
 	async savePlayRecord() {
@@ -902,7 +916,7 @@
 	.video-info {
 	  width: 70%;
 	  position: absolute;
-	  bottom: 70px;
+	  bottom: 20px;
 	  left: 20px;
 	  color: #f8f8f8;
 	  z-index: 10;

--
Gitblit v1.8.0