Ver Fonte

Merge branch '2025北京诚祥-家政版' of https://gogs.mtavip.com/wangguoyu/uniProject into 2025北京诚祥-家政版

tanxue há 1 mês atrás
pai
commit
70552ea0f7

+ 2 - 2
components/zhuapaiConfirm/index.vue

@@ -65,9 +65,9 @@
 	function showDialog() {
 		textMess.value = '摄像头正在初始化...'
 		popupRef.value.open();
-		nextTick(() => {
+		setTimeout(() => {
 			startCamera()
-		})
+		},1000)
 	}
 
 	function handleClose() {

+ 4 - 6
pages/Login/components/clientloginBox.vue

@@ -99,7 +99,7 @@
 	
 	// 登录
 	function handleLogin() {
-	/* 	if(userName.value.length ===0){
+		if(userName.value.length ===0){
 			toast('请输入手机号!')
 			return
 		}
@@ -107,7 +107,7 @@
 		if(password.value.length ===0){
 			toast('请输入密码!')
 			return
-		} */
+		}
 		
 		// 去除 userName 两端的空格
 		const trimmedUserName = userName.value;
@@ -120,8 +120,8 @@
 		httpApi.loginTemp({
 			// type 1app 2为H5
 			type:2,
-			userName: '18842603073',
-			 password:'434354',
+			userName: trimmedUserName,
+			password:trimmedPassword,
 			
 		}).then(res => {
 			// 4为家政人员
@@ -133,8 +133,6 @@
 			}else{
 				toast('登录失败,您的身份有误,请联系管理员。')
 			}
-			
-			
 		}).catch(err => {
 			store.setIsCanBack(true)
 		}).finally(err => {

+ 94 - 72
pages/client/Kaoshi/exam.vue

@@ -7,8 +7,8 @@
 			<view v-if="activeSt" class="title-types">{{dlName}}</view>
 			<!--  倒计时 -->
 			<view v-if="!!data.endSecond">
-				<uni-countdown :show-day="false" :showHour="true" :showMinute="true" :second="data.endSecond" @timeup="onTimeUp"
-					:start="startCountDown"></uni-countdown>
+				<uni-countdown :show-day="false" :showHour="true" :showMinute="true" :second="data.endSecond"
+					@timeup="onTimeUp" :start="startCountDown"></uni-countdown>
 			</view>
 		</view>
 
@@ -41,7 +41,8 @@
 			<button class="phone-green-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" :style="{ backgroundImage: 'url(' + data.imgsArr.shitiNumIcon + ')' }"></icon>
+				<icon class="shiti-num-icon" :style="{ backgroundImage: 'url(' + data.imgsArr.shitiNumIcon + ')' }">
+				</icon>
 				<text
 					class="active-num">{{activeSt ? activeSt.onlyNum: 0}}</text>/<text>{{data.StListForSearch.length}}</text>
 			</view>
@@ -61,7 +62,7 @@
 		<uni-popup ref="popupRef" background-color="#fff" :animation="false" :is-mask-click="false" :mask-click="false">
 			<view class="answer-card-popup">
 				<customNavbarVue 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">
@@ -78,14 +79,15 @@
 		<!-- 摄像头 -->
 		<template v-if="data.zhuapai && data.zhuapai > 0">
 			<!-- 抓拍 -->
-			<zhuapaiVue ref="zhuapaiRef" @error="zpError" @success="zpSuccess" key="2" @progress="onProgress"></zhuapaiVue>
+			<zhuapaiVue ref="zhuapaiRef" @error="zpError" @success="zpSuccess" key="2" @progress="onProgress">
+			</zhuapaiVue>
 		</template>
 
 		<!-- 交卷确认 -->
 		<answerQueren ref="answerQrRef" @confirm="handleQuerenConfirm"></answerQueren>
 		<!-- 考试得分 -->
 		<submitScoreVue ref="subScoreRef" @confirm="handleScoreConfirm" @close="handleScoreClose"></submitScoreVue>
-		
+
 		<!-- 切屏确认弹窗 -->
 		<qiepingDlVue ref="qiepingDlRef" :content="messageContent" title="注意" okBtn="知道了"></qiepingDlVue>
 	</view>
@@ -93,14 +95,22 @@
 
 <script setup>
 	import cacheManager from '@/utils/cacheManager.js';
-	import {ref,reactive,computed,watch,nextTick} from "vue";
+	import {
+		ref,
+		reactive,
+		computed,
+		watch,
+		nextTick
+	} from "vue";
 	import zhuapaiVue from "@/components/zhuapaiConfirm/zhuapai.vue";
 	import zhuapaiConfirm from "@/components/zhuapaiConfirm/index.vue";
 	import answerQueren from "@/components/zhuapaiConfirm/answerQueren.vue";
 	import submitScoreVue from "@/components/zhuapaiConfirm/submitScore.vue";
 	import customNavbarVue from "@/components/custom-navbar/custom-navbar.vue";
 	import {
-		onLoad, onShow, onHide
+		onLoad,
+		onShow,
+		onHide
 	} from "@dcloudio/uni-app";
 	import * as ksApi from "@/api/kaoshi.js"
 	import danxuan from "@/components/questions/danxuan.vue";
@@ -114,7 +124,9 @@
 		useKaoShiCache
 	} from "./examTools"
 	import qiepingDlVue from "@/components/dialog/qiepingDl.vue";
-	import {useQiePing} from "@/utils/useQieping.js"
+	import {
+		useQiePing
+	} from "@/utils/useQieping.js"
 
 	const {
 		checkDanxuanReply,
@@ -128,8 +140,10 @@
 		getCacheKs,
 		removeCacheKs
 	} = useKaoShiCache();
-	
-	const { init: qiepingInit } = useQiePing();
+
+	const {
+		init: qiepingInit
+	} = useQiePing();
 
 	onLoad((option) => {
 		data.ksId = option.ksId;
@@ -138,9 +152,9 @@
 		data.from = option.from;
 		data.imgsArr.shitiNumIcon = cacheManager.get('projectImg').shiti_num_icon;
 
-    setTimeout(() => {
-      initKaoshi();
-    }, 800)
+		setTimeout(() => {
+			initKaoshi();
+		}, 1000)
 
 		/* if (data.zhuapai && data.zhuapai != 0) {
 			// 考试前确认摄像头
@@ -152,7 +166,7 @@
 			initKaoshi();
 		} */
 	})
-	
+
 	const popupRef = ref(null)
 	const zhuapaiRef = ref(null)
 	const qiepingRef = ref(null)
@@ -162,7 +176,7 @@
 	const subScoreRef = ref(null);
 	const messageContent = ref('');
 	const qiepingDlRef = ref(null);
-	
+
 	const timer1 = ref(null);
 
 	const data = reactive({
@@ -186,7 +200,7 @@
 			shitiNumIcon: '',
 		},
 	})
