chenxiong 3 жил өмнө
parent
commit
43d2da7989

+ 3 - 3
components/course/courseSection.vue

@@ -24,7 +24,7 @@
 				</view>
 				<view v-if="menuItem.sectionType==null">{{menuItem.name}}</view>
 			</view>
-			<view style="font-size: 20rpx;color: #FF3B30;"  v-if="menuItem.liveStartTime">
+			<view style="font-size: 20rpx;color: #FF3B30;"  v-if="menuItem.liveStartTime && menuItem.sectionType != 3">
 				<view class="tagWillPlay" v-if="menuItem.liveStartTime>nowTime">
 					<text>待开播</text>
 				</view>
@@ -35,9 +35,9 @@
 					<text>已结束</text>
 				</view>
 			</view>
-			<view v-if="isRebuild||menuItem.rebuild>0" class="tagRe">待重修</view>
+			<view v-if="(isRebuild||menuItem.rebuild>0) && menuItem.sectionType != 3" class="tagRe">待重修</view>
 			<view v-else>
-				<view v-if="menuItem.learning==1" class="tagGreen">已看完</view>
+				<view v-if="menuItem.learning==1 && menuItem.sectionType != 3" class="tagGreen">已看完</view>
 			</view>
 			
 		</view>

+ 56 - 37
pages2/bank/my_question.vue

@@ -1,34 +1,30 @@
 <template>
 	<view style="padding: 30rpx;">
-		<view v-for="(item, index) in list" :key="index"  style="margin-bottom: 30rpx;">
-			<navigator  hover-class="none" :url="'/pages2/bank/question_detail?id='+item.goodsId">
-			<!-- <navigator  hover-class="none" url="/pages2/bank/detail"> -->
-				<view class="class_item">
-					<image class="img" :src="$method.splitImgHost(item.coverUrl, true)"></image>
-					<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
-						{{item.goodsName}}
-					</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>
-					</view>
-					
+		<view v-for="(item, index) in list" :key="index"  style="margin-bottom: 30rpx;" @click="studyIn(item,index)">
+			<view class="class_item">
+				<image class="img" :src="$method.splitImgHost(item.coverUrl, true)"></image>
+				<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
+					{{item.goodsName}}
+				</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>
 				</view>
-			<!-- </navigator> -->
-				<view class="bottomBox">
-					<view style="color: #999999;font-size: 24rpx;">刷题进度:{{item.doNum}}/{{item.totalNum}}</view>
-					<view class="box_progress">
-						<view style="width: 60%;">
-							<u-line-progress :show-percent="false" height="22" active-color="#007AFF" :percent="(item.doNum/item.totalNum)*100"></u-line-progress>
-						</view>
-						<view>
-							<!-- <navigator  hover-class="none" :url="'/pages2/bank/question_detail?id='+item.goodsId"> -->
-								<view class="btn">进入刷题</view>
-							<!-- </navigator> -->
-						</view>
+				
+			</view>
+			<view class="bottomBox">
+				<view style="color: #999999;font-size: 24rpx;">刷题进度:{{item.doNum}}/{{item.totalNum}}</view>
+				<view class="box_progress">
+					<view style="width: 60%;">
+						<u-line-progress :show-percent="false" height="22" active-color="#007AFF" :percent="(item.doNum/item.totalNum)*100"></u-line-progress>
+					</view>
+					<view>
+						<!-- <navigator  hover-class="none" :url="'/pages2/bank/question_detail?id='+item.goodsId"> -->
+							<view class="btn">进入刷题</view>
+						<!-- </navigator> -->
 					</view>
 				</view>
-			</navigator>
+			</view>
 			
 		</view>
 		<view v-if="list.length==0">
