Browse Source

Merge branch 'main' of https://gogs.mtavip.com/wangguoyu/uniProject

tanxue 3 weeks ago
parent
commit
ccb9f4f96a
3 changed files with 59 additions and 46 deletions
  1. 1 1
      config.js
  2. 57 44
      pages/exam/exam.vue
  3. 1 1
      utils/request.js

+ 1 - 1
config.js

@@ -1,6 +1,6 @@
 // 应用全局配置
 export default   {
-  baseUrl: 'https://kf3.mtavip.com/api',
+  baseUrl: 'https://kf1.mtavip.com/api',
   // baseUrl: 'http://localhost:8080',
   // 应用信息
   appInfo: {

+ 57 - 44
pages/exam/exam.vue

@@ -6,8 +6,8 @@
 			<view v-if="activeSt" class="title-types">{{dlName}}</view>
 			<!--  倒计时 -->
 			<view v-if="!!data.endSecond">
-				<uni-countdown class="exam-countdown" :show-day="false" :showHour="true" :showMinute="true" :second="data.endSecond"
-					@timeup="onTimeUp" :start="startCountDown"></uni-countdown>
+				<uni-countdown class="exam-countdown" :show-day="false" :showHour="true" :showMinute="true"
+					:second="data.endSecond" @timeup="onTimeUp" :start="startCountDown"></uni-countdown>
 			</view>
 		</view>
 		<view class="kaoshi-shiti-content">
@@ -43,8 +43,8 @@
 		</view>
 
 		<view class="kaoshi-bottom-box" v-if="activeSt">
-			<button class="phone-green-btn" :class="[activeSt.marked ? 'qb-btn' : 'bj-btn']" hover-class="none" type="default" size="mini"
-				@click="handleBiaoji">{{activeSt && activeSt.marked ? '取标':'标记'}}</button>
+			<button class="phone-green-btn" :class="[activeSt.marked ? 'qb-btn' : 'bj-btn']" hover-class="none"
+				type="default" size="mini" @click="handleBiaoji">{{activeSt && activeSt.marked ? '取标':'标记'}}</button>
 			<view @click="showAnswerCard" class="shiti-num-box">
 				<icon class="shiti-num-icon"></icon>
 				<text class="active-num">{{answercartsCount}}</text>/<text>{{data.StListForSearch.length}}</text>
@@ -52,7 +52,8 @@
 			<view class="save-btn-box">
 				<button class="phone-green-btn save-btn" hover-class="none" type="default" size="mini"
 					@click="handleSave(true)">保存</button>
-				<button @click="handleJiaojuan" class="phone-green-btn save-btn" hover-class="none" type="default" size="mini">
+				<button @click="handleJiaojuan" class="phone-green-btn save-btn" hover-class="none" type="default"
+					size="mini">
 					交卷并查看成绩</button>
 			</view>
 		</view>
@@ -67,7 +68,8 @@
 		<!-- 答题卡 -->
 		<uni-popup ref="popupRef" background-color="#fff" :animation="false" :is-mask-click="false" :mask-click="false">
 			<view class="answer-card-popup">
-				<customNavbarVue class="card-navBar-box" title="答题卡" :show-back-btn="true" @back="handlePopupBack"></customNavbarVue>
+				<customNavbarVue class="card-navBar-box" title="答题卡" :show-back-btn="true" @back="handlePopupBack">
+				</customNavbarVue>
 				<view class="card-content-box">
 					<view class="answer-card-content" v-for="(paragraph,paragraphIndex) in questionData"
 						:key="paragraphIndex">
@@ -85,24 +87,20 @@
 				</view>
 			</view>
 		</uni-popup>
-		<!-- 摄像头确认 -->
-		<!-- 	<zhuapaiConfirm ref="zhuapaiConfirmRef" @success="zpConfirmSuccess" @error="zpConfirmError" 
-			@cancel="zpConfirmCancel" key="1"></zhuapaiConfirm> -->
-		<!-- <template v-if="data.zhuapai && data.zhuapai > 0"> -->
-			<!-- 抓拍 -->
-			<!-- <zhuapaiVue ref="zhuapaiRef" @error="zpError" @success="zpSuccess" key="2" @progress="onProgress"></zhuapaiVue> -->
-		<!-- </template> -->
-
-		<!-- 切屏 -->
-		<!-- <qiepingVue ref="qiepingRef" @zhuapai="qpZhuapai" @forceSubmit="forceSubmit" @qiepingToast="qiepingToast"
-			key="3"></qiepingVue> -->
+
 		<!-- 交卷确认 -->
 		<answerQueren ref="answerQrRef" @confirm="handleQuerenConfirm"></answerQueren>
 		<!-- 考试得分 -->
 		<submitScoreVue ref="subScoreRef" @confirm="handleScoreConfirm" @close="handleScoreClose"></submitScoreVue>
-
-		<!-- 切屏确认弹窗 -->
-		<!-- <qiepingDlVue ref="qiepingDlRef" :content="messageContent" title="注意" okBtn="知道了"></qiepingDlVue> -->
+		<!-- 人工 -->
+		<common-dialog ref="dl3ref" title="考试得分" :notBtn="false" content="等待人工评分结束后,可登录 “个人成绩” 模块,查看本次考试的成绩!"
+			@confirm-btn="handleBack"></common-dialog>
+		<!-- 直接出成绩 -->
+		<common-dialog ref="dl4ref" title="考试得分" :notBtn="false"
+			:content="`您的成绩,将在${seeResultTime}公布。您可以登录“个人成绩”模块,查看本次考试的成绩!`" @confirm-btn="handleBack"></common-dialog>
+		<!-- 不发布成绩 -->
+		<common-dialog ref="dl5ref" :notBtn="false" title="提示" content="交卷成功!"
+			@confirm-btn="handleBack"></common-dialog>
 	</view>
 </template>
 
@@ -137,6 +135,7 @@
 	} from "./examTools"
 	import qiepingDlVue from "@/components/dialog/qiepingDl.vue";
 	import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
+	import commonDialog from "@/components/dialog/commonDialog.vue"
 
 	const {
 		checkDanxuanReply,
@@ -179,6 +178,12 @@
 	const qiepingDlRef = ref(null);
 	const timer1 = ref(null);
 	const answercartsCount = ref(0); // 已答题数
+	const dl3ref = ref(null)
+	const dl4ref = ref(null)
+	const dl5ref = ref(null)
+	const seeResultTime = ref(null)
+	const autoSaveInterval = ref(null)
+	const autoSaveInterval2 = ref(null)
 
 	const data = reactive({
 		ksId: null,
@@ -306,7 +311,6 @@
 		timer1.value = setTimeout(() => {
 			clearTimeout(timer1.value);
 		}, 10 * 1000);
-		console.log(questionData.value)
 
 		const result = []
 		const option = {
@@ -524,10 +528,27 @@
 
 		ksApi.getClientKsSubmit(result).then(res => {
 			if (res.code == 0) {
-				subScoreRef.value.showDialog(res.data);
-				data.hisId = res.data.hisId;
+				let data1 = res.data;
 				// 清空缓存
-				removeCacheKs(data.operId);
+				removeCacheKs(data1.operId);
+				if (data1.waitGrade === false) {
+					//  describe:修改bug seeResultFlag  发布成绩标记(0不发布、1立即发布、2定时发布)
+					if (data1.seeResultFlag === 1) {
+						subScoreRef.value.showDialog(data1);
+						data.hisId = data1.hisId;
+					} else if (data1.seeResultFlag === 0) {
+						dl5ref.value.handleShow();
+					} else {
+						// dialog3
+						seeResultTime.value = data1.seeResultTime;
+						dl3ref.value.handleShow()
+					}
+				} else {
+					// dialog4
+					dl4ref.value.handleShow()
+				}
+				clearInterval(autoSaveInterval.value)
+				clearInterval(autoSaveInterval2.value)
 			}
 		})
 	}
@@ -660,6 +681,8 @@
 		// }
 
 		uni.navigateBack()
+		clearInterval(autoSaveInterval.value)
+		clearInterval(autoSaveInterval2.value)
 	}
 
 	function showAnswerCard() {
@@ -860,7 +883,7 @@
 			}) */
 			setTimeout(() => {
 				handleBack()
-			},1000)
+			}, 1000)
 		})
 	}
 
