wangguoyu 1 месяц назад
Родитель
Сommit
a8f34f0e6e

+ 59 - 0
pages/xinshuxue/components/tishiDl2.vue

@@ -0,0 +1,59 @@
+<template>
+	<!-- 弹窗 -->
+	<view>
+		<uni-popup ref="popupRef" :animation="false" :is-mask-click="false" mask-background-color="rgba(0,0,0, 0.76);">
+			<view class="ezy-tip-dialog tip-e-dialog ">
+				<view class="close-btn" @click="handleClose"></view>
+				<view class="e-img kx-e-img"></view>
+				<view class="text-score">完成了本节能力提升题的学习</view>
+				<view class="time-tip-box" v-if="times">({{count}}S)</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script setup>
+	import {
+		nextTick,
+		ref
+	} from "vue"
+
+	const times = ref(null)
+	const count = ref(5);
+	const popupRef = ref(null);
+
+
+	function initTime() {
+		times.value = setTimeout(() => {
+			if (count.value == 0) {
+				handleClose();
+				return;
+			}
+			count.value--;
+			initTime()
+		}, 1000)
+	}
+
+	function clearTime() {
+		clearTimeout(times.value);
+		times.value = null;
+		count.value = 5;
+	}
+
+	function handleClose() {
+		clearTime();
+		popupRef.value.close();
+	}
+
+	function open() {
+		popupRef.value.open();
+		nextTick(() => initTime())
+	}
+
+	defineExpose({
+		open
+	})
+</script>
+
+<style>
+</style>

+ 2 - 1
pages/xinshuxue/components/videoPlay2.vue

@@ -40,7 +40,8 @@
 				this.count++;
 				this.count++;
 			},
 			},
 			playEnd() {
 			playEnd() {
-				this.$emit('playEnd')
+				// 增加videoPlay2 用于判断能力提升视频学习完不作为本节已学完的标准
+				this.$emit('playEnd','videoPlay2')
 			}
 			}
 		}
 		}
 	}
 	}

+ 30 - 18
pages/xinshuxue/lookShipin.vue

@@ -6,8 +6,10 @@
 		</view>
 		</view>
 		<view class="ezy-page-body ksp-page-body">
 		<view class="ezy-page-body ksp-page-body">
 			<view class="ksp-tab-box">
 			<view class="ksp-tab-box">
-				<ezyActiveVue class="ezy-tab-item-active tab-item" :class="{active: showA}" @click="handleSelectHexinti">核心基础题</ezyActiveVue>
-				<ezyActiveVue class="ezy-tab-item-active tab-item" :class="{active: showB}" @click="handleSelectNengliTishengti">能力提升题</ezyActiveVue>
+				<ezyActiveVue class="ezy-tab-item-active tab-item" :class="{active: showA}"
+					@click="handleSelectHexinti">核心基础题</ezyActiveVue>
+				<ezyActiveVue class="ezy-tab-item-active tab-item" :class="{active: showB}"
+					@click="handleSelectNengliTishengti">能力提升题</ezyActiveVue>
 			</view>
 			</view>
 			<!-- 核心基础题 -->
 			<!-- 核心基础题 -->
 			<videoPlayVue ref="c1" v-show="showA" :key="1" :videoId1="videoId" :progressMarkers1="progressMarkers"
 			<videoPlayVue ref="c1" v-show="showA" :key="1" :videoId1="videoId" :progressMarkers1="progressMarkers"
@@ -29,19 +31,20 @@
 				</view>
 				</view>
 				<!-- 能力提升题 -->
 				<!-- 能力提升题 -->
 				<template v-if="!!videoId2">
 				<template v-if="!!videoId2">
-					<view class="ksp-item-list" v-for="(item,index) in jieInfo.jiedianList2" :key="index" v-show="showB">
+					<view class="ksp-item-list" v-for="(item,index) in jieInfo.jiedianList2" :key="index"
+						v-show="showB">
 						<view class="list-head">
 						<view class="list-head">
 							<view class="list-title">{{item.name}}</view>
 							<view class="list-title">{{item.name}}</view>
 							<ezyActiveVue class="ezy-btn-active list-btn" @click="markersClick2(item)"></ezyActiveVue>
 							<ezyActiveVue class="ezy-btn-active list-btn" @click="markersClick2(item)"></ezyActiveVue>
 						</view>
 						</view>
-						<view class="list-body" >
+						<view class="list-body">
 							<!-- <view class="ksp-title">课程位置:{{item.time1}}-{{item.time2}}</view> -->
 							<!-- <view class="ksp-title">课程位置:{{item.time1}}-{{item.time2}}</view> -->
 							<rich-text :nodes="item.title"></rich-text>
 							<rich-text :nodes="item.title"></rich-text>
 						</view>
 						</view>
 					</view>
 					</view>
 				</template>
 				</template>
-				
-	
+
+
 			</view>
 			</view>
 			<!-- 无数据 -->
 			<!-- 无数据 -->
 			<template v-if="!videoId2 && showB">
 			<template v-if="!videoId2 && showB">
@@ -53,6 +56,7 @@
 		</view>
 		</view>
 		<!-- 弹窗 -->
 		<!-- 弹窗 -->
 		<tishiDlVue ref="popupRef"></tishiDlVue>
 		<tishiDlVue ref="popupRef"></tishiDlVue>
