Selaa lähdekoodia

页面样式大小更改

lvmax 2 kuukautta sitten
vanhempi
commit
98dcd4cb2c
1 muutettua tiedostoa jossa 35 lisäystä ja 33 poistoa
  1. 35 33
      pages/examPage/examStart.vue

+ 35 - 33
pages/examPage/examStart.vue

@@ -12,7 +12,9 @@
 		color: #7f7f44;height: 30px;text-align: center;padding:20px;padding-bottom: 0;">
 		{{examObject.examTitle}}
 	</view>
-	<button type="primary" style="background-color: #f0eff0; position: fixed;top: 20px;right: 20px;width: 20px;height: 20px;line-height:1;color: #000000;" @click="reload">҉</button>
+	<button type="primary"
+		style="background-color: #f0eff0; position: fixed;top: 20px;right: 20px;width: 20px;height: 20px;line-height:1;color: #000000;"
+		@click="reload">҉</button>
 	<uni-row>
 		<uni-col :span="4" style="margin-top: 30px">
 			<uni-card style="height: 85vh;">
@@ -35,7 +37,8 @@
 						<view>
 							<view class="paperCss"
 								:style="'background-color: '+(item.state === 0?'#b5aa09;':(item.state === 9?'#ececec':'#00f545'))">
-								<view style="color: #000000;"> <strong style="font-size: 2vmin;">{{item.title}}</strong></view>
+								<view style="color: #000000;"> <strong style="font-size: 2vmin;">{{item.title}}</strong>
+								</view>
 							</view>
 						</view>
 					</label>
@@ -43,7 +46,7 @@
 				<l-divider color="#b3b3b3">
 				</l-divider>
 				<button type="primary" style="margin-top: 10px;font-size: 2vmin;" @click="subExam">交卷</button>
-				
+
 			</uni-card>
 
 		</uni-col>
@@ -309,8 +312,7 @@
 				<l-divider color="#8f960c" style="margin-top: 2%;">
 					<view style="font-size: 1vw;">当前试卷时间</view>
 				</l-divider>
-				<view
-					style="font-family: '微软雅黑', serif;color: #f90005;height: 4vh;text-align: center;padding:2%;">
+				<view style="font-family: '微软雅黑', serif;color: #f90005;height: 4vh;text-align: center;padding:2%;">
 					<strong style="font-size: 3vmin;">{{paperTime}}</strong>
 				</view>
 				<!-- 	<l-divider color="#8f960c">
@@ -348,7 +350,8 @@
 				</view>
 				<l-divider color="#251e75" />
 				<view>
-					<button type="primary" style="margin-top: 10px;font-size: 2vmin;" @click="previousQuestion">上一题</button>
+					<button type="primary" style="margin-top: 10px;font-size: 2vmin;"
+						@click="previousQuestion">上一题</button>
 					<button type="primary" style="margin-top: 10px;font-size: 2vmin;" @click="nextQuestion">下一题</button>
 
 				</view>
@@ -481,10 +484,10 @@
 					'limitTime': this.userExamPaper.limitTime
 				}).then(data => {
 					console.log(data);
-			
+
 					window.location.reload()
-					
-					
+
+
 				})
 			},
 			// 消息提示
@@ -608,7 +611,7 @@
 				if (this.scantron.sort < this.examObject.userExamQuestionList.length) {
 					// this.scantron = this.examObject.userExamQuestionList[this.scantron.sort]
 					this.radioScantron(this.scantron.sort + 1)
-				}else{
+				} else {
 					this.$refs.answerFinal.open()
 				}
 			},
@@ -618,9 +621,10 @@
 				this.scantron = this.examObject.userExamQuestionList[value - 1]
 				if (this.scantron.questionType !== 7 && this.scantron.questionType !== 8) {
 					document.getElementById('scantronNodes').innerHTML = this.scantron.question.content
-				}else{
+				} else {
 					console.log(this.scantron.question.content.split('%||||||||%')[0]);
-					document.getElementById('scantronNodes').innerHTML = this.scantron.question.content.split('%||||||||%')[0]
+					document.getElementById('scantronNodes').innerHTML = this.scantron.question.content.split(
+						'%||||||||%')[0]
 				}
 
 				let combination = setInterval(() => {
@@ -1584,24 +1588,18 @@
 					}
 					let leaveCount = this.examObject.totalLeaveTimes
 					let leaveTime = this.examObject.leaveTime
-					if (this.windowCheat < leaveCount) {
-						this.cheat = setInterval(() => {
-							console.log("切屏加一");
-							this.windowCheat++
-							cacheExamAnswer({
-								'examAnswers': this.userExamAnswers,
-								'userExamId': sessionStorage.getItem('examId'),
-								'leaveTime': this.windowCheat,
-								'paperId': this.userExamPaper.paperId,
-								'limitTime': this.userExamPaper.limitTime
-							})
-							clearInterval(this.cheat)
-						}, leaveTime * 1000)
-					} else {
-						this.submitExam('cheat')
-					}
 
-					console.log(this.windowCheat);
+					this.cheat = setInterval(() => {
+						this.windowCheat++
+						cacheExamAnswer({
+							'examAnswers': this.userExamAnswers,
+							'userExamId': sessionStorage.getItem('examId'),
+							'leaveTime': this.windowCheat,
+							'paperId': this.userExamPaper.paperId,
+							'limitTime': this.userExamPaper.limitTime
+						})
+						clearInterval(this.cheat)
+					}, leaveTime * 1000)
 				}
 			},
 
@@ -1609,6 +1607,10 @@
 			handleFocus() {
 				if (this.examObject.leaveOn) {
 					clearInterval(this.cheat)
+					if (this.windowCheat >= leaveCount) {
+						this.submitExam('cheat')
+					}
+
 				}
 			},
 			// 时间
@@ -1671,9 +1673,9 @@
 		},
 		mounted() {
 
-				
-			
-			
+
+
+
 			window.addEventListener("unload", (e) => {
 				e.preventDefault();
 				setTimeout(() => {
@@ -1721,7 +1723,7 @@
 						this.answerDisplay(answerData.data.result)
 					}
 				})
-				
+
 			})
 		}
 	}