chenxiong 3 gadi atpakaļ
vecāks
revīzija
7397dcf75b

+ 4 - 1
components/course/courseSection.vue

@@ -163,6 +163,7 @@ export default {
 				this.$store.commit('setPlayVID', {playVID  :this.menuItem.recordingUrl});
 				uni.$emit('levelId', this.levelId)
 				uni.$emit('getSection', this.menuItem)
+				uni.$off('playEnd')
 				uni.$on('playEnd',res => {
 					console.log(1)
 					uni.$off('playEnd')
@@ -190,7 +191,9 @@ export default {
 				this.$store.commit('setPlayChannelId', {playChannelId  :this.menuItem.liveUrl});
 				uni.$emit('levelId', this.levelId)
 				uni.$emit('getChannel', this.menuItem)
-				uni.$on('playEnd',res => { //绑定播放结束,刷新章节列表
+				uni.$off('playEnd')
+				uni.$on('playEnd',res => {
+					console.log('playEnd')
 					uni.$off('playEnd')
 					this.$emit('playEnd')
 				})

+ 7 - 4
pages2/wd/class.vue

@@ -144,7 +144,7 @@
 			
 			<view class="bottomBox">
 				<template v-if="item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > sysTime) && (item.studyStartTime < sysTime) &&  (item.classEndTime && (item.classEndTime < sysTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0">
-					<view class="restart" @click.stop="selectClass(item)">
+					<view class="restart" @click.stop="selectClass(item,index)">
 						选班重学
 					</view>
 				</template>
@@ -279,8 +279,9 @@ export default {
 				this.sysTime = res.data.data;
 			})
 		},
-		selectClass(item) {
+		selectClass(item,index) {
 			console.log(item)
+			this.itemIndex = index;
 			this.selectItem = item;
 			this.selectClassModal = true;
 			this.goodsGradeList(item.goodsId);
@@ -462,11 +463,13 @@ export default {
 			  goodsId: this.selectItem.goodsId,
 			  gradeId: this.gradeValue,
 			  oldGradeId: this.selectItem.gradeId,
-			  orderGoodsId: this.selectItem.goodsId,
+			  orderGoodsId: this.selectItem.orderGoodsId,
 			  userId: this.selectItem.userId
 			}).then(res => {
 				if(res.data.code == 200) {
-					
+					if(this.itemIndex !== '') {
+						this.refreshByIndex();
+					}
 					this.selectClassModal = false;
 					uni.showToast({
 						title:'选班成功'

+ 7 - 3
pages3/polyv/detail.vue

@@ -410,6 +410,7 @@ export default {
 		this.$store.commit('setPlayChannelId', { playChannelId: 0 });
 		this.$store.commit('setPlayVID', { playVID: null });
 		this.closePlv()
+		console.log('onUnload')
 		//移除所有的事件监听器
 		uni.$off();
 		if (this.timer) {
@@ -447,7 +448,7 @@ export default {
 		 * 模块大节播放完毕,刷新列表 
 		 */
 		sectionPlayEnd(index) {
-			console.log(index)
+			console.log('sectionPlayEnd')
 			this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
 				if (res.data.code == 200) {
 					res.data.rows[index].name = res.data.rows[index].menuName;
@@ -974,9 +975,12 @@ export default {
 			}
 			console.log('提交接口', data);
 			this.$api.studyRecord(data).then(res => {
-				uni.$emit('playEnd'); //通知播放结束
+				if (status > 0) {
+					uni.$emit('playEnd'); //通知播放结束
+				}
+				
 				self.ossAvatarUrl = ''
-				console.log(res);
+				console.log(res,'res');
 			});
 		},
 		uploadFile(options, int) {