From 60e5c5ea203b64d30857a0fa24b9bb7f03ab904a Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期三, 18 六月 2025 23:09:29 +0800
Subject: [PATCH] 补签
---
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