chenxiong 3 tahun lalu
induk
melakukan
43d579e3fd
4 mengubah file dengan 313 tambahan dan 6 penghapusan
  1. 104 1
      pages/index/index.vue
  2. 108 3
      pages2/msg/detail.vue
  3. 100 1
      pages2/plan/index.vue
  4. 1 1
      pages2/wd/class.vue

+ 104 - 1
pages/index/index.vue

@@ -279,12 +279,115 @@ export default {
 				}
 			});
 		},
-		jumpGoodsDetail(item){
+		/**
+		 * @param {Object} item 
+		 * 跳转课程详情
+		 */
+		async jumpGoodsDetail(item){
+			let currentTime = this.$method.getZeroTime();
+			
+			if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
+				uni.showToast({
+					title:'不在学习有效期,不可以学习了哦',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
+				uni.showToast({
+					title:'不在班级有效期,不能进入学习',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if(item.learningStatus == 2) {
+				uni.showToast({
+					title:'开放学习时间待定,不能进入学习',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if(item.classStatus == 0 ) {
+				uni.showToast({
+					title:'尚未开班,不能进入学习',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
+				uni.showToast({
+					title:'不在开放学习时间,不能进入学习',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) &&  (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
+				
+				uni.showModal({
+					title:'提示',
+					content:'班级已过期,需要重新选班',
+					showCancel:false,
+					success:() => {
+						uni.navigateTo({
+							url:"/pages2/wd/class"
+						})
+					}
+				})
+				return;
+			}
+			
+			let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
+			
+			if(rebuildStatus == 0) {
+				this.$navTo.togo('/pages2/learn/details', {
+					gradeId:item.gradeId,
+					goodsId: item.goodsId
+				})
+				return;
+			}
+			
+			if(item.courseNum == 1 ) {
+				
+				this.$api.courseCourseList({
+					pageNum:1,
+					pageSize:1,
+					goodsId:item.goodsId,
+					gradeId:item.gradeId
+				}).then(res => {
+					if(res.data.code == 200) {
+						uni.navigateTo({
+							url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+						})
+					}
+				});
+				return;
+			}
+			
+			
 			this.$navTo.togo('/pages2/wd/course', {
 				id: item.goodsId,
 				gid:item.gradeId
 			});
 		},
+		/**
+		 * @param {Object} goodsId 商品id
+		 * 查询商品重修状态
+		 */
+		courseGoodsRebuildStatus(goodsId,gradeId) {
+			return new Promise(resolve => {
+				this.$api.courseGoodsRebuildStatus({
+					goodsId:goodsId,
+					gradeId:gradeId
+				}).then(res => {
+					resolve(res.data.data)
+				})
+			})
+		},
 		preveItem() {
 			if (this.goodsIndex > 0) {
 				this.goodsIndex = this.goodsIndex - 1;

+ 108 - 3
pages2/msg/detail.vue

@@ -29,7 +29,7 @@
 			</view>
 		</view>
 		<view class="btn1" @click="isOk" v-if="listData.systemStatus === 2 && listData.receiptStatus === 0">我已阅读</view>
-		<view class="btn1" v-if="statusGO && listData.systemStatus === 1 && getNames(listData.remindId) !== ''" @click="jumpFuns(listData)">{{ getNames(listData.remindId) }}</view>
+		<view class="btn1" v-if="statusGO && listData.systemStatus === 1 && getNames(listData.remindId) !== ''" @click="jumpFuns(goodsData,listData.remindId)">{{ getNames(listData.remindId) }}</view>
 	</view>
 </template>
 
@@ -40,6 +40,7 @@ export default {
 	data() {
 		return {
 			listData: {},
+			goodsData:{},
 			id: null,
 			img1: '/static/icon/msg_icon1.png',
 			img2: '/static/icon/msg_icon2.png',
@@ -65,8 +66,8 @@ export default {
 	},
 	methods: {
 		//跳转页面
-		jumpFuns(item) {
-			switch (item.remindId) {
+		async jumpFuns(item,remindId) {
+			switch (remindId) {
 				case 1:
 				case 3:
 				case 5:
@@ -79,6 +80,95 @@ export default {
 				case 10:
 				case 12:
 				case 18:
+					
+					let currentTime = this.$method.getZeroTime();
+					console.log(currentTime)
+					console.log(item)
+					console.log(item.studyStartTime)
+					console.log(item.studyEndTime)
+					console.log(currentTime < item.studyStartTime || currentTime > item.studyEndTime)
+					if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
+						uni.showToast({
+							title:'不在学习有效期,不可以学习了哦',
+							icon:'none'
+						})
+						return;
+					}
+					
+					if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
+						uni.showToast({
+							title:'不在班级有效期,不能进入学习',
+							icon:'none'
+						})
+						return;
+					}
+					
+					if(item.learningStatus == 2) {
+						uni.showToast({
+							title:'开放学习时间待定,不能进入学习',
+							icon:'none'
+						})
+						return;
+					}
+					
+					if(item.classStatus == 0 ) {
+						uni.showToast({
+							title:'尚未开班,不能进入学习',
+							icon:'none'
+						})
+						return;
+					}
+					
+					if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
+						uni.showToast({
+							title:'不在开放学习时间,不能进入学习',
+							icon:'none'
+						})
+						return;
+					}
+					
+					if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) &&  (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
+						
+						uni.showModal({
+							title:'提示',
+							content:'班级已过期,需要重新选班',
+							showCancel:false,
+							success:() => {
+								uni.navigateTo({
+									url:"/pages2/wd/class"
+								})
+							}
+						})
+						return;
+					}
+					
+					let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
+					
+					if(rebuildStatus == 0) {
+						this.$navTo.togo('/pages2/learn/details', {
+							gradeId:item.gradeId,
+							goodsId: item.goodsId
+						})
+						return;
+					}
+					
+					if(item.courseNum == 1 ) {
+						
+						this.$api.courseCourseList({
+							pageNum:1,
+							pageSize:1,
+							goodsId:item.goodsId,
+							gradeId:item.gradeId
+						}).then(res => {
+							if(res.data.code == 200) {
+								uni.navigateTo({
+									url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+								})
+							}
+						});
+						return;
+					}
+					
 					this.$navTo.togo('/pages2/wd/course', {
 						id: item.goodsId,
 						gid: item.gradeId
@@ -126,6 +216,20 @@ export default {
 					break;
 			}
 		},
+		/**
+		 * @param {Object} goodsId 商品id
+		 * 查询商品重修状态
+		 */
+		courseGoodsRebuildStatus(goodsId,gradeId) {
+			return new Promise(resolve => {
+				this.$api.courseGoodsRebuildStatus({
+					goodsId:goodsId,
+					gradeId:gradeId
+				}).then(res => {
+					resolve(res.data.data)
+				})
+			})
+		},
 		//跳转节视频
 		jumpSection(item) {
 			item.noteSecond = Number(item.topicNum) * 60; //转秒数
@@ -189,6 +293,7 @@ export default {
 					}
 					this.listData = res.data.data;
 					this.$api.goodsDetail(res.data.data.goodsId).then(rs => {
+						this.goodsData = rs.data.data
 						if (
 							rs.data.data.goodsType === 3 &&
 							(res.data.data.remindId === 1 ||

+ 100 - 1
pages2/plan/index.vue

@@ -382,13 +382,112 @@ export default {
 			}
 			
 		},
-		jumpDetail(item) {
+		async jumpDetail(item) {
+			
+			let currentTime = this.$method.getZeroTime();
+			
+			if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
+				uni.showToast({
+					title:'不在学习有效期,不可以学习了哦',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
+				uni.showToast({
+					title:'不在班级有效期,不能进入学习',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if(item.learningStatus == 2) {
+				uni.showToast({
+					title:'开放学习时间待定,不能进入学习',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if(item.classStatus == 0 ) {
+				uni.showToast({
+					title:'尚未开班,不能进入学习',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
+				uni.showToast({
+					title:'不在开放学习时间,不能进入学习',
+					icon:'none'
+				})
+				return;
+			}
+			
+			if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) &&  (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
+				
+				uni.showModal({
+					title:'提示',
+					content:'班级已过期,需要重新选班',
+					showCancel:false,
+					success:() => {
+						uni.navigateTo({
+							url:"/pages2/wd/class"
+						})
+					}
+				})
+				return;
+			}
+			
+			let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
+			
+			if(rebuildStatus == 0) {
+				this.$navTo.togo('/pages2/learn/details', {
+					gradeId:item.gradeId,
+					goodsId: item.goodsId
+				})
+				return;
+			}
+			
+			if(item.courseNum == 1 ) {
+				
+				this.$api.courseCourseList({
+					pageNum:1,
+					pageSize:1,
+					goodsId:item.goodsId,
+					gradeId:item.gradeId
+				}).then(res => {
+					if(res.data.code == 200) {
+						uni.navigateTo({
+							url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+						})
+					}
+				});
+				return;
+			}
+			
 			this.$navTo.togo('/pages2/wd/course', {
 				id: item.goodsId,
 				gid:item.gradeId
 			});
 			return;
 		},
+		/**
+		 * @param {Object} goodsId 商品id
+		 * 查询商品重修状态
+		 */
+		courseGoodsRebuildStatus(goodsId,gradeId) {
+			return new Promise(resolve => {
+				this.$api.courseGoodsRebuildStatus({
+					goodsId:goodsId,
+					gradeId:gradeId
+				}).then(res => {
+					resolve(res.data.data)
+				})
+			})
+		},
 		replay(index) {
 			if (index == 0) {
 				return '日';

+ 1 - 1
pages2/wd/class.vue

@@ -370,7 +370,7 @@ export default {
 			if(item.classStatus == 0) {
 				uni.showToast({
 					icon:'none',
-					title:'尚未开班,不能进入学习'
+					title:'尚未开班不能进入学习'
 				})
 				return 
 			}