@@ -42,29 +38,52 @@
 	export default {
 		data() {
 			return {
-				list:[]
-				
+				list:[],
+				param:{
+					pageNum: 1,
+					pageSize: 10
+				},
+				total:0,
+				itemIndex:'',
 			}
 		},
 		onLoad(option) {
 			this.listGoodsUserQuestion();
 		},
 		onShow(){
-			
+			if(this.itemIndex !== '') {
+				this.refreshByIndex();
+			}
+		},
+		
+		onReachBottom() {
+			if (this.list.length < this.total) {
+				this.param.pageNum++;
+				this.listGoodsUserQuestion();
+			}
 		},
 		methods: {
 			listGoodsUserQuestion() {
-				this.$api.listGoodsUserQuestion({
-					
-				}).then(res => {
-					this.list = res.data.rows;
+				this.$api.listGoodsUserQuestion(this.param).then(res => {
+					this.list = [...this.list,...res.data.rows];
+					this.total = res.data.total;
 				})
 			},
-			studyIn(){
-				this.$navTo.togo('/pages2/verify/input');
+			studyIn(item,index){
+				this.itemIndex = index;
+				uni.navigateTo({
+					url:'/pages2/bank/question_detail?id='+item.goodsId
+				})
 			},
-			appointment(){
-				this.$navTo.togo('/pages2/appointment/index');
+			
+			refreshByIndex() {
+				console.log('refreshByIndex')
+				this.$api.listGoodsUserQuestion({
+					pageNum:this.itemIndex+1,
+					pageSize:1,
+				}).then(res => {
+					this.$set(this.list,this.itemIndex,res.data.rows[0])
+				})
 			}
 		},
 		

+ 3 - 1
pages2/bank/question_detail.vue

@@ -129,7 +129,9 @@ export default {
 			}
 		};
 	},
-	onUnload() {},
+	onUnload() {
+		
+	},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
 		this.id = option.id;

+ 15 - 3
pages2/bank/question_record.vue

@@ -26,7 +26,7 @@
 					</view>
 				</view>
 				<view class="btns">
-					<view class="btn" v-if="record.status == 1" @click="doRepeat(record.examId, record.goodsId, record.moduleExamId, record.chapterExamId)">重做</view>
+					<view class="btn" v-if="record.status == 1" @click="doRepeat(record.examId, record.goodsId, record.moduleExamId, record.chapterExamId,index)">重做</view>
 					<navigator
 						:url="
 							'/pages2/bank/questionBankExplain?id=' +
@@ -104,6 +104,7 @@ export default {
 			total: 0,
 			activeIndex: 0,
 			typeIndex:0,
+			itemIndex:''
 		};
 	},
 	onLoad(option) {
@@ -129,9 +130,19 @@ export default {
 		}
 	},
 	onShow() {
-		
+		if(this.itemIndex !== '') {
+			this.refreshByIndex();
+		}
 	},
 	methods: {
+		refreshByIndex() {
+			this.$api.examRecordList({
+				pageNum: this.itemIndex+1,
+				pageSize: 1
+			}).then(res => {
+				this.$set(this.recordList,this.itemIndex,res.data.rows[0])
+			});
+		},
 		getExamRecordList() {
 			if (this.param.pageNum == 1) {
 				this.recordList = [];
@@ -144,8 +155,9 @@ export default {
 		/**
 		 * 去做题
 		 */
-		async doRepeat(id, goodsId, moduleId = 0, chapterId = 0) {
+		async doRepeat(id, goodsId, moduleId = 0, chapterId = 0,index) {
 			// await this.getDetail(goodsId);
+			this.itemIndex = index;
 			let count = await this.examRecordCount(id,goodsId);
 			let answerNum = await this.getExamDetail(id);
 			//超过答题次数

+ 62 - 7
pages2/class/questionBank.vue

@@ -1488,16 +1488,35 @@ export default {
 
 		
 		pdsubmit() {
-			if (this.bankType == 1) {
-				let ansCount = this.questionOverNum(); //已答题数
-				this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
-				//没有答完
-				if (this.lastCount !== 0) {
-					this.cgType = 6;
-					this.showpopups = true;
+			let ansCount = this.questionOverNum(true); //已答题数
+			this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
+			//没有答完
+			if (this.lastCount !== 0) {
+				this.cgType = 6;
+				this.showpopups = true;
+				return;
+			}
+			
+			if(this.bankType == 2) {
+				if(this.lastTime > 0) {
+					let lastTime = this.countdown(this.lastTime)
+					uni.showModal({
+						title:'提示',
+						content:`时间还剩余${lastTime},确定交卷吗?`,
+						confirmText:'交卷',
+						cancelText:'继续答题',
+						success:(res) => {
+							if(res.confirm) { //确定
+								this.submit();
+							} else {  //取消
+								
+							}
+						}
+					})
 					return;
 				}
 			}
+			
 			this.submit();
 		},
 		/**
@@ -2424,6 +2443,42 @@ export default {
 	}
 }
 
+.dialog-arrow {
+	padding-top:124rpx;
+	position: fixed;
+	left: 0;
+	top: 0;
+	width: 100%;
+	height: 100%;
+	background-color: rgba(0, 0, 0, 0.8);
+	z-index: 20000;
+	
+	.pointer {
+		margin-left:87rpx;
+		display: block;
+		width:95rpx;
+		height:98rpx;
+	}
+
+	.text {
+		padding-left:177rpx;
+		font-size: 32rpx;
+		color: #ffffff;
+	}
+
+	.btn {
+		width: 242rpx;
+		height: 82rpx;
+		border: 2rpx solid #ffffff;
+		border-radius: 16rpx;
+		text-align: center;
+		line-height: 82rpx;
+		margin: 500rpx auto 0;
+		color: #fff;
+		font-size: 32rpx;
+	}
+}
+
 .dialog_wrap {
 	position: fixed;
 	left: 0;

+ 1 - 1
pages2/verify/input.vue

@@ -16,7 +16,7 @@
 		</u-collapse>
 		<view class="bodyBox" style="margin-top: 30rpx;padding:0 20rpx;">
 			<u-form :model="form" ref="uForm">
-				<template v-for="(item) in listData" >
+				<template v-for="(item,index) in listData" >
 					<u-form-item
 						:key="index"
 						v-if="item.fieldKey == 'name'"