@@ -954,22 +977,12 @@
 			formatDuanluoList(data.duanluo);
 			// 设置缓存
 			formatKaoshiData();
-			// 设置抓拍监听
-
-			// if (data.zhuapai && data.zhuapai > 0) {
-			// 	zhuapaiRef.value.init({
-			// 		zhuapai: zhuapai,
-			// 		operId: operId
-			// 	});
-			// }
-
-			// 设置切屏监听
-			// qiepingRef.value.init({
-			// 	zhuapaiFlag: !!zhuapai,
-			// 	toggleScreenFlag: toggleScreenFlag,
-			// 	toggleScreenSecond: toggleScreenSecond,
-			// 	ksId: data.ksId
-			// })
+			autoSaveInterval.value = setInterval(() => {
+				handleSave()
+			}, 1000 * 60 * 1)
+			autoSaveInterval2.value = setInterval(() => {
+				handleSave()
+			}, 1000 * 60 * 5)
 
 			startCountDown.value = true;
 
@@ -980,8 +993,8 @@
 			console.log('asdasd', err)
 			setTimeout(() => {
 				handleBack()
-			},1000)
-			
+			}, 1000)
+
 		})
 	}
-</script>
+</script>

+ 1 - 1
utils/request.js

@@ -69,7 +69,7 @@ const request = config => {
 				} else if (code === 500) {
 					reject('500')
 				} else if (code !== 0) {
-					//   toast(msg)
+					   toast(res.msg)
 					reject(code)
 				}
 				resolve(res)