瀏覽代碼

答题记录

chenxiong 3 年之前
父節點
當前提交
eef4089c67
共有 1 個文件被更改,包括 22 次插入6 次删除
  1. 22 6
      pages2/class/questionBank.vue

+ 22 - 6
pages2/class/questionBank.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="questionBank">
-		<uni-nav-bar @clickLeft="clickLeft" left-icon="back" :statusBar="true" title="试卷"></uni-nav-bar>
+		<uni-nav-bar class="navbar" @clickLeft="clickLeft" left-icon="back" :statusBar="true" title="试卷"></uni-nav-bar>
 		<swiper class="swiper" :current="current" @change="swiperChange" :interval="interval">
 			<swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
 				<view class="pageContent">
@@ -665,6 +665,7 @@ export default {
 				self.ossAvatarUrl = ''
 				self.isTakePhoto = true;
 				//拍照
+				this.examRecord();
 				if(this.lastTime) {
 					this.timer = setInterval(() => {
 						if (this.lastTime <= 0) {
@@ -931,6 +932,11 @@ export default {
 			uni.navigateBack({
 				delta: 1
 			});
+			
+			//需要拍照没有拍,返回不扣次数
+			if(this.needPhoto && !this.isTakePhoto) {
+				return;
+			}
 			let score = 0; //计算总分
 			let reportStatus = 0;
 			let number = 0;
@@ -1268,7 +1274,13 @@ export default {
 
 					this.questionList = res.data.data;
 					this.lastCount = this.questionList.length;
-					this.examRecord();
+					
+					if(this.needPhoto) {
+						this.photoPopup = true; //拍照
+					} else {
+						this.examRecord();
+					}
+					
 				});
 		},
 		/**
@@ -1299,9 +1311,9 @@ export default {
 				})
 				.then(res => {
 					this.recordId = res.data.data;
-					if(self.needPhoto){
-						self.photoPopup = true; //拍照
-					} else {
+					// if(self.needPhoto){
+					// 	self.photoPopup = true; //拍照
+					// } else {
 						if(this.lastTime) {
 							this.timer = setInterval(() => {
 								if (this.lastTime <= 0) {
@@ -1319,7 +1331,7 @@ export default {
 								this.lastTime--;
 							}, 1000);
 						}
-					}
+					// }
 					
 				});
 			
@@ -1976,6 +1988,10 @@ export default {
 		}
 	}
 	
+.navbar {
+	position: relative;
+	z-index: 20000;
+}
 .questionBank {
 	width:100%;
 	height:100vh;