wangxy 2 miesięcy temu
rodzic
commit
8a8dd4245d
1 zmienionych plików z 20 dodań i 21 usunięć
  1. 20 21
      pages/admin/Kecheng/study.vue

+ 20 - 21
pages/admin/Kecheng/study.vue

@@ -5,11 +5,11 @@
 			<text class="nav-bar-title">{{name}}</text>
 		</view>
 		<!-- 播放器 -->
-		<videoPlayVue ref="videoRef" class="phone-video-box" v-if="kechengFlag"></videoPlayVue>
+		<videoPlayVue ref="videoRef" class="phone-video-box" v-if="showVideo"></videoPlayVue>
 		<view v-else class="phone-video-box master-image"></view>
 		<!-- 中间区域 -->
 		<view class="kc-info-box">
-			<view>时长:{{period}}分钟</view>
+			<view>时长:{{period}}</view>
 			<view>{{userCount}}人学习</view>
 		</view>
 		<!-- 大纲 -->
@@ -35,7 +35,7 @@
 		useUserCache
 	} from "@/utils/userCache.js"
 	import {
-		formatDuration
+		formatSecondsToCnhms
 	} from "@/utils/common.js"
 
 	export default {
@@ -45,6 +45,7 @@
 		},
 		data() {
 			return {
+				showVideo: false,
 				items: ['目录', '介绍'],
 				colors: ['#007aff', '#4cd964', '#dd524d'],
 				activeColor: '#3fd2a1',
@@ -56,7 +57,10 @@
 				list: [],
 				intro: '',
 				curPlayData: null,
-				kechengFlag: null
+				kechengFlag: null,
+				zyName: '',
+				zyLevelName: '',
+				operId: '', // 课程
 			}
 		},
 		onLoad(options) {
@@ -91,7 +95,7 @@
 					})
 					return;
 				}
-				
+				this.showVideo = true;
 				if (this.curPlayData && this.curPlayData.videoId == data.videoId) {
 					return;
 				}
@@ -103,7 +107,7 @@
 						videoId: data.url,
 						playAuth: res.data,
 						seekTime: '',
-						isPlay: true
+						isPlay: false
 					})
 				})
 			},
@@ -112,11 +116,7 @@
 					// 设置默认展开项
 					this.list[0].open = true;
 					this.list[0].jieList[0].open = true;
-					
 					const kejian = this.list[0].jieList[0].kejianList[0];
-					if (this.kechengFlag == 1) {
-						this.handlePlay(kejian)
-					}	
 				}
 			},
 			init() {
@@ -129,25 +129,24 @@
 						name,
 						kejianUserVo,
 						intro,
-						kechengFlag
+						kechengFlag,
+						operId,
+						zyName,
+						zyLevelName,
 					} = res.data;
 					this.userCount = userCount;
-					this.period = formatDuration(period);
+					this.period = formatSecondsToCnhms(period,true);
 					this.name = name;
+					this.zyName = zyName;
+					this.zyLevelName = zyLevelName;
 					this.kechengFlag = kechengFlag;
-					let testData = JSON.parse(JSON.stringify([...kejianUserVo.zhangList, ...kejianUserVo.zhangList,
-						...kejianUserVo.zhangList
-					]))
-					this.formatData(testData)
-					this.list = testData;
+					this.formatData(kejianUserVo.zhangList)
+					this.list = kejianUserVo.zhangList;
 					this.intro = intro;
-
+					this.operId = operId;
 					
 					this.initFirstVideo();
 
-					uni.setNavigationBarTitle({
-						title: this.name
-					});
 				})
 			}
 		}