-	
+
 	const markDB = ref([]);
 
 	const questionData = ref([]);
@@ -232,21 +246,21 @@
 			return false
 		}
 	});
-	
+
 
 	function handleScoreClose() {
 		handleBack()
 	}
-	
+
 	// 考试得分相关 start
 	function handleScoreConfirm() {
 		uni.redirectTo({
 			url: `/pages/client/Chengji/ksScoreShijuan?hisId=${data.hisId}&from=kaoshi`
 		})
 	}
-	
+
 	// 考试得分相关 end
-	
+
 	// 保存相关
 	function handleSave(showToast) {
 		if (timer1.value) {
@@ -254,13 +268,13 @@
 				title: '请勿连续保存',
 				icon: 'none'
 			})
-			return 
+			return
 		}
 		timer1.value = setTimeout(() => {
 			clearTimeout(timer1.value);
-		},10*1000);
+		}, 10 * 1000);
 		console.log(questionData.value)
-		
+
 		const result = []
 		const option = {
 			force: false,
@@ -278,7 +292,13 @@
 			})
 		})
 		// 保存试题答案
-		saveCacheKs(data.operId, {replyList:result, position: {dlIndex:progress.dlIndex, dtIndex: progress.dtIndex}})
+		saveCacheKs(data.operId, {
+			replyList: result,
+			position: {
+				dlIndex: progress.dlIndex,
+				dtIndex: progress.dtIndex
+			}
+		})
 		// 保存答题进度
 		ksApi.getClientKsSave(option).then(res => {
 			if (res.data && showToast) {
@@ -344,7 +364,7 @@
 	function handleQuerenConfirm() {
 		handleSubmit()
 	}
-	
+
 	function handleSubmit(force = false) {
 		const result = {
 			force,
@@ -352,11 +372,11 @@
 			replyList: []
 		};
 		console.log(questionData.value)
-		
+
 		// uni.showLoading({
 		// 	title: '提交中'
 		// })
-		
+
 		questionData.value.forEach(dl => {
 			dl.qas.forEach(st => {
 				const opt = {
@@ -366,7 +386,7 @@
 				result.replyList.push(opt)
 			})
 		})
-	
+
 		ksApi.getClientKsSubmit(result).then(res => {
 			if (res.code == 0) {
 				subScoreRef.value.showDialog(res.data);
@@ -378,7 +398,7 @@
 			// uni.hideLoading()
 		})
 	}
-	
+
 	function onTimeUp() {
 		handleSubmit();
 	}
@@ -416,8 +436,8 @@
 		})
 		setTimeout(() => {
 			handleBack()
-		},3000)
-	
+		}, 3000)
+
 	}
 
 	// 摄像头抓拍相关功能 end
