瀏覽代碼

修复测试bug

chenxiong 3 年之前
父節點
當前提交
0a846ddc25
共有 4 個文件被更改,包括 45 次插入8 次删除
  1. 9 0
      common/httpList/goods.js
  2. 3 3
      pages2/bank/questionBank.vue
  3. 1 1
      pages2/bank/question_record.vue
  4. 32 4
      pages2/bank/question_report.vue

+ 9 - 0
common/httpList/goods.js

@@ -136,6 +136,15 @@ export default {
 		})
 	},
 	
+	bankExamNextExam(data) {
+		return myRequest({
+			url: '/bank/exam/nextExam',
+			data:data,
+			method: 'get',
+		})
+	},
+	
+	
 	
 	examReport(data) {
 		return myRequest({

+ 3 - 3
pages2/bank/questionBank.vue

@@ -490,8 +490,8 @@ export default {
 		this.current = +option.current || 0
 		this.id = option.id;
 		this.goodsId = option.goodsid;
-		this.chapterId = option.chapterId;
-		this.moduleId = option.moduleId;
+		this.chapterId = option.chapterId || 0;
+		this.moduleId = option.moduleId || 0;
 		this.isFromVideo = option.isFromVideo||'';
 		this.gradeId = option.gradeId || '';
 		let isBack = option.isback;
@@ -1533,7 +1533,7 @@ export default {
 
 						setTimeout(() => {
 							uni.redirectTo({
-								url: '/pages2/bank/question_report?examId='+this.id+'&id=' + this.recordId
+								url: '/pages2/bank/question_report?goodsId='+this.goodsId+'&chapterId='+this.chapterId+'&moduleId='+this.moduleId+'&examId='+this.id+'&id=' + this.recordId
 							});
 						}, 1000);
 					}

+ 1 - 1
pages2/bank/question_record.vue

@@ -42,7 +42,7 @@
 					>
 						<view class="btn" v-if="record.status == 1">解析</view>
 					</navigator>
-					<navigator  hover-class="none" :url="'/pages2/bank/question_report?examId='+record.examId+'&id=' + record.recordId"><view class="btn" v-if="record.status == 1">报告</view></navigator>
+					<navigator  hover-class="none" :url="'/pages2/bank/question_report?goodsId='+record.goodsId+'&chapterId='+record.chapterExamId+'&moduleId='+record.moduleExamId+'&examId='+record.examId+'&id=' + record.recordId"><view class="btn" v-if="record.status == 1">报告</view></navigator>
 					<navigator
 						:url="
 							'/pages2/bank/questionBankContinue?recordId=' +

+ 32 - 4
pages2/bank/question_report.vue

@@ -52,7 +52,7 @@
 					<view class="btnACs">全部解析</view>
 				</navigator>
 				<view class="btnACs" @click="doRepeat(reportdata.examId, reportdata.goodsId, reportdata.moduleExamId, reportdata.chapterExamId)">重新做题</view>
-				<view class="btnACs" @click="backBank">继续做题</view>
+				<view class="btnACs" v-if="nextExamId" @click="backBank">继续做题</view>
 			</view>
 		</view>
 		<view class="bottom">
@@ -93,8 +93,12 @@ export default {
 			reportdata: {},
 			examData:{},
 			examId:'',
+			moduleId:'',
+			goodsId:'',
+			chapterId:'',
 			context1: null,
 			context2: null,
+			nextExamId:'',
 			wrongRecordWrongNum:'',
 		};
 	},
@@ -103,11 +107,17 @@ export default {
 	async onShow() {
 		
 	},
+		
+		
 	async onLoad(option) {
 		this.recordId = option.id;
 		this.examId = option.examId;
+		this.moduleId = option.moduleId || 0;
+		this.chapterId = option.chapterId || 0;
+		this.goodsId = option.goodsId || '';
 		
 		this.examWrongRecordWrongNum();
+		this.bankExamNextExam()
 		await this.bankExam();
 		await this.examReport();
 		
@@ -202,10 +212,28 @@ export default {
 		
 	},
 	methods: {
-		backBank() {
-			uni.navigateBack({
-				delta:1
+		bankExamNextExam() {
+			this.$api.bankExamNextExam({
+				chapterExamId:this.chapterId,
+				examId:this.examId,
+				goodsId:this.goodsId,
+				moduleExamId:this.moduleId
+			}).then(res => {
+				if(res.data.code == 500) {
+					this.nextExamId = '';
+				} else if(res.data.code == 200) {
+					this.nextExamId = res.data.data.examId;
+				}
 			})
+		},
+		backBank() {
+			uni.navigateTo({
+				url: '/pages2/bank/questionBank?id=' +this.nextExamId + '&goodsid=' + this.goodsId + '&moduleId=' + this.moduleId + '&chapterId=' + this.chapterId + ''
+			});
+			
+			// uni.navigateBack({
+			// 	delta:1
+			// })
 			// uni.redirectTo({
 			// 	url: '/pages2/bank/my_question'
 			// });