chenxiong %!s(int64=3) %!d(string=hai) anos
pai
achega
0e918f57ab

+ 8 - 0
common/httpList/goods.js

@@ -358,6 +358,14 @@ export default {
 		})
 	},
 	
+	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;
 	},

+ 24 - 1
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
@@ -137,6 +149,17 @@ export default {
 		 */
 		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) {

+ 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: {

+ 30 - 6
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,13 +170,33 @@ export default {
 		});
 	},
 	methods: {
-		getVideo(){
+		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')
+			// 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.isRebuild) { //要按从头到尾顺序学习, 且不是重修课程
 				if(this.preItem) {
 					if(this.preItem.menuType == 3) { //上一个是节

+ 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>

+ 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">
 										已完成

+ 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:'普通发票',

+ 39 - 3
pages2/learn/my_learn.vue

@@ -9,12 +9,11 @@
 				<view class="noData" v-if="listData.length == 0">您暂无相关学时审核记录哦~</view>
 				<view class="learnItem" v-for="(item, index) in listData" :key="index">
 					<view class="title">{{ item.goodsName }}</view>
-					{{item.periodStatus}}
 					<view class="status">
 						<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>
 								{{
@@ -24,6 +23,8 @@
 										? '机构审核通过'
 										: item.periodStatus === 2
 										? '等待审核'
+										: item.periodStatus === 3
+										? '审核中'
 										: item.periodStatus === 0
 										? '机构审核不通过'
 										: ''
@@ -49,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" />
@@ -58,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>
@@ -170,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)

+ 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
 			});

+ 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)
+					}
 				}
 			});
 		},

+ 6 - 6
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>