From 8be04ed0bd844a00f060b0c9ea37dfa882b23989 Mon Sep 17 00:00:00 2001 From: zsk <710162063@qq.com> Date: Wed, 10 Sep 2025 10:18:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- root/detail/job.vue | 187 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 110 insertions(+), 77 deletions(-) diff --git a/root/detail/job.vue b/root/detail/job.vue index d0dd5a8..54dba2e 100644 --- a/root/detail/job.vue +++ b/root/detail/job.vue @@ -93,56 +93,29 @@ - - - - - - - - - + + @@ -352,7 +325,6 @@ --> - 1{{swiperArray}}2
@@ -687,6 +659,7 @@ export default { }, data() { return { + isFullscreen: false, // 添加全屏状态跟踪 globalData: getApp().globalData, videoContextTemp: {}, goImLoading: false, // 跳转im的loading @@ -1240,7 +1213,9 @@ export default { console.log("showVideo that.swiperArray", that.swiperArray); this.videoContext = uni.createVideoContext(`${e.id}`, this); that.videoContextTemp = that.videoContext; - this.videoContext.requestFullScreen(); + this.videoContext.requestFullScreen({ + direction: "landscape", // 横屏全屏 + }); this.videoContext.hideStatusBar(); this.videoContext.play(); }, @@ -1283,11 +1258,14 @@ export default { } }, fullScreen(e) { - console.log(e); - if (!e.detail.fullScreen) { - this.videoContext.stop(); - } - }, + console.log(e); + this.muted = true; + this.isFullscreen = e.detail.fullScreen; // 更新全屏状态 + + if (!e.detail.fullScreen) { + this.videoContext.stop(); + } + }, shareVideo(e) { var that = this; console.log(e); @@ -1651,31 +1629,86 @@ export default { .u-swiper__wrapper__item { margin-right: 10px; } + image { border-radius: 4px !important; } + + .banner-scroll { + width: 100%; + white-space: nowrap; + + .scroll-content { + display: inline-block; + white-space: nowrap; + + .scroll-item { + display: inline-block; + width: 58px; + height: 58px; + margin-right: 12px; + vertical-align: top; + + &:last-child { + margin-right: 0; + } + + .videoContainer { + position: relative; + background-color: #000; // 黑色背景 + + .theVideo { + width: 100%; + height: 100%; + + // 小图时隐藏控制栏 + ::v-deep .uni-video-controls { + display: none !important; + } + + // 全屏时显示控制栏 + ::v-deep .uni-video-fullscreen-controls { + display: block !important; + } + } + + // 小图时只显示居中的播放按钮 + ::v-deep .uni-video-cover-play-button { + display: block !important; + width: 40px; + height: 40px; + margin: auto; + } + } + } + } + } + // .swiper { - // // 为最后一个视频项目添加特殊处理 - // swiper-item:last-child { - // .videoContainer { - // // 确保视频容器不会被裁剪 - // overflow: visible !important; - - // .theVideo { - // // 确保视频元素能够完整显示 - // width: 100%; - // height: 100%; - // } - - // .shareVideo { - // // 调整分享按钮位置,确保不会遮挡视频 - // right: 10px; - // bottom: 10px; - // } - // } - // } - // } + + // // 为最后一个视频项目添加特殊处理 + // swiper-item:last-child { + // .videoContainer { + // // 确保视频容器不会被裁剪 + // overflow: visible !important; + + // .theVideo { + // // 确保视频元素能够完整显示 + // width: 100%; + // height: 100%; + // } + + // .shareVideo { + // // 调整分享按钮位置,确保不会遮挡视频 + // right: 10px; + // bottom: 10px; + // } + // } + // } + // } } + + .m-state { position: fixed; left: 0;