@@ -429,11 +449,12 @@
 			duration: 3000,
 			mask: true // 防止触摸穿透
 		})
-		
+
 		setTimeout(() => {
 			handleBack();
-		},3000)
+		}, 3000)
 	}
+
 	function zpConfirmSuccess() {
 		initKaoshi();
 	}
@@ -493,15 +514,15 @@
 	}
 
 	function handleBack() {
-		
-		 const pages = getCurrentPages();
-		 if (pages.length>1) {
-			 uni.navigateBack()
-		 } else {
-			  history.back();
-		 }
-		
-		
+
+		const pages = getCurrentPages();
+		if (pages.length > 1) {
+			uni.navigateBack()
+		} else {
+			history.back();
+		}
+
+
 	}
 
 	function showAnswerCard() {
@@ -547,7 +568,7 @@
 			let order = 0; // 当前题型中第几题
 			for (const iDanxuan of duanluo.danxuan) {
 				iDanxuan.type = 'danxuan';
-				iDanxuan.marked = data.biaoji[iDanxuan.stId] ? true: false;
+				iDanxuan.marked = data.biaoji[iDanxuan.stId] ? true : false;
 				iDanxuan.onlyNum = uIndex + 1;
 				iDanxuan.order = order;
 				iDanxuan.iQa = iQa;
@@ -567,7 +588,7 @@
 			order = 0;
 			for (const iDuoxuan of duanluo.duoxuan) {
 				iDuoxuan.type = 'duoxuan';
-				iDuoxuan.marked = data.biaoji[iDuoxuan.stId] ? true: false;
+				iDuoxuan.marked = data.biaoji[iDuoxuan.stId] ? true : false;
 				iDuoxuan.onlyNum = uIndex + 1;
 				iDuoxuan.order = order;
 				paragraph.qas.push(iDuoxuan);
@@ -588,7 +609,7 @@
 			order = 0;
 			for (const iPanduan of duanluo.panduan) {
 				iPanduan.type = 'panduan';
-				iPanduan.marked = data.biaoji[iPanduan.stId] ? true: false;
+				iPanduan.marked = data.biaoji[iPanduan.stId] ? true : false;
 				iPanduan.onlyNum = uIndex + 1;
 				iPanduan.order = order;
 				paragraph.qas.push(iPanduan);
@@ -608,7 +629,7 @@
 			order = 0;
 			for (const iTiankong of duanluo.tiankong) {
 				iTiankong.type = 'tiankong';
-				iTiankong.marked = data.biaoji[iTiankong.stId] ? true: false;
+				iTiankong.marked = data.biaoji[iTiankong.stId] ? true : false;
 				iTiankong.onlyNum = uIndex + 1;
 				iTiankong.order = order;
 				paragraph.qas.push(iTiankong);
@@ -640,7 +661,7 @@
 			operId: data.operId,
 			biaoji: JSON.stringify(data.biaoji)
 		}).catch(err => {
-			console.log(22222,err)
+			console.log(22222, err)
 			handleBack()
 		})
 	}
@@ -648,7 +669,10 @@
 	function formatKaoshiData() {
 		const historyData = getCacheKs(data.operId);
 		if (historyData) {
-			const { replyList ,position } = historyData;
+			const {
+				replyList,
+				position
+			} = historyData;
 			if (replyList) {
 				questionData.value.forEach(dl => {
 					dl.qas.forEach(st => {
@@ -660,7 +684,7 @@
 				progress.dlIndex = position.dlIndex;
 				progress.dtIndex = position.dtIndex;
 			}
-		
+
 		}
 	}
 
@@ -695,7 +719,7 @@
 			data.ksName = ksName;
 			data.stTotal = stTotal;
 			data.stScore = stScore;
-			data.biaoji = biaoji ? JSON.parse(biaoji): {};
+			data.biaoji = biaoji ? JSON.parse(biaoji) : {};
 			data.endSecond = endSecond;
 			data.pageSize = pageSize;
 			data.toggleScreenFlag = toggleScreenFlag;
@@ -707,32 +731,30 @@
 			formatKaoshiData();
 			// 设置抓拍监听
 
-      if (data.zhuapai && data.zhuapai > 0) {
-        console.log('ccccc', zhuapaiRef.value)
-        zhuapaiRef.value.init({
-          zhuapai: zhuapai,
-          operId: operId
-        });
-      }
-      // 设置切屏
-      qiepingInit({
-        zhuapaiFlag: !!data.zhuapai,
-        toggleScreenFlag: toggleScreenFlag,
-        toggleScreenSecond: toggleScreenSecond,
-        ksId: data.ksId
-      }, {
-        zhuapai:qpZhuapai,
-        forceSubmit,
-        qiepingToast
-      })
+			if (data.zhuapai && data.zhuapai > 0) {
+				zhuapaiRef.value.init({
+					zhuapai: zhuapai,
+					operId: operId
+				});
+			}
+			// 设置切屏
+			qiepingInit({
+				zhuapaiFlag: !!data.zhuapai,
+				toggleScreenFlag: toggleScreenFlag,
+				toggleScreenSecond: toggleScreenSecond,
+				ksId: data.ksId
+			}, {
+				zhuapai: qpZhuapai,
+				forceSubmit,
+				qiepingToast
+			})
 
 			uni.setNavigationBarTitle({
 				title: data.ksName
 			});
 			startCountDown.value = true;
 		}).catch(err => {
-			console.log(33333,err)
-      handleBack()
-    })
+			handleBack()
+		})
 	}
 </script>

+ 1 - 3
pages/client/Kaoshi/examCamera.vue

@@ -21,9 +21,7 @@
 
 	onLoad((options) => {
 		opt.value = options;
-		nextTick(() => {
-			zhuapaiConfirmRef.value.showDialog()
-		})
+		zhuapaiConfirmRef.value.showDialog()
 	})
 
 	function zpConfirmSuccess() {