chenxiong 3 gadi atpakaļ
vecāks
revīzija
46220672b1

+ 2 - 1
common/httpList/answer.js

@@ -7,7 +7,8 @@ export default {
 		return myRequest({
 			url: '/app/answer/list',
 			method: 'get',
-			data: data
+			data: data,
+			noLoading:true
 		})
 	},
 	postAnswer(data) {

+ 16 - 7
common/request.js

@@ -13,7 +13,7 @@ export const BASE_URL = 'http://42.192.164.187:19005'    //test
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'  //test
 export const tenantId = '867735392558919680' 
 export const myRequest = (options) => {
-	if (store.state.allowLoading) {
+	if (store.state.allowLoading && !options.noLoading) {
 		uni.showLoading({
 			title: '拼命加载中...'
 		})
@@ -39,12 +39,17 @@ export const myRequest = (options) => {
 				// 	num++
 				// }
 				// doRequest(options)
+					
 				if (res.data.code == 401) {
 					if (num <= 2) {
 						if (!uni.getStorageSync('user_account')) {
-							uni.navigateTo({
-								url: '/pages/login/login'
-							});
+							var pages = getCurrentPages() // 获取栈实例
+							let currentRoute  = pages[pages.length-1].route; // 获取当前页面路由
+							if(currentRoute != 'pages/login/login') {
+								uni.navigateTo({
+									url: '/pages/login/login'
+								});
+							}
 						} else {
 							num++
 							res = await doRequest(options)
@@ -52,9 +57,13 @@ export const myRequest = (options) => {
 
 					}else{
 						uni.removeStorageSync('user_account');
-						// uni.navigateTo({
-						// 	url: '/pages/login/login'
-						// });
+						var pages = getCurrentPages() // 获取栈实例
+						let currentRoute  = pages[pages.length-1].route; // 获取当前页面路由
+						if(currentRoute != 'pages/login/login') {
+							uni.navigateTo({
+								url: '/pages/login/login'
+							});
+						}
 					}
 				}
 				resolve(res)

+ 10 - 0
pages2/appointment/kporder.vue

@@ -206,6 +206,11 @@ export default {
 							uni.reLaunch({
 								url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`
 							});
+						} else {
+							uni.showToast({
+								icon:'none',
+								title:res.data.msg
+							})
 						}
 					});
 				} else {
@@ -215,6 +220,11 @@ export default {
 							uni.reLaunch({
 								url: `/pages2/appointment/appointment_success?subscribeId=${res.data.data}`
 							});
+						} else {
+							uni.showToast({
+								icon:'none',
+								title:res.data.msg
+							})
 						}
 					});
 				}

+ 4 - 1
pages2/wd/class.vue

@@ -71,10 +71,13 @@
 												<text v-if="item.classStatus == 0">未开班</text>
 											</view>
 											<view class="state" v-if="item.classStatus == 0">教务处正在为您开通班级,请耐心等待</view>
+											<view class="state" v-if="item.classStatus == 1">
+												班级有效期:{{$method.timestampToTime(item.classStartTime)}}-{{$method.timestampToTime(item.classEndTime)}}
+											</view>
 										</view>
 									</view>
 									
-									<view class="class-warm">
+									<view class="class-warm" v-if="item.classStatus == 1 || item.classStatus === null">
 										<view class="class-warm__text">
 											<view class="date">
 												<template v-if="sysTime >= item.studyStartTime && sysTime <= item.studyEndTime">

+ 30 - 18
pages3/polyv/detail.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<nav-bar title="课程详情" v-if="navShow"></nav-bar>
+		<nav-bar title="课程详情" v-show="navShow"></nav-bar>
 		<view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;" id="top">
 			<view class="video_box" v-if="!startStatus">
 				<image :src="$method.splitImgHost(detail.coverUrl)" mode="widthFix" style="width: 100%;height: 460rpx;"></image>
@@ -272,6 +272,7 @@ export default {
 			isAllowSeek: 'no',
 			playbackRate: [1.0],
 			timer: null,
+			answerTimer:null,
 			goodsPhotographConfig: null,
 			intervalTimeList: [], // 间隔拍照时长
 			intervalTimeIndex: 0, //当前处于哪个时间段拍照
@@ -314,6 +315,9 @@ export default {
 		this.courseDetail();
 		this.getGoodsDetail();
 		this.getAnswerList();
+		this.answerTimer = setInterval(() => {
+			this.getAnswerList();
+		},5000)
 		let noteSecond = Number(option.noteSecond);
 		if(noteSecond>0){
 			//我的消息跳过来,播放节
@@ -441,6 +445,7 @@ export default {
 		console.log('onUnload')
 		//移除所有的事件监听器
 		uni.$off();
+		clearInterval(this.answerTimer)
 		if (this.timer) {
 			clearInterval(this.timer);
 		}
@@ -668,7 +673,6 @@ export default {
 		courseBusiness(){
 			this.$api.courseBusiness(this.goodsData.businessId).then(res => {
 				this.businessData = res.data.data;
-				this.businessData.goodsLearningOrder = 2;
 			})
 		},
 		/**
@@ -1214,19 +1218,27 @@ export default {
 			}
 			console.log('提交接口', data);
 			this.$api.studyRecord(data).then(res => {
-				if (status > 0) {
-					let moduleId = this.moduleId || 0;
-					let chapterId = this.chapterId || 0;
-					let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
-					let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`;  //拼接对应章节唯一id
-					console.log(playNextId,'playNextId')
-					console.log(playNextIdisRebuild,'playNextIdisRebuild')
+				if(res.data.code == 200) {
 					
-					uni.$emit('playNext'+playNextIdisRebuild,{fromRebuild:this.isRebuild}); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
-					uni.$emit('playNext'+playNextId); //通知播放结束
+					if (status > 0) {
+						let moduleId = this.moduleId || 0;
+						let chapterId = this.chapterId || 0;
+						let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
+						let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`;  //拼接对应章节唯一id
+						console.log(playNextId,'playNextId')
+						console.log(playNextIdisRebuild,'playNextIdisRebuild')
+						
+						uni.$emit('playNext'+playNextIdisRebuild,{fromRebuild:this.isRebuild}); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
+						uni.$emit('playNext'+playNextId); //通知播放结束
+					}
+					
+					self.ossAvatarUrl = ''
+				} else {
+					uni.showToast({
+						icon:'none',
+						title:res.data.msg
+					})
 				}
-				
-				self.ossAvatarUrl = ''
 				console.log(res,'res');
 			});
 		},
@@ -1346,7 +1358,6 @@ export default {
 								//暂停
 								polyvPlayerContext.exitFullScreen();
 								polyvPlayerContext.pause();
-								this.photoHistoryList.push(i)
 								this.photoIndex = i
 								this.openPhoto();
 								
@@ -1425,8 +1436,8 @@ export default {
 		},
 		async submit() {
 			const waitYS = await this.imageInfos();
-			try{
-				await this.postCoursePhotoRecord()
+			this.postCoursePhotoRecord().then(res => {
+				this.photoHistoryList.push(this.photoIndex)
 				this.postStudyRecord(); //提交记录
 				//恢复播放
 				
@@ -1436,13 +1447,14 @@ export default {
 				if (polyvPlayerContext != null) {
 					polyvPlayerContext.play();
 				}
-			} catch(err) {
+			}).catch(err => {
 				uni.showToast({
 					title: '上传接口报错,请重新拍照上传' + err,
 					icon: 'none'
 				});
 				this.openPhoto();
-			}
+			})
+				
 			
 		},
 		reTake() {