Browse Source

错题记录

xuqiaoying 3 năm trước cách đây
mục cha
commit
4d3521b2cf

+ 11 - 1
pages2/bank/question_record.vue

@@ -150,9 +150,19 @@ export default {
 		 * 更多记录
 		 */
 		moreRecord(record) {
+		if (record.courseType == 2) {
 			uni.navigateTo({
-				url:'/pages2/bank/question_record_list?goodsId='+record.goodsId+'&chapterId='+record.chapterExamId+'&moduleId='+record.moduleExamId+'&examId='+record.examId+'&id=' + record.recordId
+				url:'/pages2/bank/question_record_list?goodsId='+record.goodsId+'&chapterId='+record.chapterId+'&moduleId='+record.moduleId
+				+'&examId='+record.examId+'&recordId=' + record.recordId + '&courseType=' + record.courseType + '&gradeId=' +record.gradeId
+				+ '&courseId=' + record.courseId + '&sectionId=' + record.sectionId
 			})
+		} else {
+			uni.navigateTo({
+				url:'/pages2/bank/question_record_list?goodsId='+record.goodsId+'&chapterId='+record.chapterExamId+'&moduleId='+record.moduleExamId
+				+'&examId='+record.examId+'&recordId=' + record.recordId + '&courseType=' + record.courseType
+			})
+		}
+			
 		},
 		addRecord() {
 			this.$api.examRecordList({

+ 71 - 9
pages2/bank/question_record_list.vue

@@ -20,7 +20,7 @@
 					<view class="btn" v-if="record.status == 1" @click="doRepeat(record.examId, record.goodsId, record.moduleExamId, record.chapterExamId,index,record)">重做</view>
 					<view class="btn" @click="questionBankExplain(record)" v-if="record.status == 1">解析</view>
 					<view class="btn" @click="questionReport(record)" v-if="record.status == 1">报告</view>
-					<view class="btn continue" @click="doContinue(record,index)" v-if="record.status == 0 && record.historyExamJson">继续答题</view>
+					<view class="btn continue" @click="doContinue(record,index)" v-if="courseType != 2 && record.status == 0 && record.historyExamJson">继续答题</view>
 				</view>
 			</view>
 		</view>
@@ -49,15 +49,38 @@ export default {
 			activeIndex: 0,
 			typeIndex:0,
 			itemIndex:'',
+			courseType: 1, // 2视频试卷
+			record: {
+				examId: '',
+				gradeId: '',
+				chapterId: '',
+				moduleId: '',
+				courseId: '',
+				sectionId: '',
+			},
 		};
 	},
 	onLoad(option) {
-		
+		this.courseType = option.courseType
 		this.param.moduleExamId = option.moduleId,
 		this.param.chapterExamId = option.chapterId,
 		this.param.examId = option.examId,
-		this.param.goodsId = option.goodsId,
-		this.getExamRecordList();
+		this.param.goodsId = option.goodsId
+		if (this.courseType == 2) {
+			const { examId, gradeId, chapterId, moduleId, courseId, sectionId} = option
+			this.record = {
+				examId: +examId,
+				gradeId: +gradeId,
+				chapterId: +chapterId,
+				moduleId: +moduleId,
+				courseId: +courseId,
+				sectionId: +sectionId,
+			}
+			this.recordBankList()
+		} else {
+			this.getExamRecordList();
+		}
+		
 	},
 	onPullDownRefresh() {
 		let that = this;
@@ -69,7 +92,12 @@ export default {
 			pageNum: 1,
 			pageSize: 10
 		};
-		this.getExamRecordList();
+		if (this.courseType == 2) {
+			this.recordBankList()
+		} else {
+			this.getExamRecordList();
+		}
+
 		setTimeout(function() {
 			uni.stopPullDownRefresh();
 		}, 500);
@@ -77,7 +105,11 @@ export default {
 	onReachBottom() {
 		if (this.recordList.length < this.total) {
 			this.param.pageNum++;
-			this.getExamRecordList();
+			if (this.courseType == 2) {
+				this.recordBankList()
+			} else {
+				this.getExamRecordList();
+			}
 		}
 	},
 	onShow() {
@@ -98,9 +130,14 @@ export default {
 			})
 		},
 		questionReport(record) {
-			uni.navigateTo({
-				url:'/pages2/bank/question_report?goodsId='+record.goodsId+'&chapterId='+record.chapterExamId+'&moduleId='+record.moduleExamId+'&examId='+record.examId+'&id=' + record.recordId+'&orderGoodsId='+record.orderGoodsId
-			})
+			if (this.courseType == 2) {
+				
+			} else {
+				uni.navigateTo({
+					url:'/pages2/bank/question_report?goodsId='+record.goodsId+'&chapterId='+record.chapterExamId+'&moduleId='+record.moduleExamId+'&examId='+record.examId+'&id=' + record.recordId+'&orderGoodsId='+record.orderGoodsId
+				})
+			}
+			
 		},
 		addRecord() {
 			this.$api.examRecordList({
@@ -137,6 +174,31 @@ export default {
 				this.total = res.data.total;
 			});
 		},
+		recordBankList() {
+			let params = {
+				examId: this.record.examId,
+				goodsId: this.param.goodsId,
+				pageNum: this.param.pageNum,
+				pageSize: this.param.pageSize
+			}
+			this.record.gradeId && (params['gradeId'] = this.record.gradeId)
+			this.record.chapterId && (params['chapterId'] = this.record.chapterId)
+			this.record.courseId && (params['courseId'] = this.record.courseId)
+			this.record.moduleId && (params['moduleId'] = this.record.moduleId)
+			this.record.sectionId && (params['sectionId'] = this.record.sectionId)
+			console.log('参数params', params)
+			if (this.param.pageNum == 1) {
+				this.recordList = []
+			}
+			this.$http({
+				url: '/bank/record/bankList',
+				method: 'get',
+				data: params
+			}).then((res) => {
+				this.recordList.push.apply(this.recordList, res.data.rows)
+				this.total = res.data.total
+			})
+		},
 		/**
 		 * 继续做题
 		 */

+ 2 - 2
pages2/subject/wrongBank.vue

@@ -656,12 +656,12 @@
               </view>
               答题卡
             </view>
-            <view class="collect" :class="{ show: !explain }" @click="pdsubmit">
+            <!-- <view class="collect" :class="{ show: !explain }" @click="pdsubmit">
               <view>
                 <image src="/static/jj.png" mode=""></image>
                 <view>交卷</view>
               </view>
-            </view>
+            </view> -->
           </view>
         </view>
       </swiper-item>