From d068331e508b59f656d361500816cc96895b0b8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com>
Date: Thu, 18 Sep 2025 15:49:58 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=86=E9=A2=91=E6=92=AD?=
=?UTF-8?q?=E6=94=BE=E8=AF=84=E8=AE=BA=E5=AD=90=E8=AF=84=E8=AE=BA=E5=A4=84?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/plugins/video/detail/detail.vue | 200 ++++++++++++++------------
1 file changed, 109 insertions(+), 91 deletions(-)
diff --git a/pages/plugins/video/detail/detail.vue b/pages/plugins/video/detail/detail.vue
index a86db64a..26fbe3f2 100644
--- a/pages/plugins/video/detail/detail.vue
+++ b/pages/plugins/video/detail/detail.vue
@@ -4,22 +4,22 @@
-
+
▶
-
+
{{ video.fabulous_count }}
-
+
{{ video.comment_obj.count }}
-
-
+
+
分享
@@ -32,11 +32,8 @@
-
- {{ formatTime(current_video_progress) }} / {{ formatTime(current_video_duration) }}
+
+ {{ formatTime(current_video_progress) }} / {{ formatTime(current_video_duration) }}
@@ -55,7 +52,40 @@
@@ -76,20 +106,11 @@
// CommentModal
},
data() {
- const filledHeartSvg =
- ``;
- const outlineHeartSvg =
- ``;
- const commentSvg =
- ``;
- const shareSvg =
- ``;
-
return {
videoData: [{
id: '1',
is_fabulous: 1,
- userNick: 'WX: MAMBA_4EVER24',
+ userNick: '',
videoContent: '新视频来啦!',
fabulous_count: 1,
videoUrl: 'http://8.146.211.120:8080/upload/douyin/e6fddef474951cc15f5aeb99219b4a91.mp4',
@@ -102,19 +123,21 @@
userHead: 'http://8.146.211.120:8080/upload/notes/b11b2d741a5132b0d733a9861c9f6c7c.jpg',
userNick: '评论员A',
content: '这视频太酷了!',
- time: '2024-07-07 10:00:00'
+ time: '2024-07-07 10:00:00',
+ likeNum: 1,
}, {
id: 'c2',
userHead: 'http://8.146.211.120:8080/upload/notes/590118acb7cda2039657d464fdc285d6.jpg',
userNick: '评论员B',
content: '沙发!',
- time: '2024-07-07 09:30:00'
+ time: '2024-07-07 09:30:00',
+ likeNum: 0,
}]
}
}, {
id: '2',
is_fabulous: 0,
- userNick: 'WX: MAMBA_4EVER24',
+ userNick: '',
videoContent: '第二条视频',
fabulous_count: 1,
videoUrl: 'http://8.146.211.120:8080/upload/douyin/0985b0f3879c7dca9f6c1c6fb59d4a79.mp4',
@@ -127,7 +150,7 @@
}, {
id: '3',
is_fabulous: 1,
- userNick: 'WX: MAMBA_4EVER24',
+ userNick: '',
videoContent: '第三条视频内容',
fabulous_count: 1,
videoUrl: 'http://8.146.211.120:8080/upload/douyin/a4832a9a37b44196b49c646db148ec65.mp4',
@@ -152,10 +175,6 @@
is_seeking: false,
show_comment_modal: false,
active_comments: {},
- filledHeartIcon: 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(filledHeartSvg),
- outlineHeartIcon: 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(outlineHeartSvg),
- commentIcon: 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(commentSvg),
- shareIcon: 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(shareSvg),
comment_start_y: 0, // 评论开始拖拽位置
comment_current_y: 0, // 评论当前拖拽位置
move_distance: 0,
@@ -166,14 +185,13 @@
return this.show_comment_modal ? `height: calc(30% + ${this.move_distance}px);` : 'height: 100%;';
},
commentContentStyle() {
- return this.show_comment_modal ? `transform: translateY(10px); height: calc(70% - ${this.move_distance}px);` : `transform: translateY(0); height: 70%;`
+ return this.show_comment_modal ? `transform: translateY(3px); height: calc(70% - ${this.move_distance}px);` : `transform: translateY(0); height: 70%;`
},
},
onReady() {
this.videoData.forEach((item, index) => {
this.video_contexts[index] = uni.createVideoContext(`video_${index}`, this);
});
- // Start playing the first video
setTimeout(() => {
if (this.video_contexts[0]) {
this.video_contexts[0].play();
@@ -182,9 +200,7 @@
},
methods: {
handleSwiperChange(event) {
- const {
- current
- } = event.detail;
+ const { current } = event.detail;
const previousIndex = this.current_index;
if (this.video_contexts[previousIndex]) {
@@ -289,14 +305,14 @@
}
},
- handleShare(video) {
+ handle_share(video) {
uni.showToast({
title: '分享',
icon: 'none'
});
},
- handleTimeUpdate(e) {
+ handle_time_update(e) {
if (this.is_seeking) return;
if (e.detail.duration > 0 && this.current_video_duration === 0) {
this.current_video_duration = e.detail.duration;
@@ -304,11 +320,11 @@
this.current_video_progress = e.detail.currentTime;
},
- handleSliderChanging() {
+ handle_slider_changing() {
this.is_seeking = true;
},
- handleSliderChange(e) {
+ handle_slider_change(e) {
const seek_time = e.detail.value;
if (this.video_contexts[this.current_index]) {
this.video_contexts[this.current_index].seek(seek_time);
@@ -334,7 +350,6 @@