Quellcode durchsuchen

Squashed commit of the following:

commit 46b8f28a2c29b3096f78424ec7c02dfc982bec7a
Author: chenxiong <544464634@qq.com>
Date:   Thu Mar 31 10:13:53 2022 +0800

    修复bug

commit 51a8540f573d4a6ea725b6b28e483fd4f1e4e24d
Author: chenxiong <544464634@qq.com>
Date:   Wed Mar 30 17:33:03 2022 +0800

    修复bug

commit 0e918f57ab28480d125a9cde284aab6e30842f0e
Author: chenxiong <544464634@qq.com>
Date:   Wed Mar 30 14:10:25 2022 +0800

    修复bug

commit 806b1391a47082b389ec5e8235011d24a76d6f23
Author: chenxiong <544464634@qq.com>
Date:   Tue Mar 29 13:46:41 2022 +0800

    修复bug
chenxiong vor 3 Jahren
Ursprung
Commit
7985ff3279

+ 18 - 0
common/httpList/goods.js

@@ -358,6 +358,24 @@ export default {
 		})
 	},
 	
+	studyRecordMenuAllList(data) {
+		return myRequest({
+			url: '/study/record/menuAllList',
+			method: 'get',
+			data:data
+		})
+	},
+	
+	
+	
+	goodsTodayStudySectionNum(data) {
+		return myRequest({
+			url: '/goods/todayStudySectionNum',
+			method: 'get',
+			data:data
+		})
+	},
+	
 	goodsQuestionList(data) {
 		return myRequest({
 			url: '/app/common/bank/question/list',

+ 13 - 0
common/httpList/order.js

@@ -18,6 +18,19 @@ export default {
 			data: data
 		})
 	},
+	/**
+	 * @param {Object} data
+	 * 查询订单商品退款列表
+	 */
+	orderRefundList(data) {
+		return myRequest({
+			url: '/order/refund/list',
+			method: 'get',
+			data: data
+		})
+	},
+	
+	
 	//查询订单列表
 	getorderlists(data) {
 		return myRequest({

+ 4 - 4
common/methodTool.js

@@ -63,14 +63,14 @@ export default {
 	 */
 	timestampToTime(timestamp, isDay = true) {
 		var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-		var Y = date.getFullYear() + '-';
-		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
-		var D = date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ';
+		var Y = date.getFullYear() + '';
+		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '';
+		var D = date.getDate() < 10 ? '0' + date.getDate() + '' : date.getDate() + '';
 		var h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
 		var m = date.getMinutes() < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
 		var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
 		if (isDay) {
-			return Y + M + D;
+			return Y +'年'+ M +'月'+ D +'日';
 		}
 		return Y + M + D + h + m + s;
 	},

+ 1 - 0
common/request.js

@@ -5,6 +5,7 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
+// export const BASE_URL = 'http://120.79.166.78:19009'   //预发布
 export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'http://192.168.1.222:5055'    //dev
 

+ 2 - 2
common/socket.js

@@ -73,11 +73,11 @@ const sokcet = (sockeUrl) => {
 			uni.showToast({
 				icon:'none',
 				title:'用户在其他终端登录,强制下线',
-				duration:1000,
+				duration:3000,
 			})
 			setTimeout(() => {
 				method.exit();
-			},1000)
+			},3000)
 		}
 	});
 

+ 69 - 2
components/course/courseChapter.vue

@@ -8,7 +8,7 @@
 		<view v-show="!down">
 			<view v-for="(itemM,indexM) in list" :key="indexM">
 				<view v-if="itemM.type!=2">
-					<courseSection :preItem="list[indexM-1] || preItem" :learningOrder="learningOrder" :courseId="courseId" @playEnd="refreshList($event)" :goodsId="goodsId" :isBuy="isBuy" :nextMenuItem="findNextSection(indexM)" :isRebuild="isRebuild" :gradeId="gradeId" :menuItem="itemM" :levelId="levelId+'-'+itemM.sectionId"></courseSection>
+					<courseSection :sectionMaxNum="sectionMaxNum" :preItem="list[indexM-1] || preItem" :learningOrder="learningOrder" :courseId="courseId" @playEnd="refreshList($event)" :goodsId="goodsId" :isBuy="isBuy" :nextMenuItem="findNextSection(indexM)" :isRebuild="isRebuild" :gradeId="gradeId" :menuItem="itemM" :levelId="levelId+'-'+itemM.sectionId"></courseSection>
 					<u-line v-if="indexM<list.length-1"></u-line>
 				</view>
 				<view v-if="itemM.type==2">
@@ -80,6 +80,9 @@ export default {
 		gradeId: {
 			type: Number,
 			default: 0
+		},
+		sectionMaxNum:{
+			default:undefined
 		}
 	},
 	components: {
@@ -110,6 +113,15 @@ export default {
 	},
 	methods: {
 		 ...mapMutations(['updateChapterOpen']),
+		 goodsTodayStudySectionNum() {
+		 	return new Promise(resolve => {
+		 		this.$api.goodsTodayStudySectionNum({goodsId:this.goodsId,gradeId:this.gradeId}).then(res => {
+		 			if(res.data.code == 200) {
+		 				resolve(res.data.data)
+		 			}
+		 		})
+		 	})
+		 },
 		refreshList(isRebuild) {
 			console.log(9999)
 			let moduleId = this.menuItem.moduleId?this.menuItem.moduleId:0
@@ -132,11 +144,36 @@ export default {
 			}
 			return {}
 		},
+		studyRecordMenuAllList() {
+			return new Promise(resolve => {
+				
+				this.$api.studyRecordMenuAllList({
+					courseId:this.courseId,
+					gradeId:this.gradeId,
+					goodsId:this.goodsId
+				}).then(res => {
+					if(res.data.code == 200) {
+						resolve(res.data.data)
+					}
+				})
+			})
+		},
 		/**
 		 * 去做题
 		 */
 		async toDo(id,goodsId =0,moduleId = 0, chapterId = 0,item,index) {
 			
+			// let learnNum = await this.goodsTodayStudySectionNum()
+			
+			// if(this.sectionMaxNum > 0) {
+			// 	if(learnNum >= this.sectionMaxNum) {
+			// 		uni.showToast({
+			// 			icon:'none',
+			// 			title:`每天最多学习${this.sectionMaxNum}节`
+			// 		})
+			// 		return;
+			// 	}
+			// }
 			console.log(this.learningOrder,'this.learningOrder')
 			if(this.learningOrder == 1) {
 				if(this.canLearn) {
@@ -170,7 +207,37 @@ export default {
 				}
 			} else if(this.learningOrder == 2 && !item.rebuild) {
 				let canLearn = this.list[index-1].learning == 1; 
-				if(canLearn) { //视频的上一节学完
+				let rows = await this.studyRecordMenuAllList();
+				let isStop = false;
+				let newRows = [];
+				for(let i = 0; i < rows.length; i++ ) {
+					let moduleTrue = rows[i].moduleId == moduleId;
+					let chapterTrue = rows[i].chapterId == chapterId;
+					if(moduleTrue && chapterTrue) {
+						isStop = true;
+						if(rows[i].sectionType != 2) {
+							newRows.push(rows[i])
+						}
+					} else {
+						if(!isStop) {
+							if(rows[i].sectionType != 2) {
+								newRows.push(rows[i])
+							}
+							
+						} else {
+							break;
+						}
+						
+					}
+				}
+				console.log(newRows)
+				let isAllLearn = newRows.every(item => {
+					return item.studyStatus == 1;
+				})
+				
+				if(isAllLearn) { //之前的都学完了
+					
+				// if(canLearn) { //视频的上一节学完
 					
 					let num = await this.bankRecordDoNum(item.typeId)
 					//有次数限制

+ 4 - 1
components/course/courseModule.vue

@@ -7,7 +7,7 @@
 		</view>
 		<view v-show="!down">
 			<view v-for="(itemM,indexM) in list" :key="indexM">
-				<courseChapter :preItem="list[indexM - 1] || preItem" :needOpen="needOpen" @playEnd="playEnd($event)" @toDo="toDo($event)" :courseId="courseId" :learningOrder="learningOrder" :goodsId="goodsId" :isBuy="isBuy" :gradeId="gradeId" :isRebuild="isRebuild"  :menuItem="itemM" :levelId="levelId+'-'+itemM.chapterId"></courseChapter>
+				<courseChapter :preItem="list[indexM - 1] || preItem" :sectionMaxNum="sectionMaxNum" :needOpen="needOpen" @playEnd="playEnd($event)" @toDo="toDo($event)" :courseId="courseId" :learningOrder="learningOrder" :goodsId="goodsId" :isBuy="isBuy" :gradeId="gradeId" :isRebuild="isRebuild"  :menuItem="itemM" :levelId="levelId+'-'+itemM.chapterId"></courseChapter>
 				<u-line v-if="indexM<list.length-1"></u-line>
 			</view>
 		</view>
@@ -58,6 +58,9 @@ export default {
 		gradeId: {  //重修需要班级ID
 			type: Number,
 			default: 0
+		},
+		sectionMaxNum:{
+			default:undefined
 		}
 	},
 	components: {

+ 116 - 48
components/course/courseSection.vue

@@ -6,9 +6,9 @@
 				<view class="tag tagColor2" v-if="menuItem.sectionType==2">直播</view>
 				<view class="tag tagColor3" v-if="menuItem.sectionType==3">回放</view>
 				<view class="t_content">
-					<view v-if="menuItem.sectionType==1" :class="playSectionId==newId && playNextId==playId?'color1':''">{{menuItem.name}}</view>
-					<view v-if="menuItem.sectionType==2" :class="playSectionId==newId && playNextId==playId?'color2':''">{{menuItem.name}}</view>
-					<view v-if="menuItem.sectionType==3" :class="playSectionId==newId && playNextId==playId?'color3':''">{{menuItem.name}}</view>
+					<view v-if="menuItem.sectionType==1" :class="playSectionId==newId && playNextId==playId?'color1':''">{{menuItem.name || ''}}</view>
+					<view v-if="menuItem.sectionType==2" :class="playSectionId==newId && playNextId==playId?'color2':''">{{menuItem.name || ''}}</view>
+					<view v-if="menuItem.sectionType==3" :class="playSectionId==newId && playNextId==playId?'color3':''">{{menuItem.name || ''}}</view>
 					<view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.sectionType==2 && menuItem.liveStartTime">
 						<view v-if="menuItem.liveStartTime>nowTime">
 							<text>{{$method.timestampToTime(menuItem.liveStartTime, isDay =false)}}</text>-
@@ -22,7 +22,7 @@
 						</view> -->
 					</view>
 				</view>
-				<view v-if="menuItem.sectionType==null">{{menuItem.name}}</view>
+				<view v-if="menuItem.sectionType==null">{{menuItem.name || ''}}</view>
 			</view>
 			<view style="font-size: 20rpx;color: #FF3B30;"  v-if="menuItem.liveStartTime && menuItem.sectionType != 3">
 				<view class="tagWillPlay" v-if="menuItem.liveStartTime>nowTime">
@@ -92,6 +92,9 @@ export default {
 			type: Object,
 			default: {}
 		},
+		sectionMaxNum:{
+			default:undefined,
+		},
 	},
 	watch:{
 		menuItem(val) {
@@ -106,7 +109,8 @@ export default {
 			clickLock:false, //点击锁,防止连续点击多次
 		};
 	},
-	onLoad() {},
+	onLoad() {
+	},
 	created() {
 		
 	},
@@ -166,59 +170,123 @@ export default {
 		});
 	},
 	methods: {
-		getVideo(){
+		studyRecordMenuAllList() {
+			return new Promise(resolve => {
+				
+				this.$api.studyRecordMenuAllList({
+					courseId:this.courseId,
+					gradeId:this.gradeId,
+					goodsId:this.goodsId
+				}).then(res => {
+					if(res.data.code == 200) {
+						resolve(res.data.data)
+					}
+				})
+			})
+		},
+		goodsTodayStudySectionNum() {
+			return new Promise(resolve => {
+				this.$api.goodsTodayStudySectionNum({goodsId:this.goodsId,gradeId:this.gradeId}).then(res => {
+					if(res.data.code == 200) {
+						resolve(res.data.data)
+					}
+				})
+			})
+		},
+		async getVideo(){
 			if(this.clickLock) {
 				return;
 			}
+
 			this.clickLock = true;
 			console.log(this.learningOrder,'this.learningOrder')
 			console.log(this.preItem,'this.preItem')
-			if(this.learningOrder == 2 && !this.isRebuild) { //要按从头到尾顺序学习, 且不是重修课程
+			// let learnNum = await this.goodsTodayStudySectionNum()
+			
+			// if(this.sectionMaxNum > 0) {
+			// 	if(learnNum >= this.sectionMaxNum) {
+			// 		uni.showToast({
+			// 			icon:'none',
+			// 			title:`每天最多学习${this.sectionMaxNum}节`
+			// 		})
+			// 		return;
+			// 	}
+			// }
+			if(this.learningOrder == 2 && !this.menuItem.isRebuild) { //要按从头到尾顺序学习, 且不是重修课程
 				if(this.preItem) {
-					if(this.preItem.menuType == 3) { //上一个是节
-						if(this.preItem.learning == 1) { //上一节学完
-							this.playVideo();
+					let rows = await this.studyRecordMenuAllList();
+					let newRows = [];
+					for(let i = 0; i < rows.length; i++ ) {
+						let moduleTrue = (rows[i].moduleId == this.menuItem.menuId) || (rows[i].moduleId == this.menuItem.moduleId)
+						let chapterTrue = rows[i].chapterId == this.menuItem.chapterId;
+						let sectionTrue = rows[i].sectionId == this.menuItem.sectionId;
+						if(moduleTrue && chapterTrue && sectionTrue) {
+							break;
 						} else {
-							uni.showToast({
-								icon:'none',
-								title:'请按顺序学习视频课程'
-							})
-						}
-					} else if(this.preItem.menuType == 2) { //上一个是章
-						this.$api.reSectionList({chapterId: this.preItem.menuId || this.preItem.chapterId,gradeId:this.gradeId,courseId:this.courseId,moduleId:this.preItem.moduleId || 0}).then(res => {
-							if(res.data.code==200){
-								let lastItem = res.data.data[res.data.data.length -1];
-								if(lastItem.learning == 1) {
-									this.playVideo();
-								} else {
-									uni.showToast({
-										icon:'none',
-										title:'请按顺序学习视频课程'
-									})
-								}
+							if(rows[i].sectionType != 2) {
+								newRows.push(rows[i])
 							}
-						});
-					} else if(this.preItem.menuType == 1) { //上一个是模块
-						this.$api.reChapterList({moduleId:this.preItem.menuId,gradeId:this.gradeId,courseId:this.courseId}).then(res => {
-							if(res.data.code==200){
-								let lastChapterItem = res.data.data[res.data.data.length -1];
+							
+						}
+					}
+					console.log(newRows)
+					let isAllLearn = newRows.every(item => {
+						return item.studyStatus == 1;
+					})
+					
+					if(isAllLearn) {
+						this.playVideo();
+					} else {
+						uni.showToast({
+							icon:'none',
+							title:'请按顺序学习视频课程'
+						})
+					}
+					
+					// if(this.preItem.menuType == 3) { //上一个是节
+					// 	if(this.preItem.learning == 1) { //上一节学完
+					// 		this.playVideo();
+					// 	} else {
+					// 		uni.showToast({
+					// 			icon:'none',
+					// 			title:'请按顺序学习视频课程'
+					// 		})
+					// 	}
+					// } else if(this.preItem.menuType == 2) { //上一个是章
+					// 	this.$api.reSectionList({chapterId: this.preItem.menuId || this.preItem.chapterId,gradeId:this.gradeId,courseId:this.courseId,moduleId:this.preItem.moduleId || 0}).then(res => {
+					// 		if(res.data.code==200){
+					// 			let lastItem = res.data.data[res.data.data.length -1];
+					// 			if(lastItem.learning == 1) {
+					// 				this.playVideo();
+					// 			} else {
+					// 				uni.showToast({
+					// 					icon:'none',
+					// 					title:'请按顺序学习视频课程'
+					// 				})
+					// 			}
+					// 		}
+					// 	});
+					// } else if(this.preItem.menuType == 1) { //上一个是模块
+					// 	this.$api.reChapterList({moduleId:this.preItem.menuId,gradeId:this.gradeId,courseId:this.courseId}).then(res => {
+					// 		if(res.data.code==200){
+					// 			let lastChapterItem = res.data.data[res.data.data.length -1];
 								
-								this.$api.reSectionList({chapterId:lastChapterItem.chapterId,gradeId:this.gradeId,courseId:this.courseId,moduleId:this.menuItem.menuId || this.menuItem.moduleId}).then(res => {
-									if(res.data.code==200){
-										let lastSectionItem = res.data.data[res.data.data.length -1];
-										if(lastSectionItem.learning == 1) {
-											this.playVideo();
-										} else {
-											uni.showToast({
-												icon:'none',
-												title:'请按顺序学习视频课程'
-											})
-										}
-									}
-								});
-							}
-						});
-					} 
+					// 			this.$api.reSectionList({chapterId:lastChapterItem.chapterId,gradeId:this.gradeId,courseId:this.courseId,moduleId:this.menuItem.menuId || this.menuItem.moduleId}).then(res => {
+					// 				if(res.data.code==200){
+					// 					let lastSectionItem = res.data.data[res.data.data.length -1];
+					// 					if(lastSectionItem.learning == 1) {
+					// 						this.playVideo();
+					// 					} else {
+					// 						uni.showToast({
+					// 							icon:'none',
+					// 							title:'请按顺序学习视频课程'
+					// 						})
+					// 					}
+					// 				}
+					// 			});
+					// 		}
+					// 	});
+					// } 
 				} else { //第一章第一节
 					this.playVideo();
 				}

+ 1 - 1
pages2/bank/my_question.vue

@@ -9,7 +9,7 @@
 				</view>
 				<view class=".content_box">
 					<image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
-					学习有效期<text class="content"> {{$method.timestampToTime(item.studyStartTime)}} - {{$method.timestampToTime(item.studyEndTime)}} </text>
+					学习有效期:<text class="content"> {{$method.timestampToTime(item.studyStartTime)}}-{{$method.timestampToTime(item.studyEndTime)}} </text>
 				</view>
 				
 			</view>

+ 1 - 1
pages2/bank/question_detail.vue

@@ -553,7 +553,7 @@ page {
 				display: flex;
 				align-items: center;
 
-				font-size: 26rpx;
+				font-size: 28rpx;
 				color: #666666;
 				border-bottom: 1rpx solid #eeeeee;
 				display: flex;

+ 25 - 13
pages2/bank/question_record.vue

@@ -2,11 +2,11 @@
 	<view>
 		<nav-bar title="做题记录" class="nav"></nav-bar>
 		<view class="tabs">
-			<view class="tab" :class="{ active: index == 1 }" data-index="1" @click="tab">
+			<view class="tab" :class="{ active: index == 1 }" data-index="1" @click="tab(1)">
 				全部题库记录
 				<u-icon class="icon" :class="index ==1? 'animals':''" name="arrow-down"></u-icon>
 			</view>
-			<view class="tab" :class="{ active: index == 2 }" data-index="2" @click="tab">
+			<view class="tab" :class="{ active: index == 2 }" data-index="2" @click="tab(2)">
 				全部试卷类型
 				<u-icon class="icon" :class="index ==2? 'animals':''" name="arrow-down"></u-icon>
 			</view>
@@ -39,22 +39,27 @@
 
 		<view class="modal" :style="{top:modalTop+'px'}" v-if="index == 1">
 			<view class="content">
-				<view class="top" :class="activeIndex === 0 ? 'activesty' : ''" @click="testClick(3)">全部题库记录</view>
-				<view class="list">
-					<view class="item" :class="activeIndex == listItem.goodsId ? 'activesty' : ''" v-for="(listItem,listIndex) in list" :key="listIndex" @click="testClick(listItem)">
-						{{ listItem.goodsName }}
+				<scroll-view scroll-y="true" style="height:100%">
+					<view class="top" :class="activeIndex === 0 ? 'activesty' : ''" @click="testClick(3)">全部题库记录</view>
+					<view class="list">
+						<view class="item" :class="activeIndex == listItem.goodsId ? 'activesty' : ''" v-for="(listItem,listIndex) in list" :key="listIndex" @click="testClick(listItem)">
+							{{ listItem.goodsName }}
+						</view>
 					</view>
-				</view>
+				</scroll-view>
+				
 			</view>
 			<view class="modal_wrap" @click="index = 0"></view>
 		</view>
 		
 		<view class="modal" :style="{top:modalTop+'px'}" v-if="index == 2">
 			<view class="content">
-				<view class="top" :class="typeIndex === 0 ? 'activesty' : ''" @click="paperClick(3)">全部试卷类型</view>
-				<view class="list">
-					<view class="item" :class="typeIndex == listItem.paperId ? 'activesty' : ''" v-for="(listItem,listIndex) in list1" :key="listIndex" @click="paperClick(listItem)">{{ listItem.paperName }}</view>
-				</view>
+				<scroll-view scroll-y="true" style="height:100%">
+					<view class="top" :class="typeIndex === 0 ? 'activesty' : ''" @click="paperClick(3)">全部试卷类型</view>
+					<view class="list">
+						<view class="item" :class="typeIndex == listItem.paperId ? 'activesty' : ''" v-for="(listItem,listIndex) in list1" :key="listIndex" @click="paperClick(listItem)">{{ listItem.paperName }}</view>
+					</view>
+				</scroll-view>
 			</view>
 			<view class="modal_wrap" @click="index = 0"></view>
 		</view>
@@ -279,8 +284,13 @@ export default {
 				this.getExamRecordList();
 			}
 		},
-		tab(e) {
-			this.index = e.currentTarget.dataset.index;
+		tab(index) {
+			console.log(index,this.index)
+			if(this.index == index) {
+				this.index = 0;
+				return;
+			}
+			this.index = index;
 			console.log(this.index);
 		},
 
@@ -419,6 +429,8 @@ page {
 	width: 100%;
 
 	.content {
+		height:80%;
+		overflow: hidden;
 		position: relative;
 		z-index: 10;
 		background: #fff;

+ 3 - 3
pages2/bank/question_statistics.vue

@@ -55,7 +55,7 @@
 											<view class="desc">
 												<view class="flex-auto">
 													正确率
-													<text class="green">{{(article.rightQuestionNum / article.totalQuestionNum * 100).toFixed(0) +'%'}}</text>
+													<text class="green">{{article.totalQuestionNum != 0 ?((article.rightQuestionNum / article.totalQuestionNum * 100).toFixed(0)) : 0 +'%'}}</text>
 												</view>
 												<view class="flex-auto">
 													已完成
@@ -88,7 +88,7 @@
 									<view class="desc">
 										<view class="flex-auto">
 											正确率
-											<text class="green">{{(article.rightQuestionNum / article.totalQuestionNum * 100).toFixed(0) +'%'}}</text>
+											<text class="green">{{article.totalQuestionNum != 0 ?((article.rightQuestionNum / article.totalQuestionNum * 100).toFixed(0)) : 0 +'%'}}</text>
 										</view>
 										<view class="flex-auto">
 											已完成
@@ -110,7 +110,7 @@
 								<view class="desc">
 									<view class="flex-auto">
 										正确率
-										<text class="green">{{(item1.rightQuestionNum / item1.totalQuestionNum * 100).toFixed(0) +'%'}}</text>
+										<text class="green">{{item1.totalQuestionNum != 0 ?((item1.rightQuestionNum / item1.totalQuestionNum * 100).toFixed(0)) : 0+'%'}}</text>
 									</view>
 									<view class="flex-auto">
 										已完成

+ 1 - 58
pages2/class/questionBank.vue

@@ -754,7 +754,7 @@ export default {
 						success: result => {
 							if (result.statusCode === 200) {
 								self.ossAvatarUrl = ossToken.dir;
-								resolve();
+								resolve(ossToken.dir);
 							} else {
 								uni.showToast({
 									title: '上传失败',
@@ -1870,63 +1870,6 @@ export default {
 				}
 			});
 		},
-
-		uploadFile(options, int) {
-			var self = this;
-			return new Promise((resolve, reject) => {
-				var data = {
-					imageStatus: int
-				};
-				self.$api.aliyunpolicy(data).then(res => {
-					console.log(res.data, 6);
-					if (res.data.code != 200) {
-						self.$method.showToast('签名错误' + JSON.stringify(res.data));
-						return;
-					}
-					var ossToken = res.data.data.resultContent;
-					if (ossToken.host == null || ossToken.host == undefined) {
-						self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
-						return;
-					}
-					uni.uploadFile({
-						url: ossToken.host,
-						name: 'file',
-						filePath: options,
-						fileType: 'image',
-						header: {
-							AuthorizationToken: 'WX ' + uni.getStorageSync('token')
-						},
-						formData: {
-							key: ossToken.dir,
-							OSSAccessKeyId: ossToken.accessid,
-							policy: ossToken.policy,
-							Signature: ossToken.signature,
-							callback: ossToken.callback,
-							success_action_status: 200
-						},
-						success: result => {
-							if (result.statusCode === 200) {
-								self.ossAvatarUrl = ossToken.dir;
-								resolve(ossToken.dir);
-							} else {
-								uni.showToast({
-									title: '上传失败',
-									icon: 'none'
-								});
-								return;
-							}
-						},
-						fail: error => {
-							uni.showToast({
-								title: '上传接口报错' + error,
-								icon: 'none'
-							});
-							return;
-						}
-					});
-				});
-			});
-		},
 		/**
 		 * @param {Object} type
 		 * @param {Object} bankindex

+ 2 - 2
pages2/invoice/index.vue

@@ -383,7 +383,7 @@ export default {
 				}
 			],
 			form:{
-				type:'',
+				type:'1',
 				main:'',
 				header:'',
 				orderIds:'',
@@ -501,7 +501,7 @@ export default {
 			selectOrderModal:false,
 			orderDetailModal:false,
 			orderCancelModal:false,
-			current: 1,
+			current: 0,
 			order: [],
 			typeList:[{
 				name:'普通发票',

+ 101 - 3
pages2/learn/my_learn.vue

@@ -13,7 +13,7 @@
 						<view class="label">审核状态:</view>
 						<view
 							class="val"
-							:class="item.periodStatus === -1 || item.periodStatus === 3 ? 'red' : item.periodStatus === 1 ? 'green' : item.periodStatus === 2 ? 'blue' : ''"
+							:class="item.periodStatus === -1? 'red' : item.periodStatus === 1 ? 'green' : item.periodStatus === 2  || item.periodStatus === 3 ? 'blue' : ''"
 						>
 							<text>
 								{{
@@ -23,6 +23,8 @@
 										? '机构审核通过'
 										: item.periodStatus === 2
 										? '等待审核'
+										: item.periodStatus === 3
+										? '审核中'
 										: item.periodStatus === 0
 										? '机构审核不通过'
 										: ''
@@ -48,6 +50,7 @@
 						<view class="val color666" v-if="item.periodStatus === -1">您的学时还未修完,请尽快完成课程学习</view>
 						<view class="val color666" v-if="item.periodStatus === 2">学习完成后7-15个工作日完成学时审核。</view>
 						<view class="val color666" v-if="item.periodStatus === 0">请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。</view>
+						<view class="val color666" v-if="item.periodStatus === 3">会在7-15个工作日左右完成学时审核</view>
 					</view>
 					<view v-if="item.periodStatus !== 2">
 						<u-line color="#EEEEEE" />
@@ -57,11 +60,27 @@
 						<view>
 							<view v-if="item.periodStatus === 1 && item.applyStatus === 1">
 								<view class="subTitle">{{ item.applyName }}</view>
+								<view class="status">
+									<view class="label">审核状态:</view>
+									<view class="val green">
+										<text>
+											机构审核通过
+										</text>
+									</view>
+								</view>
 								<view class="btnBox"><view class="btn" @click="jumpPage(item, 2,index)">预约考试</view></view>
 							</view>
 							<u-line color="#EEEEEE" v-if="item.periodStatus === 1 && item.applyStatus === 1" />
 							<view v-if="item.periodStatus === 1 && item.beforeStatus === 1">
 								<view class="subTitle">{{ item.beforeName }}</view>
+								<view class="status">
+									<view class="label">审核状态:</view>
+									<view class="val green">
+										<text>
+											机构审核通过
+										</text>
+									</view>
+								</view>
 								<view class="btnBox"><view class="btn" @click="jumpPage(item, 3,index)">进入刷题</view></view>
 							</view>
 						</view>
@@ -85,7 +104,7 @@
 					</view>
 					<view class="btnBox">
 						<view class="btn" @click="showPhoto(item)">电子照片</view>
-						<!-- <view class="btn" @click="downloadCard(item)">下载凭证</view> -->
+						<view class="btn" @click="saveEwm(item)">下载凭证</view>
 					</view>
 				</view>
 			</template>
@@ -169,7 +188,25 @@ export default {
 				this.$navTo.togo(`/pages2/wd/course?id=${v.goodsId}&gid=${v.gradeId}`);
 			}
 			if (int === 2) {
-				this.$navTo.togo(`/pages2/appointment/index?goodsId=${v.goodsId}&gradeId=${v.gradeId}`);
+				var data = {
+					goodsId: v.goodsId,
+					gradeId: v.gradeId
+				};
+				this.$api.getApplysubscribe(data).then(res => {
+					if (res.data.code === 500) {
+						uni.showModal({
+							showCancel: false,
+							content: res.data.msg
+						});
+					}
+					if (res.data.code === 200) {
+						this.$navTo.togo('/pages2/appointment/index', {
+							goodsId: v.goodsId,
+							gradeId: v.gradeId,
+							orderGoodsId:v.orderGoodsId
+						});
+					}
+				});
 			}
 			if (int === 3) {
 				this.appBeforeAddress(v.goodsId)
@@ -257,6 +294,67 @@ export default {
 				}
 			});
 		},
+		saveEwm(item){
+			//获取相册授权
+			   uni.getSetting({
+				 success:(res) => {
+				   if (!res.authSetting['scope.writePhotosAlbum']) {
+					 uni.authorize({
+					   scope: 'scope.writePhotosAlbum',
+					   success() {
+						 //这里是用户同意授权后的回调
+						 this.saveImgToLocal(item);
+					   },
+					   fail() {//这里是用户拒绝授权后的回调
+					   
+					   }
+					 })
+				   } else {//用户已经授权过了
+					 this.saveImgToLocal(item);
+				   }
+				 }
+			   })
+		},
+		saveImgToLocal(item){
+			
+			uni.showModal({
+				title: '提示',
+				content: '确定保存到相册吗',
+				success: (res) => {
+					if (res.confirm) {
+						
+						uni.downloadFile({
+								url: this.$method.splitImgHost(item.certificatePath,true,1000),//图片地址
+								success: (res) =>{
+									if (res.statusCode === 200){
+										uni.saveImageToPhotosAlbum({
+											filePath: res.tempFilePath,
+											success: function() {
+												uni.showToast({
+													title: "保存成功",
+													icon: "none"
+												});
+											},
+											fail: function() {
+												uni.showToast({
+													title: "保存失败",
+													icon: "none"
+												});
+											}
+										});
+									} 
+								}
+							})
+						
+						
+					} else if (res.cancel) {
+						
+					}
+				}
+			});
+			
+		},
+
 		downloadCard(item) {
 			console.log(this.$method.splitImgHost(item.certificatePath,true))
 			uni.downloadFile({

+ 1 - 1
pages2/order/confirm_pay.vue

@@ -192,7 +192,7 @@ export default {
 		modalConfirm() {
 			if(this.hasPaying) {
 				uni.navigateTo({
-					url:'/pages2/order/index?current=1'
+					url:'/pages2/order/index?current=0'
 				})
 			} else {
 				if(this.fromCart) {

+ 77 - 16
pages2/order/index.vue

@@ -16,23 +16,44 @@
 							<view>{{ $method.timestampToTime(item.createTime) }}</view>
 						</view>
 						<u-line color="#D6D6DB" />
-						<view class="body"
-							v-for="(items, indexs) in item.orderGoodsList"
-							:key="indexs" @click="goCourse(items,item.orderStatus)"
-						>
-							<view class="body__content">
-								<image class="goods-img" :src="$method.splitImgHost(items.coverUrl)"></image>
-								<view class="goods-text">
-									<view class="goods-name">{{ items.goodsName }}</view>
-									<view class="goods-price">¥ {{ items.goodsRealPrice }}</view>
+						<view v-if="current == 3">
+							<view class="body"
+							>
+								<view class="body__content">
+									<image class="goods-img" :src="$method.splitImgHost(item.coverUrl)"></image>
+									<view class="goods-text">
+										<view class="goods-name">{{ item.goodsName }}</view>
+										<!-- <view class="goods-price">¥ {{ items.goodsRealPrice }}</view> -->
+									</view>
 								</view>
 							</view>
-							<view style="display: flex;flex-direction: row-reverse;padding: 10rpx 0;">
-								<view class="btn2" v-if="items.refundStatus === 0&&item.orderFrom === 2&&(item.orderStatus === 1 || item.orderStatus === 2 || item.orderStatus === 3)&&(items.goodsType == '1' || items.goodsType == '2')" @click.stop="refund(item.orderSn,items.goodsId)">退款</view>
+						</view>
+						<view v-else >
+							<view class="body"
+								v-for="(items, indexs) in item.orderGoodsList"
+								:key="indexs" @click="goCourse(items,item.orderStatus)"
+							>
+								<view class="body__content">
+									<image class="goods-img" :src="$method.splitImgHost(items.coverUrl)"></image>
+									<view class="goods-text">
+										<view class="goods-name">{{ items.goodsName }}</view>
+										<view class="goods-price">¥ {{ items.goodsRealPrice }}</view>
+									</view>
+								</view>
+								<view style="display: flex;flex-direction: row-reverse;padding: 10rpx 0;">
+									<view class="btn2" v-if="items.refundStatus === 0&&item.orderFrom === 2&&(item.orderStatus === 1 || item.orderStatus === 2 || item.orderStatus === 3)&&(items.goodsType == '1' || items.goodsType == '2')" @click.stop="refund(item.orderSn,items.goodsId)">退款</view>
+								</view>
 							</view>
 						</view>
+						
 						<u-line color="#D6D6DB" />
-						<view class="footer">
+						<view class="footer" v-if="current == 3">
+							<view>
+								<text style="color:#999;font-size: 24rpx;margin-right: 8rpx;">退款金额</text>
+								<text style="color:#ff2d55;font-size: 30rpx;font-weight: bold;">¥{{ item.refundFee }}</text>
+							</view>
+						</view>
+						<view class="footer" v-else>
 							<view>
 								<text style="color:#999;font-size: 24rpx;margin-right: 8rpx;">共{{ item.orderGoodsList.length }}项</text>
 								<text style="color: #333;font-size: 30rpx;font-weight: bold;">合计</text>
@@ -50,9 +71,9 @@
 			</template>
 			
 
-			<!-- <template v-if="current == 1 && order.length">
+			<template v-if="current == 1 && order.length">
 				<view class="apply-invoice" @click="goInvoice">发票申请</view>
-			</template> -->
+			</template>
 			
 		</view>
 	</view>
@@ -76,6 +97,10 @@ export default {
 				{
 					name: '已取消',
 					count: 0
+				},
+				{
+					name: '已退款',
+					count: 0
 				}
 			],
 			current: 0,
@@ -87,7 +112,8 @@ export default {
 			},
 			pageNum1: 0,
 			pageNum2: 0,
-			pageNum3: 0
+			pageNum3: 0,
+			pageNum4: 0
 		};
 	},
 	// onPullDownRefresh() {},
@@ -318,6 +344,21 @@ export default {
 					return;
 				}
 			}
+			
+			if(this.current == 3) {
+				if(this.order.length >= this.pageNum4) {
+					return;
+				}
+				
+				
+				this.formData.orderStatus = '';
+				this.$api.orderRefundList(this.formData).then(res => {
+					if(res.data.code == 200) {
+						this.order = this.order.concat(res.data.rows);
+					}
+				})
+				return;
+			}
 			this.$api.getorderlists(this.formData).then(res => {
 				if (res.data.code === 200) {
 					if (res.data.rows.length) {
@@ -338,6 +379,8 @@ export default {
 			if (this.current === 2) {
 				this.formData.orderStatus = '-1,-2,4';
 			}
+			
+			this.order = [];
 			this.$api.getorderlists(this.formData).then(res => {
 				if (res.data.code === 200) {
 					if (this.current === 0) {
@@ -356,12 +399,30 @@ export default {
 				}
 			});
 		},
+		orderRefundList() {
+			this.order = [];
+			this.formData.pageNum = 1;
+			this.formData.orderStatus = ''
+			this.$api.orderRefundList(this.formData).then(res => {
+				if(res.data.code == 200) {
+					this.order = res.data.rows;
+				}
+			})
+		},
 		change(index) {
 			if (this.current === index) {
 				return;
 			}
 			this.current = index;
-			this.getOrderList();
+			if(this.current == 3) { //退款订单
+			this.formData.status = '';
+				this.orderRefundList()
+			} else { //其他订单
+			
+				this.formData.status = '0,1';
+				this.getOrderList();
+			}
+			
 			uni.pageScrollTo({
 				scrollTop: 0
 			});

+ 64 - 32
pages2/subject/collect.vue

@@ -1,19 +1,25 @@
 <template>
 	<view class="safeArea">
-		<nav-bar title="收藏集"></nav-bar>
+		<nav-bar title="收藏集" class="nav"></nav-bar>
 		<view class="sceenBox">
 			<view :class="['item', {'active':sceenType===1} ]" @click="showSceen(1)">全部题库记录<u-icon class="icon" :class="sceenType ===1 ? 'animals':''"  name="arrow-down"></u-icon></view>
 			<view :class="['item', {'active':sceenType===2} ]" @click="showSceen(2)">全部试卷类型<u-icon class="icon" :class="sceenType ===2 ? 'animals':''"  name="arrow-down"></u-icon></view>
 		</view>
-		<view class="sceenModel" v-if="sceenType">
+		<view class="sceenModel" v-if="sceenType"  :style="{top:modalTop+'px'}" >
 			<view class="sceenModelBg" @click="hideSceen"></view>
-			<view class="sceenMain">
-				<template v-if="sceenType===1">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
-				</template>
-				<template v-if="sceenType===2">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
-				</template>
+			<view class="sceenMain" >
+				<scroll-view scroll-y="true" style="height:100%">
+					<div class="sceenMainContent">
+						<template v-if="sceenType===1">
+							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
+						</template>
+						<template v-if="sceenType===2">
+							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
+						</template>
+					</div>
+					
+				</scroll-view>
+				
 			</view>
 		</view>
 		<view class="wrap">
@@ -86,6 +92,7 @@ export default {
 			],
 			type:1,
 			total:0,
+			modalTop:0,
 			testList:[],
 			typeList:[],
 			goodsid:'',
@@ -98,6 +105,21 @@ export default {
 		this.listGoodsUserQuestion();
 		this.examaperList();
 		this.getData();
+		
+		uni.getSystemInfo({
+			success:(e) => {
+				let info = uni.createSelectorQuery().select(".nav");
+				info.boundingClientRect((navData) => { //data - 各种参数
+				
+					let info = uni.createSelectorQuery().select(".sceenBox");
+					info.boundingClientRect((tabData) => { //data - 各种参数
+						this.modalTop = navData.height + tabData.height
+						console.log(navData) // 获取元素宽度
+						console.log(tabData) // 获取元素宽度
+					}).exec()
+				}).exec()
+			}
+		})
 	},
 	methods: {
 		getData() {
@@ -151,6 +173,10 @@ export default {
 			})
 		},
 		showSceen(type){
+			if(this.sceenType == type) {
+				this.sceenType = null
+				return;
+			}
 			this.sceenType = type
 		},
 		/**
@@ -227,8 +253,9 @@ page {
 	}
 }
 .sceenModel{
+	left:0;
+	bottom:0;
 	width:100%;
-	height:100%;
 	position: fixed;
 	z-index: 998;
 	.sceenModelBg{
@@ -242,30 +269,35 @@ page {
 		position: relative;
 		z-index: 999;
 		background: #fff;
-		margin-top: 80rpx;
-		display: flex;
-		flex-wrap: wrap;
-		padding: 8rpx;
-		justify-content: space-between;
-		.item{
-			width: 350rpx;
-			background: #F5F5F5;
-			border-radius: 16rpx;
-			padding: 25rpx 19rpx;
-			margin: 8rpx;
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #666666;
-			&.active{
-				background: #007AFF;
-				color:#fff;
-			}
-			&:first-child{
-				width:100%;
-				text-align: center;
+		height:80%;
+		.sceenMainContent {
+			
+			display: flex;
+			flex-wrap: wrap;
+			padding: 8rpx;
+			justify-content: space-between;
+			
+			.item{
+				width: 350rpx;
+				background: #F5F5F5;
+				border-radius: 16rpx;
+				padding: 25rpx 19rpx;
+				margin: 8rpx;
+				font-size: 32rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #666666;
+				&.active{
+					background: #007AFF;
+					color:#fff;
+				}
+				&:first-child{
+					width:100%;
+					text-align: center;
+				}
 			}
 		}
+		
 	}
 }
 .wrap{

+ 62 - 33
pages2/subject/wrong.vue

@@ -1,19 +1,24 @@
 <template>
 	<view class="safeArea">
-		<nav-bar title="错题集"></nav-bar>
+		<nav-bar title="错题集"  class="nav"></nav-bar>
 		<view class="sceenBox">
 			<view :class="['item', {'active':sceenType===1} ]" @click="showSceen(1)">全部题库记录<u-icon class="icon" :class="sceenType ===1 ? 'animals':''"  name="arrow-down"></u-icon></view>
 			<view :class="['item', {'active':sceenType===2} ]" @click="showSceen(2)">全部试卷类型<u-icon class="icon" :class="sceenType ===2? 'animals':''"  name="arrow-down"></u-icon></view>
 		</view>
-		<view class="sceenModel" v-if="sceenType">
+		<view class="sceenModel" v-if="sceenType" :style="{top:modalTop+'px'}" >
 			<view class="sceenModelBg" @click="hideSceen"></view>
 			<view class="sceenMain">
-				<template v-if="sceenType===1">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
-				</template>
-				<template v-if="sceenType===2">
-					<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
-				</template>
+				<scroll-view scroll-y="true" style="height:100%">
+					<view class="sceenMainContent">
+						<template v-if="sceenType===1">
+							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList1" :key="index" @click="choseRecord(index)">{{item.goodsName}}</view>
+						</template>
+						<template v-if="sceenType===2">
+							<view :class="['item',{'active':item.checked}]" v-for="(item, index) in scennList2" :key="index" @click="choseType(index)">{{item.paperName}}</view>
+						</template>
+					</view>
+				</scroll-view>
+				
 			</view>
 		</view>
 		<view class="wrap">
@@ -90,6 +95,7 @@ export default {
 			goodsid:'',
 			paperid:'',
 			total:0,
+			modalTop:0,
 		};
 	},
 	onPullDownRefresh() {},
@@ -99,6 +105,21 @@ export default {
 	onLoad(option) {
 		this.listGoodsUserQuestion();
 		this.examaperList();
+		
+		uni.getSystemInfo({
+			success:(e) => {
+				let info = uni.createSelectorQuery().select(".nav");
+				info.boundingClientRect((navData) => { //data - 各种参数
+				
+					let info = uni.createSelectorQuery().select(".sceenBox");
+					info.boundingClientRect((tabData) => { //data - 各种参数
+						this.modalTop = navData.height + tabData.height
+						console.log(navData) // 获取元素宽度
+						console.log(tabData) // 获取元素宽度
+					}).exec()
+				}).exec()
+			}
+		})
 	},
 	methods: {
 		getData() {
@@ -157,6 +178,10 @@ export default {
 			this.getData();
 		},
 		showSceen(type){
+			if(this.sceenType == type) {
+				this.sceenType = null
+				return;
+			}
 			this.sceenType = type
 		},
 		hideSceen(){
@@ -226,8 +251,9 @@ page {
 	}
 }
 .sceenModel{
+	left:0;
+	bottom:0;
 	width:100%;
-	height:100%;
 	position: fixed;
 	z-index: 998;
 	.sceenModelBg{
@@ -241,30 +267,33 @@ page {
 		position: relative;
 		z-index: 999;
 		background: #fff;
-		margin-top: 80rpx;
-		display: flex;
-		flex-wrap: wrap;
-		padding: 8rpx;
-		justify-content: space-between;
-		.item{
-			width: 350rpx;
-			background: #F5F5F5;
-			border-radius: 16rpx;
-			padding: 25rpx 19rpx;
-			margin: 8rpx;
-			font-size: 32rpx;
-			font-family: PingFang SC;
-			font-weight: bold;
-			color: #666666;
-			&.active{
-				background: #007AFF;
-				color:#fff;
-			}
-			&:first-child{
-				width:100%;
-				text-align: center;
-			}
-		}
+		height:80%;
+		.sceenMainContent {
+			
+			display: flex;
+			flex-wrap: wrap;
+			padding: 8rpx;
+			justify-content: space-between;
+				.item{
+					width: 350rpx;
+					background: #F5F5F5;
+					border-radius: 16rpx;
+					padding: 25rpx 19rpx;
+					margin: 8rpx;
+					font-size: 32rpx;
+					font-family: PingFang SC;
+					font-weight: bold;
+					color: #666666;
+					&.active{
+						background: #007AFF;
+						color:#fff;
+					}
+					&:first-child{
+						width:100%;
+						text-align: center;
+					}
+				}
+		}		
 	}
 }
 .wrap{

+ 7 - 8
pages2/wd/class.vue

@@ -17,19 +17,19 @@
 								<text class="content">{{ item.classHours }}</text>
 								学时
 							</view>
-							<view class="content_box">
+							<view class="content_box" v-if="item.studyStartTime && item.studyEndTime">
 								<image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
-								学习有效期:
+								学习服务期:
 								<text class="content">{{ $method.timestampToTime(item.studyStartTime) }} - {{ $method.timestampToTime(item.studyEndTime) }}</text>
 							</view>
 						</view>
 						
-						<!-- 不在学习有效期 -->
+						<!-- 不在学习服务期 -->
 						<template v-if="sysTime < item.studyStartTime || sysTime > item.studyEndTime">
 							<view class="class-warm" v-if="item.gradeId != 0 && item.gradeStatus == 1">
 								<view class="class-warm__text">
 									<view class="date">
-										不在学习有效期,不可以学习了哦
+										不在学习服务期,不可以学习了哦
 									</view>
 								</view>
 							</view>
@@ -87,7 +87,7 @@
 													<text v-else-if="item.stuAllNum >= item.secAllNum">已学完</text>
 												</template>
 												<template v-else>
-													已过学习有效期,不可以学习了哦!
+													已过学习服务期,不可以学习了哦!
 												</template>
 											</view>
 										</view>
@@ -250,7 +250,7 @@
 export default {
 	data() {
 		return {
-			markContent:'',
+			markContent:'http://admin.zhujianpeixun.com/',
 			showMark:false,
 			list: [1, 2, 3],
 			goodsList: [],
@@ -384,7 +384,6 @@ export default {
 				
 				if(item.learnStatus == 1) { //跳转第三方h5
 					this.showMark = true;
-					this.markContent = item.officialLearningUrl
 					
 					return;
 					// uni.navigateTo({
@@ -414,7 +413,7 @@ export default {
 			if(this.sysTime <= item.studyStartTime || this.sysTime >= item.studyEndTime ) {
 				uni.showToast({
 					icon:'none',
-					title:'不在学习有效期,不能进入学习'
+					title:'不在学习服务期,不能进入学习'
 				})
 				return;
 			}

+ 67 - 29
pages2/wd/course.vue

@@ -16,7 +16,7 @@
 				</view>
 				<view class="box_progress">
 					<view style="width: 60%;"><u-line-progress height="22" :show-percent="false" active-color="#ff9900" :percent="(item.stuAllNum / item.secAllNum) * 100"></u-line-progress></view>
-					<view><u-button type="warning" size="mini" @click.stop="studyIn(item,index)">进入学习</u-button></view>
+					<view><u-button type="warning" size="mini">进入学习</u-button></view>
 				</view>
 			</view>
 		</view>
@@ -36,6 +36,7 @@ export default {
 				pageSize: 10,
 				total: 0
 			},
+			businessData:{},
 			itemIndex:''
 		};
 	},
@@ -74,38 +75,71 @@ export default {
 				}
 			});
 		},
-		jump(item,index) {
-			this.itemIndex = index;
-			if(item.rebuild === 0) {  //未重修
-				this.$navTo.togo('/pages2/learn/details', {
-					id: item.courseId,
-					gradeId:item.gradeId,
-					goodsId: this.goodsId
-				});
-				return;
-			}
-			 this.$navTo.togo('/pages3/polyv/detail', {
-				id: item.courseId,
-				goodsId: this.goodsId,
-				orderGoodsId:this.orderGoodsId
-			}); 
+		/**
+		 * 获取业务层次详情
+		 */
+		courseBusiness(businessId){
+			this.$api.courseBusiness(businessId).then(res => {
+				this.businessData = res.data.data;
+			})
 		},
-		studyIn(item,index) {
+		jump(item,index) {
 			this.itemIndex = index;
-			if(item.rebuild === 0) {  //未重修
-				this.$navTo.togo('/pages2/learn/details', {
+			
+			if(index == 0) {
+				if(item.rebuild === 0) {  //未重修
+					this.$navTo.togo('/pages2/learn/details', {
+						id: item.courseId,
+						gradeId:item.gradeId,
+						goodsId: this.goodsId
+					});
+					return;
+				}
+				 this.$navTo.togo('/pages3/polyv/detail', {
 					id: item.courseId,
-					gradeId:item.gradeId,
-					goodsId: this.goodsId
-				});
-				return;
+					goodsId: this.goodsId,
+					orderGoodsId:this.orderGoodsId
+				}); 
+			} else {
+				if(this.businessData.goodsLearningOrder == 2) { //学习顺序是从头到尾学习,没学完上一课不能学习下一课
+					let prevItem = this.courseList[index-1];  //上一课
+					if( (prevItem.stuAllNum+prevItem.recordNum) == (prevItem.secAllNum+prevItem.examNum) ) {
+						if(item.rebuild === 0) {  //未重修
+							this.$navTo.togo('/pages2/learn/details', {
+								id: item.courseId,
+								gradeId:item.gradeId,
+								goodsId: this.goodsId
+							});
+							return;
+						}
+						 this.$navTo.togo('/pages3/polyv/detail', {
+							id: item.courseId,
+							goodsId: this.goodsId,
+							orderGoodsId:this.orderGoodsId
+						}); 
+					} else {
+						uni.showToast({
+							icon:'none',
+							title:'请按顺序学完上一课再学习这一课'
+						})
+					}
+				} else {
+					if(item.rebuild === 0) {  //未重修
+						this.$navTo.togo('/pages2/learn/details', {
+							id: item.courseId,
+							gradeId:item.gradeId,
+							goodsId: this.goodsId
+						});
+						return;
+					}
+					 this.$navTo.togo('/pages3/polyv/detail', {
+						id: item.courseId,
+						goodsId: this.goodsId,
+						orderGoodsId:this.orderGoodsId
+					}); 
+				}
 			}
-			this.$navTo.togo('/pages3/polyv/detail', {
-				id: item.courseId,
-				goodsId: this.goodsId,
-				orderGoodsId:this.orderGoodsId
-			});
-			// this.$navTo.togo('/pages2/verify/input');
+			
 		},
 		courseCourseList() {
 			let self = this;
@@ -115,6 +149,10 @@ export default {
 				if (res.data.code == 200) {
 					self.courseList.push.apply(self.courseList, res.data.rows);
 					self.param.total = res.data.total;
+					
+					if(res.data.rows.length) {
+						this.courseBusiness(res.data.rows[0].businessId)
+					}
 				}
 			});
 		},

+ 45 - 10
pages3/polyv/detail.vue

@@ -67,11 +67,11 @@
 				<view v-show="current == 0">
 					<view class="menuBox" v-for="(item, index) in menuList" :key="index">
 						<!--模块 -->
-						<view v-if="item.type == 1"><courseModule :needOpen="menuIndex[0] === index ? true : false" :courseId="courseId" :preItem="menuList[index-1]"  :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
+						<view v-if="item.type == 1"><courseModule :sectionMaxNum="goodsData.sectionMaxNum" :needOpen="menuIndex[0] === index ? true : false" :courseId="courseId" :preItem="menuList[index-1]"  :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
 						<!--章 -->
-						<view v-if="item.type == 2"><courseChapter :needOpen="menuIndex[0] === index ? true : false" :courseId="courseId" :preItem="menuList[index-1]"  @playEnd="sectionPlayEnd($event,index)" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter></view>
+						<view v-if="item.type == 2"><courseChapter :sectionMaxNum="goodsData.sectionMaxNum" :needOpen="menuIndex[0] === index ? true : false" :courseId="courseId" :preItem="menuList[index-1]"  @playEnd="sectionPlayEnd($event,index)" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter></view>
 						<!--节 -->
-						<view v-if="item.type == 3"><courseSection @playEnd="sectionPlayEnd($event,index)" :courseId="courseId" :preItem="menuList[index-1]" :learningOrder="businessData.goodsLearningOrder"  :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection></view>
+						<view v-if="item.type == 3"><courseSection :sectionMaxNum="goodsData.sectionMaxNum" @playEnd="sectionPlayEnd($event,index)" :courseId="courseId" :preItem="menuList[index-1]" :learningOrder="businessData.goodsLearningOrder"  :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection></view>
 					</view>
 				</view>
 				<!--讲义 -->
@@ -164,14 +164,14 @@
 				<view v-show="current == 4" >
 					<view class="menuBox" v-for="(item, index) in reMenuList" :key="index">
 						<!--模块 -->
-						<view v-if="item.type == 1"><courseModule :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
+						<view v-if="item.type == 1"><courseModule :sectionMaxNum="goodsData.sectionMaxNum" :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
 						<!--章 -->
 						<view v-if="item.type == 2">
-							<courseChapter :courseId="courseId" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter>			
+							<courseChapter :courseId="courseId" :sectionMaxNum="goodsData.sectionMaxNum" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter>			
 						</view>
 						<!--节 -->
 						<view v-if="item.type == 3">
-							<courseSection :courseId="courseId" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :nextMenuItem="findMenuNextSection(index)"  :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection>
+							<courseSection :courseId="courseId" :sectionMaxNum="goodsData.sectionMaxNum" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :nextMenuItem="findMenuNextSection(index)"  :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection>
 						</view>
 					</view>
 				</view>
@@ -217,12 +217,14 @@
 
 		</u-mask>
 		
-		<u-popup v-model="noticeShow" class="notice_modal"  mode="center"  border-radius="14"  width="500rpx" height="600rpx">
+		<u-popup v-model="noticeShow" class="notice_modal"  mode="center"  border-radius="14"  width="700rpx" height="900rpx">
 			<div class="content">
 				
 				<scroll-view scroll-y="true" style="height: 100%;">
-					<text>
-						{{goodsData.buyNote}}</text>
+					<view class="title">学员须知</view>
+					<text class="text">
+						{{goodsData.buyNote}}
+					</text>
 				</scroll-view>
 			</div>
 			
@@ -836,7 +838,7 @@ export default {
 				// let initSpace = 0
 				//没有历史拍照间隔数据
 				if(this.photoList.length==0){
-					if(totalVideoTime >= 1500) { //大于15分钟
+					if(totalVideoTime >= 900) { //大于15分钟
 						if(photoNum == 1) { //开头拍1张
 							this.photoList.push(1)
 						} else if(photoNum == 3){ //拍3张
@@ -1511,11 +1513,33 @@ export default {
 			     }
 			 })
 		},
+		/**
+		 * 人脸匹配
+		 */
+		faceRecognition() {
+			return new Promise(resolve => {
+				let fileSystem = uni.getFileSystemManager();
+				fileSystem.readFile({
+				  filePath: `${this.avatarUrl}`,
+				  encoding: 'base64',
+				  position: 0,
+				  success:(res) => {
+					  console.log(res)
+					  let base64 = 'data:image/jpg;base64,' + res.data;
+				  },
+				  fail(err) {
+					console.error(err,'err')
+				  }
+				})
+			})
+		},
+		
 		async submit() {
 			if(this.uploadLock) {
 				return;
 			}
 			this.uploadLock = true;
+			
 			const waitYS = await this.imageInfos();
 			this.postCoursePhotoRecord().then(res => {
 				this.photoHistoryList.push(this.photoIndex)
@@ -2403,6 +2427,17 @@ page {
 		width:100%;
 		height:100%;
 		padding:20rpx;
+		
+		.title {
+			color:#333;
+			line-height: 40rpx;
+			font-size: 30rpx;
+			text-align: center;
+			font-weight: bold;
+		}
+		.text {
+			line-height: 40rpx;
+		}
 	}
 }
 </style>