Browse Source

样式修改

tanxue 2 ngày trước cách đây
mục cha
commit
554d33dccb

+ 6 - 3
common/styles/global/pages.scss

@@ -211,6 +211,7 @@
 	.jzkh-icon{background-image: url("@/static/images/index/jzkh-icon.png");}
 	.sfht-icon{background-image: url("@/static/images/index/sfht-icon.png");}
 	.ycms-icon{background-image: url("@/static/images/index/ycms-icon.png");}
+	.zyhb-icon{background-image: url("@/static/images/index/zyhb-icon.png");}
 }
 /*** 考试页面***/
 .phone-list-page{
@@ -351,8 +352,8 @@
 	display: flex;height: 100vh;flex-direction: column;
 	
 	.master-image{
-		width: 100%;height: 460rpx;position: relative;
-		@include ezy-no-repeat-cover();background-image: url("@/static/images/common/video-bj.png");
+		position: relative;@include ezy-no-repeat-cover();
+		background-image: url("@/static/images/common/video-bj.png");
 	}
 	// 课程引导阴影
 	.yindao-shadow-image{
@@ -418,15 +419,17 @@
 	  	.prism-player .prism-progress .prism-progress-played{background-color: #3fd2a1;}
 	  	.prism-player .prism-progress .prism-progress-cursor{background: unset;}
 	  }
+	  .master-image{width: 100%;height: 460rpx;}
 	  .kecheng-study-body{display: block;}
 	}
 	
 	/* 横屏样式 */
 	@media screen and (orientation: landscape) {
 	  .phone-video-box{
-		  -width:100%;height: 100vh;
+		  width:100%;height: 100vh;
 		  .kecheng-video{height: 100vh!important;width: auto;}
 	  }
+	  .master-image{width:100%;height: 100vh;}
 	  .kecheng-study-body{display: none;}
 	}
 	

+ 179 - 0
components/SimpleDanmakuPlayer.vue

@@ -0,0 +1,179 @@
+<template>
+  <view class="player-container" :class="{ fullscreen: isFullscreen }">
+    <!-- 视频 -->
+    <video
+      :src="videoSrc"
+      controls
+      :autoplay="false"
+      style="width: 100%; height: 100%;"
+    ></video>
+
+    <!-- 普通全屏按钮(非全屏时显示,H5/App 都可用) -->
+    <!-- 注意:这个按钮不能放在 cover-view 里,否则 App 上可能不响应 -->
+    <!-- 所以我们只在非全屏、非 App/小程序时显示它 -->
+    <!-- #ifndef APP-PLUS && !MP-WEIXIN -->
+    <view v-if="!isFullscreen" class="btn" @click.stop="enterFullscreen">🔲</view>
+    <!-- #endif -->
+
+    <!-- 覆盖层:仅用于 App 和小程序 -->
+    <!-- #ifdef APP-PLUS || MP-WEIXIN -->
+    <cover-view class="cover-layer">
+      <!-- 固定弹幕:不接收点击,透传事件 -->
+      <cover-view class="fixed-danmaku">我爱弹幕111</cover-view>
+
+      <!-- 全屏按钮(非全屏时显示) -->
+      <cover-view
+        v-if="!isFullscreen"
+        class="control-btn"
+        @click="enterFullscreen"
+      >🔲</cover-view>
+
+      <!-- 退出全屏按钮(全屏时显示) -->
+      <cover-view
+        v-if="isFullscreen"
+        class="control-btn exit"
+        @click="exitFullscreen"
+      >◻️</cover-view>
+    </cover-view>
+    <!-- #endif -->
+
+    <!-- H5 覆盖层(普通 view) -->
+    <!-- #ifndef APP-PLUS && !MP-WEIXIN -->
+    <view v-if="isFullscreen" class="h5-cover">
+      <view class="fixed-danmaku">我爱弹幕111</view>
+      <view class="control-btn exit" @click="exitFullscreen">◻️</view>
+    </view>
+    <!-- #endif -->
+  </view>
+</template>
+
+<script setup>
+import { ref } from 'vue'
+
+const videoSrc = 'http://www.w3school.com.cn/i/movie.mp4' // 替换为你的视频地址
+
+const isFullscreen = ref(false)
+
+const enterFullscreen = () => {
+  isFullscreen.value = true
+  // #ifdef APP-PLUS
+  plus.navigator.setFullscreen(true)
+  // #endif
+}
+
+const exitFullscreen = () => {
+  isFullscreen.value = false
+  // #ifdef APP-PLUS
+  plus.navigator.setFullscreen(false)
+  // #endif
+}
+</script>
+
+<style scoped>
+.player-container {
+  position: relative;
+  width: 100%;
+  height: 240px;
+  background: #000;
+}
+
+.player-container.fullscreen {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100vw;
+  height: 100vh;
+  z-index: 9999;
+}
+
+/* ===== App & 小程序:cover-view 方案 ===== */
+/* #ifdef APP-PLUS || MP-WEIXIN */
+.cover-layer {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  /* 关键:默认不拦截事件 */
+  pointer-events: none;
+}
+
+.fixed-danmaku {
+  position: absolute;
+  bottom: 100rpx;
+  left: 50%;
+  transform: translateX(-50%);
+  padding: 10rpx 20rpx;
+  background: rgba(0, 0, 0, 0.6);
+  color: #fff;
+  font-size: 28rpx;
+  border-radius: 10rpx;
+  white-space: nowrap;
+  /* 不需要 pointer-events: auto,保持透传 */
+}
+
+/* 只有按钮需要接收点击 */
+.control-btn {
+  position: absolute;
+  right: 16rpx;
+  bottom: 16rpx;
+  width: 64rpx;
+  height: 64rpx;
+  border-radius: 50%;
+  background: rgba(0, 0, 0, 0.6);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: white;
+  font-size: 28rpx;
+  /* 关键:只在这里开启事件 */
+  pointer-events: auto;
+}
+
+.control-btn.exit {
+  /* 退出按钮样式可复用 */
+}
+/* #endif */
+
+/* ===== H5 方案 ===== */
+/* #ifndef APP-PLUS && !MP-WEIXIN */
+.h5-cover {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  pointer-events: none;
+}
+
+.h5-cover .fixed-danmaku {
+  position: absolute;
+  bottom: 50px;
+  left: 50%;
+  transform: translateX(-50%);
+  padding: 6px 12px;
+  background: rgba(0, 0, 0, 0.6);
+  color: white;
+  font-size: 16px;
+  border-radius: 6px;
+  white-space: nowrap;
+}
+
+.h5-cover .control-btn {
+  position: absolute;
+  right: 10px;
+  bottom: 10px;
+  width: 32px;
+  height: 32px;
+  border-radius: 50%;
+  background: rgba(0, 0, 0, 0.6);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: white;
+  font-size: 14px;
+  pointer-events: auto;
+  cursor: pointer;
+}
+/* #endif */
+</style>

+ 1 - 1
pages/admin/ShouYe/shouye.vue

@@ -100,7 +100,7 @@
 				<text>远程面试</text>
 			</view>
 			<view @click="goToPage('zyhb')" class="card-item-box">
-				<icon class="index-icon ycms-icon"></icon>
+				<icon class="index-icon zyhb-icon"></icon>
 				<text>职业海报</text>
 			</view>
 		</view>

BIN
static/images/index/zyhb-icon.png