From a38e1bd4e649108e6e8b4659e5ec6ce14c7e4540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E9=B9=8F?= Date: Fri, 30 May 2025 18:35:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E8=A7=86=E9=A2=91=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=BB=84=E4=BB=B6=E4=B8=AD=E6=B7=BB=E5=8A=A0=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=85=A8=E5=B1=8F=E6=92=AD=E6=94=BE=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8F=8A=E6=93=8D=E4=BD=9C=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/p2p/videoLog.vue | 89 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 6 deletions(-) diff --git a/pages/p2p/videoLog.vue b/pages/p2p/videoLog.vue index 9bec776..4cff9e5 100644 --- a/pages/p2p/videoLog.vue +++ b/pages/p2p/videoLog.vue @@ -59,11 +59,9 @@ {{ item.event_type_name }} - 删除 - + class="i-material-symbols:more-horiz text-#999999 size-45 font-bold" + @click="operateEvent(item.event_id)" + > {{ formatTime(item.event_time) }} @@ -72,7 +70,17 @@ {{ item.text }} - + {{ formatRemainingTime(item.video_expire_at) }} @@ -121,6 +129,9 @@ const requestFlag = ref(false) const deviceInfo = ref(null) + const fullscreenVideoId = ref(null) + const isFullscreenChanging = ref(false) + const currentPlayingVideoId = ref(null) onMounted(async () => { deviceInfo.value = await $basic.getDeviceInfo() @@ -135,6 +146,17 @@ } }) + const operateEvent = eventId => { + uni.showActionSheet({ + itemList: ['删除'], + success: ({ tapIndex }) => { + if (tapIndex === 0) { + deleteEvent(eventId) + } + } + }) + } + const toWebview = () => { $basic.routeJump({ name: 'webview', @@ -343,4 +365,59 @@ } return { code, data, message } } + + const playVideoFullscreen = eventId => { + if (fullscreenVideoId.value === eventId) { + return + } + + if (isFullscreenChanging.value) { + return + } + + if (currentPlayingVideoId.value && currentPlayingVideoId.value !== eventId) { + const currentVideoContext = uni.createVideoContext(`video-${currentPlayingVideoId.value}`) + currentVideoContext.pause() + } + + const videoId = `video-${eventId}` + const videoContext = uni.createVideoContext(videoId) + + isFullscreenChanging.value = true + currentPlayingVideoId.value = eventId + videoContext.play() + + setTimeout(() => { + if (fullscreenVideoId.value !== eventId) { + videoContext.requestFullScreen({ + direction: 0 + }) + } + setTimeout(() => { + isFullscreenChanging.value = false + }, 500) + }, 300) + } + + const onFullscreenChange = (eventId, event) => { + if (event.detail.fullScreen) { + fullscreenVideoId.value = eventId + } else { + fullscreenVideoId.value = null + } + } + + const onVideoPlay = eventId => { + if (currentPlayingVideoId.value && currentPlayingVideoId.value !== eventId) { + const currentVideoContext = uni.createVideoContext(`video-${currentPlayingVideoId.value}`) + currentVideoContext.pause() + } + currentPlayingVideoId.value = eventId + } + + const onVideoPause = eventId => { + if (currentPlayingVideoId.value === eventId) { + currentPlayingVideoId.value = null + } + }