wangguoyu 1 maand geleden
bovenliggende
commit
0c9836b37e
1 gewijzigde bestanden met toevoegingen van 18 en 5 verwijderingen
  1. 18 5
      pages/client/Kecheng/study.vue

+ 18 - 5
pages/client/Kecheng/study.vue

@@ -5,15 +5,16 @@
 		<!-- 	<videoPlayVue v-if="showVideo" ref="videoRef" class="phone-video-box" @play-end="onPlayEnd" @play-play="onPlay"
 			@play-pause="onPause" @play-timeupdate="onTimeupdate"></videoPlayVue> -->
 
-		<video v-if="showVideo" :src="videoUrl" :poster="videoPoster" controls class="phone-video-box" @play="onVideoPlay"
-			@pause="onVideoPause" @ended="onVideoEnd" @error="onVideoError" id="myVideo"></video>
+		<video v-if="showVideo" :src="videoUrl" :poster="videoPoster" controls class="phone-video-box"
+			@play="onVideoPlay" @pause="onVideoPause" @ended="onVideoEnd" @error="onVideoError" id="myVideo"></video>
 
 		<!-- 视频背景图 -->
 		<view v-else class="phone-video-box master-image" :style="{ backgroundImage: 'url(' + imgsArr.videoBj + ')' }">
 			<!-- <view class="video-player-icon" @click="handlePlayFirst"></view> -->
 		</view>
 		<!-- 播放引导 -->
-		<view class="yindao-shadow-image" v-if="!showVideo" :style="{ backgroundImage: 'url(' + imgsArr.pointIcon + ')' }"> </view>
+		<view class="yindao-shadow-image" v-if="!shaDowImgFlag"
+			:style="{ backgroundImage: 'url(' + imgsArr.pointIcon + ')' }"> </view>
 		<!-- 中间区域 -->
 		<view class="kc-name-box">
 			<view>{{name}}</view>
@@ -74,6 +75,7 @@
 		data() {
 			return {
 				showVideo: false,
+				shaDowImgFlag: false,
 				items: ['目录', '介绍'],
 				colors: ['#007aff', '#4cd964', '#dd524d'],
 				activeColor: '#3fd2a1',
@@ -173,8 +175,8 @@
 
 
 			handlePlayFirst() {
-				
-				console.log('this.list',this.list);
+
+				console.log('this.list', this.list);
 				if (this.list && this.list[0].jieList && this.list[0].jieList[0].kejianList) {
 					// 设置默认展开项
 					this.list[0].open = true;
@@ -263,6 +265,16 @@
 				if (this.current !== e.currentIndex) {
 					this.current = e.currentIndex
 				}
+				// if (this.current == 0) {
+				// 	if (!this.showVideo) {
+				// 		this.shaDowImgFlag = false
+				// 	} else {
+				// 		this.shaDowImgFlag = true
+				// 	}
+				// } else {
+				// 	this.shaDowImgFlag = true
+				// }
+				this.shaDowImgFlag = this.current !== 0 || this.showVideo
 			},
 			formatData(data) {
 				data.forEach(zhang => {
@@ -275,6 +287,7 @@
 			},
 			handlePlay(data) {
 				this.showVideo = true;
+				this.shaDowImgFlag = true;
 				if (this.curPlayData && this.curPlayData.url == data.url) {
 					return;
 				}