+		<tishiDlVue2 ref="popupRef2"></tishiDlVue2>
 	</view>
 	</view>
 
 
 </template>
 </template>
@@ -77,6 +81,7 @@
 	import cacheManager from "@/utils/cacheManager.js";
 	import cacheManager from "@/utils/cacheManager.js";
 	import * as httpApi from "@/api/chanpinShuxue.js";
 	import * as httpApi from "@/api/chanpinShuxue.js";
 	import tishiDlVue from './components/tishiDl.vue';
 	import tishiDlVue from './components/tishiDl.vue';
+	import tishiDlVue2 from './components/tishiDl2.vue';
 	import videoPlayVue from './components/videoPlay.vue';
 	import videoPlayVue from './components/videoPlay.vue';
 	import videoPlayVue2 from './components/videoPlay2.vue';
 	import videoPlayVue2 from './components/videoPlay2.vue';
 	import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
 	import ezyActiveVue from "@/components/ezyActive/ezyActive.vue";
@@ -119,6 +124,7 @@
 		},
 		},
 		components: {
 		components: {
 			tishiDlVue,
 			tishiDlVue,
+			tishiDlVue2,
 			videoPlayVue,
 			videoPlayVue,
 			videoPlayVue2,
 			videoPlayVue2,
 			ezyActiveVue
 			ezyActiveVue
@@ -139,18 +145,23 @@
 				if (this.showA) return;
 				if (this.showA) return;
 				this.showB = false;
 				this.showB = false;
 				this.showA = true;
 				this.showA = true;
-        this.$refs.c1 && this.$refs.c1.handleStop()
-        this.$refs.c2 && this.$refs.c2.handleStop()
+				this.$refs.c1 && this.$refs.c1.handleStop()
+				this.$refs.c2 && this.$refs.c2.handleStop()
 			},
 			},
 			handleSelectNengliTishengti() {
 			handleSelectNengliTishengti() {
 				if (this.showB) return;
 				if (this.showB) return;
 				this.showB = true;
 				this.showB = true;
 				this.showA = false;
 				this.showA = false;
-        this.$refs.c1 && this.$refs.c1.handleStop()
-        this.$refs.c2 && this.$refs.c2.handleStop()
+				this.$refs.c1 && this.$refs.c1.handleStop()
+				this.$refs.c2 && this.$refs.c2.handleStop()
 			},
 			},
 			//  当前节学习完成
 			//  当前节学习完成
-			saveJieWancheng() {
+			saveJieWancheng(data) {
+				if (data) {
+					console.log('增加videoPlay2 用于判断能力提升视频学习完不作为本节已学完的标准');
+					this.$refs.popupRef2.open();
+					return false
+				}
 				httpApi.getShuxueChanpinWancheng({
 				httpApi.getShuxueChanpinWancheng({
 					jieId: this.jieInfo.jieId
 					jieId: this.jieInfo.jieId
 				}).then(res => {
 				}).then(res => {
@@ -202,10 +213,11 @@
 				this.getDataInfo()
 				this.getDataInfo()
 			},
 			},
 			playEnd(data) {
 			playEnd(data) {
+				console.log('data', data);
 				// #ifdef APP-PLUS
 				// #ifdef APP-PLUS
 				plus.screen.lockOrientation('portrait-primary');
 				plus.screen.lockOrientation('portrait-primary');
 				// #endif
 				// #endif
-				this.saveJieWancheng();
+				this.saveJieWancheng(data);
 			},
 			},
 			getLive() {
 			getLive() {
 				if (!this.videoId) {
 				if (!this.videoId) {
@@ -236,7 +248,7 @@
 			markersClick(data) {
 			markersClick(data) {
 				this.showA = true;
 				this.showA = true;
 				this.showB = false;
 				this.showB = false;
-        this.$refs.c2 && this.$refs.c2.handleStop();
+				this.$refs.c2 && this.$refs.c2.handleStop();
 				this.seekTime = ""
 				this.seekTime = ""
 				this.$nextTick(() => {
 				this.$nextTick(() => {
 					this.seekTime = data.offset
 					this.seekTime = data.offset
@@ -245,17 +257,17 @@
 			markersClick2(data) {
 			markersClick2(data) {
 				this.showA = false;
 				this.showA = false;
 				this.showB = true;
 				this.showB = true;
-        this.$refs.c1 && this.$refs.c1.handleStop()
+				this.$refs.c1 && this.$refs.c1.handleStop()
 				this.seekTime2 = ""
 				this.seekTime2 = ""
 				this.$nextTick(() => {
 				this.$nextTick(() => {
 					this.seekTime2 = data.offset
 					this.seekTime2 = data.offset
 				});
 				});
 			},
 			},
 			goUpPage() {
 			goUpPage() {
-        uni.switchTab({
-          url: "/pages/chanpinneirong/index"
-        })
-				 // uni.navigateBack()
+				uni.switchTab({
+					url: "/pages/chanpinneirong/index"
+				})
+				// uni.navigateBack()
 				// uni.redirectTo({
 				// uni.redirectTo({
 				// 	url: "/pages/chanpinneirong/index"
 				// 	url: "/pages/chanpinneirong/index"
 				// })
 				// })