wangxy 2 mēneši atpakaļ
vecāks
revīzija
2d17a3cc14

+ 8 - 2
App.vue

@@ -3,6 +3,7 @@
 		onBackPress
 	} from "@dcloudio/uni-app"
 	import cacheManager from "@/utils/cacheManager.js";
+	import {useIsCanBack} from "@/store/isCanBack.js";
 	export default {
 			
 		// creat by wgy 0619  生命周期 钩子  
@@ -31,8 +32,13 @@
 			// #ifdef APP-PLUS
 			const webview = plus.webview.currentWebview();
 			plus.key.addEventListener('backbutton', () => {
-				event.preventDefault();
-				return false
+				const store = useIsCanBack();
+				if (!store.isCanBack) {
+					event.preventDefault();
+					return false
+				} else {
+					return true
+				}
 			});
 			// #endif
 		},

+ 7 - 0
pages.json

@@ -140,6 +140,13 @@
 			}
 		},
 		{
+			"path" : "pages/admin/Chengji/ksScoreShijuan",
+			"style" : 
+			{
+				"navigationStyle": "custom"
+			}
+		},
+		{
 			"path" : "pages/client/Chengji/list",
 			"style" : 
 			{

+ 8 - 0
pages/Login/components/loginBox.vue

@@ -32,6 +32,9 @@
 	import passwordLli from "@/components/password-lli/password-lli.vue";
 	import {ref} from "vue"
 	import {toast} from "@/utils/common";
+	import {useIsCanBack} from "@/store/isCanBack.js"
+	
+	
 	const userName = ref('') // 用户名
 	const password = ref('') // 密码
 	const lliPassword = ref('') // 加密后的密码
@@ -40,6 +43,8 @@
 	const clearTelIcon= ref(false)
 	const clearPwIcon= ref(false)
 	
+	const store = useIsCanBack();
+	
 	// 加密
 	function handleUpdateLLiPassword() {
 		console.log('handleUpdateLLiPassword')
@@ -105,9 +110,12 @@
 			password: lliPassword.value,
 		}).then(res => {
 			cacheManager.set('auth', res.data)
+			store.setIsCanBack(false)
 			console.log('登录成功')
 			// 页面跳转
 			gotoPage();
+		}).catch(err => {
+			store.setIsCanBack(true)
 		})
 	}
 	

+ 152 - 115
pages/admin/Chengji/ksScoreShijuan.vue

@@ -1,86 +1,97 @@
 <template>
-	<view class="socre-shijuan">
+	<view class="phone-score-page">
 		<!-- 导航区域 -->
 		<view class="icon-title-navBar-box">
 			<view @click="handleBack" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">{{data.ksName}}</text>
 		</view>
 		<!-- 上方区域 -->
-		<topCard @openCard="handleOpenCard" :name="data.ksName" :zyLevelName="data.zyLevelName" :userScore="data.userScore" :Score="data.Score" :count="activeSt && activeSt.onlyNum||0" :total="data.StListForSearch.length"></topCard>
-		
-		<view>
-			<!-- 段落 -->
-			<view class="kaoshi-shiti-content">
-				<!-- 试题区域 -->
-				<view v-if="activeSt">
-					<template v-if="activeSt.stTypeId == 1">
-						<!-- 单选 -->
-						<danxuan :question="activeSt" :key="activeSt.stId"></danxuan>
-					</template>
-					<template v-if="activeSt.stTypeId == 2">
-						<!-- 多选 -->
-						<duoxuan :question="activeSt" :key="activeSt.stId"></duoxuan>
-					</template>
-					<template v-if="activeSt.stTypeId == 3">
-						<!-- 判断 -->
-						<panduan :question="activeSt" :key="activeSt.stId"></panduan>
-					</template>
-					<template v-if="activeSt.stTypeId == 4">
-						<!-- 填空 -->
-						<tiankong :question="activeSt" :key="activeSt.stId"></tiankong>
-					</template>
+		<topCard v-if="data.ksName" @openCard="handleOpenCard" :name="data.ksName" :zyLevelName="data.zyLevelName"
+			:userScore="data.userScore" :Score="data.ksScore"></topCard>
+
+		<!-- 段落 -->
+		<view class="score-shiti-content">
+			<!-- 试题区域 -->
+			<view v-if="activeSt">
+				<template v-if="activeSt.stTypeId == 1">
+					<!-- 单选 -->
+					<danxuan :question="activeSt" :key="activeSt.stId"></danxuan>
+				</template>
+				<template v-if="activeSt.stTypeId == 2">
+					<!-- 多选 -->
+					<duoxuan :question="activeSt" :key="activeSt.stId"></duoxuan>
+				</template>
+				<template v-if="activeSt.stTypeId == 3">
+					<!-- 判断 -->
+					<panduan :question="activeSt" :key="activeSt.stId"></panduan>
+				</template>
+				<template v-if="activeSt.stTypeId == 4">
+					<!-- 填空 -->
+					<tiankong :question="activeSt" :key="activeSt.stId"></tiankong>
+				</template>
+			</view>
+		</view>
+		<!-- 解析 -->
+		<view v-if="activeSt" class="score-answer-box">
+			<view class="phone-question-answer-box" v-if="activeSt.stTypeId != 4">
+				<view class="phone-line-title">答案解析</view>
+				<view class="btdf-row">本题得分:<text>{{answerRes.score}}</text>分</view>
+				<view class="zqda-row">正确答案:<text>{{answerRes.result}}</text></view>
+				<view class="ndda-row">您的答案:<text>{{answerRes.reply}}</text></view>
+				<view class="dajx-row">答案解析:
+					<rich-text :nodes="answerRes.answer"></rich-text>
 				</view>
 			</view>
-			<!-- 解析 -->
-			<view v-if="activeSt">
-				<view class="phone-question-answer-box" v-if="activeSt.stTypeId != 4">
-					<view class="phone-line-title">答案解析</view>
-					<view class="btdf-row">本题得分:<text>{{answerRes.score}}</text>分</view>
-					<view class="zqda-row">正确答案:<text>{{answerRes.result}}</text></view>
-					<view class="ndda-row">您的答案:<text>{{answerRes.reply}}</text></view>
-					<view class="dajx-row">答案解析: 
-						<rich-text :nodes="answerRes.answer"></rich-text>
-					</view>
+			<view class="phone-question-answer-box" v-else>
+				<view class="phone-line-title">答案解析</view>
+				<view class="btdf-row">本题得分:<text>{{answerRes.score}}</text>分</view>
+				<view class="zqda-row">正确答案:
+					<view v-for="(item,index) in answerRes.result">{{`填空${index+1}`}} : {{item}}</view>
 				</view>
-				<view class="phone-question-answer-box" v-else>
-					<view class="phone-line-title">答案解析</view>
-					<view class="btdf-row">本题得分:<text>{{answerRes.score}}</text>分</view>
-					<view class="zqda-row">正确答案:
-						<view v-for="(item,index) in answerRes.result">{{`填空${index+1}`}} : {{item}}</view>
-					</view>
-					<view class="ndda-row">您的答案:
+				<view class="ndda-row">您的答案:
 					<view v-for="(item,index) in answerRes.reply"> {{`填空${index+1}`}}: {{item}}</view>
-					</view>
-					<view class="dajx-row">答案解析: 
-						<rich-text :nodes="answerRes.answer"></rich-text>
-					</view>
 				</view>
-			</view>	
-			<!-- 上下按钮 -->
-			<template v-if="activeSt">
-				<button type="default" size="mini" hover-class="none" class="phone-green-btn ks-btn-prev" @click="handlePrev" v-if="!isFistStId">上一题</button>
-				<button type="default" size="mini" hover-class="none"class="phone-green-btn ks-btn-next" @click="handleNext" v-if="!isLastStId">下一题</button>
-			</template>
-			
-			<!-- 答题卡 -->
-			<uni-popup ref="popupRef" background-color="#fff" :is-mask-click="false" :mask-click="false">
-				<view class="answer-card-popup">
-					<view class="icon-title-bjcolor-navBar-box">
-						<view @click="handlePopupBack" class="nav-bar-icon"> </view>
-						<text class="nav-bar-title">答题卡</text>
+				<view class="dajx-row">答案解析:
+					<rich-text :nodes="answerRes.answer"></rich-text>
+				</view>
+			</view>
+		</view>
+		<!-- 上下按钮 -->
+		<view v-if="activeSt" class="score-bottom-box">
+			<view @click="handleOpenCard" class="score-num-box">
+				<icon class="score-num-icon"></icon>
+				<text
+					class="active-num">{{activeSt && activeSt.onlyNum||0}}</text>/<text>{{data.StListForSearch.length}}</text>
+			</view>
+			<view>
+				<button type="default" size="mini" hover-class="none" class="phone-green-btn score-answer-btn"
+					@click="handlePrev" v-if="!isFistStId">上一题</button>
+				<button type="default" size="mini" hover-class="none" class="phone-green-btn score-answer-btn"
+					@click="handleNext" v-if="!isLastStId">下一题</button>
+				<button type="default" size="mini" hover-class="none" class="phone-green-btn score-answer-btn"
+					@click="handleBack" v-if="isLastStId">完成</button>
+			</view>
+		</view>
+
+		<!-- 答题卡 -->
+		<uni-popup ref="popupRef" background-color="#fff" :is-mask-click="false" :mask-click="false">
+			<view class="answer-card-popup">
+				<view class="icon-title-bjcolor-navBar-box">
+					<view @click="handlePopupBack" class="nav-bar-icon"> </view>
+					<text class="nav-bar-title">答题卡</text>
+				</view>
+				<view class="answer-card-content" v-for="(paragraph,paragraphIndex) in questionData"
+					:key="paragraphIndex">
+					<view class="paragraph-title">
+						{{paragraph.name}}
 					</view>
-					<view class="answer-card-content" v-for="(paragraph,paragraphIndex) in questionData" :key="paragraphIndex">
-						<view class="paragraph-title">
-							{{paragraph.name}}
-						</view>
-						<view class="paragraph-qa" v-for="(qa,qaIndex) in paragraph.qas" :key="qaIndex" 
+					<view class="paragraph-qa" v-for="(qa,qaIndex) in paragraph.qas" :key="qaIndex"
 						:class="getQaClass(qa)" @click="answerCardItemClick(qa)">{{qa.onlyNum}}
-						</view>
 					</view>
 				</view>
-			</uni-popup>
-			
-		</view>
+			</view>
+		</uni-popup>
+
 	</view>
 </template>
 
@@ -90,10 +101,18 @@
 	import duoxuan from "@/components/questions/duoxuan.vue";
 	import tiankong from "@/components/questions/tiankong.vue";
 	import panduan from "@/components/questions/panduan.vue";
-	import {useQuestionTools} from "@/components/questions/useQuestionTools.js";
-	
-	import { onLoad } from "@dcloudio/uni-app";
-	import {ref,reactive,computed} from "vue"
+	import {
+		useQuestionTools
+	} from "@/components/questions/useQuestionTools.js";
+
+	import {
+		onLoad
+	} from "@dcloudio/uni-app";
+	import {
+		ref,
+		reactive,
+		computed
+	} from "vue"
 	import * as ksApi from "@/api/kaoshi.js"
 	const {
 		checkDanxuanReply,
@@ -102,11 +121,11 @@
 		checkTiankongReply,
 		getLetterByIndex
 	} = useQuestionTools();
-	
-	
+
+
 	const hisId = ref(null)
 	const popupRef = ref(null)
-	
+
 	const data = reactive({
 		ksId: null,
 		ksName: '',
@@ -117,13 +136,13 @@
 		StListForSearch: [],
 		duanluo: []
 	})
-	
+
 	const questionData = ref([]);
 	const progress = reactive({
 		dlIndex: 0,
 		dtIndex: 0
 	})
-	
+
 	const dlName = computed(() => {
 		if (data.StListForSearch && activeSt.value) {
 			return data.StListForSearch[activeSt.value.onlyNum].paragraphName
@@ -131,7 +150,7 @@
 			return ''
 		}
 	})
-	
+
 	const activeSt = computed(() => {
 		if (questionData.value.length) {
 			return questionData.value.length && questionData.value[progress.dlIndex].qas[progress.dtIndex];
@@ -139,9 +158,9 @@
 			return null
 		}
 	})
-	
+
 	const answerRes = computed(() => {
-		const qa = activeSt.value ;
+		const qa = activeSt.value;
 		let score = qa.score;
 		let reply = '';
 		let result = '';
@@ -153,7 +172,7 @@
 			} else {
 				reply = '未答'
 			}
-			
+
 			if (qa.result) {
 				result = getLetterByIndex(qa.result)
 			} else {
@@ -162,7 +181,7 @@
 		}
 		if (qa.stTypeId == 2) {
 			// 多选题
-			
+
 			if (qa.reply && qa.reply.length) {
 				reply = qa.reply.map(item => {
 					if (item.trim()) {
@@ -186,29 +205,37 @@
 			// 判断题
 			if (qa.reply === '') {
 				reply = '未答'
-			} else  if (qa.reply == 0) {
+			} else if (qa.reply == 0) {
 				reply = '错误'
-			}else if (qa.reply == 1) {
+			} else if (qa.reply == 1) {
 				reply = '正确'
 			}
 			if (qa.result == 0) {
 				result = '错误'
-			}else if (qa.result == 1) {
+			} else if (qa.result == 1) {
 				result = '正确'
 			}
 		}
 		if (qa.stTypeId == 4) {
 			let reply = qa.reply || [];
-			let result =qa.result || [];
+			let result = qa.result || [];
 			// 填空题
-			return {score,reply,result,answer}
+			return {
+				score,
+				reply,
+				result,
+				answer
+			}
 		} else {
-			return  {
-				score,reply,result,answer
+			return {
+				score,
+				reply,
+				result,
+				answer
 			}
 		}
 	})
-	
+
 	const isFistStId = computed(() => {
 		if (data.StListForSearch.length) {
 			return data.StListForSearch[0].stId == activeSt.value.stId
@@ -223,14 +250,14 @@
 			return false
 		}
 	});
-	
-	
+
+
 	onLoad((options) => {
 		hisId.value = options.hisId;
 		initPage()
 	})
-	
-	
+
+
 	function getQaClass(qa) {
 		if (qa.marked && qa.marked === true) {
 			return 'paragraph-qa-block-mark';
@@ -262,15 +289,15 @@
 			}
 		}
 	}
-	
-	
+
+
 	function handleBack() {
 		uni.redirectTo({
-			url: "/pages/admin/Lianxi/list"
+			url: "/pages/admin/Chengji/list"
 		})
 	}
-	
-	
+
+
 	function formatDuanluoList() {
 		let uIndex = 0; // 试题num
 		let iDuanluo = 0; // 段落num
@@ -280,7 +307,7 @@
 				qas: [],
 			};
 			paragraph.name = duanluo.name;
-	
+
 			let iQa = 0; // 当前试题序号
 			let order = 0; // 当前题型中第几题
 			for (const iDanxuan of duanluo.danxuan) {
@@ -293,7 +320,7 @@
 				uIndex++;
 				order++;
 				iQa++;
-	
+
 				data.StListForSearch.push({
 					stId: iDanxuan.stId,
 					paragraphName: paragraph.name,
@@ -313,7 +340,7 @@
 				uIndex++;
 				order++;
 				iQa++;
-	
+
 				data.StListForSearch.push({
 					stId: iDuoxuan.stId,
 					paragraphName: paragraph.name,
@@ -333,7 +360,7 @@
 				uIndex++;
 				order++;
 				iQa++;
-	
+
 				data.StListForSearch.push({
 					stId: iPanduan.stId,
 					paragraphName: paragraph.name,
@@ -353,7 +380,7 @@
 				uIndex++;
 				order++;
 				iQa++;
-	
+
 				data.StListForSearch.push({
 					stId: iTiankong.stId,
 					paragraphName: paragraph.name,
@@ -364,10 +391,10 @@
 			}
 			iDuanluo++;
 			questionData.value.push(paragraph)
-	
+
 		}
 	}
-	
+
 	function handlePrev() {
 		const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
 		const index = qa.num - 1;
@@ -376,9 +403,9 @@
 			progress.dlIndex = result.dlIndex;
 			progress.dtIndex = result.dtIndex
 		}
-	
+
 	}
-	
+
 	function handleNext() {
 		const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
 		const index = qa.num - 1;
@@ -388,24 +415,34 @@
 			progress.dtIndex = result.dtIndex
 		}
 	}
-	
-	
-	
+
+
+
 	function initPage() {
-		ksApi.getAdminKsChengjiView({hisId: hisId.value}).then(res => {
-			const { duanluoList,ksName, zyLevelName,userScore,ksScore } = res.data;
+		ksApi.getAdminKsChengjiView({
+			hisId: hisId.value
+		}).then(res => {
+			const {
+				duanluoList,
+				ksName,
+				zyLevelName,
+				userScore,
+				ksScore
+			} = res.data;
 			data.ksName = ksName;
 			data.zyLevelName = zyLevelName;
 			data.userScore = userScore;
 			data.ksScore = ksScore;
 			data.duanluo = duanluoList;
-			
+
 			formatDuanluoList();
 		})
 	}
+
 	function handlePopupBack() {
-			popupRef.value.close()
+		popupRef.value.close()
 	}
+
 	function handleOpenCard() {
 		popupRef.value.open('bottom')
 	}
@@ -413,4 +450,4 @@
 
 <style>
 
-</style>
+</style>

+ 2 - 2
pages/admin/Chengji/list.vue

@@ -80,7 +80,7 @@
 
 	function goUpPage() {
 		uni.redirectTo({
-			url: '/pages/client/ShouYe/shouye'
+			url: '/pages/admin/ShouYe/shouye'
 		})
 	}
 
@@ -91,7 +91,7 @@
 
 	function checkKecheng(item) {
 		uni.navigateTo({
-			url: `/pages/client/Chengji/ksScoreShijuan?hisId=${item.hisId}`
+			url: `/pages/admin/Chengji/ksScoreShijuan?hisId=${item.hisId}`
 		})
 	}
 

+ 2 - 2
pages/admin/Kaoshi/list.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="phone-list-page">
 		<view class="icon-title-navBar-box">
-			<!-- <view @click="goUpPage" class="nav-bar-icon"></view> -->
+			<view @click="goUpPage" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">考试管理</text>
 		</view>
 		<!-- 查询职业 -->
@@ -22,7 +22,7 @@
 							<view class="item-card-row">
 								<!-- 考试名 + 等级 -->
 								<view class="ks-item-top">
-									<view class="ks-name">{{item.ksName}}</view>
+									<view class="ks-name">{{item.zyName}}</view>
 									<view class="ks-zyLevelName">{{item.zyLevelName}}</view>
 								</view>
 								<!-- 时间 -->

+ 2 - 2
pages/admin/Kecheng/list.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="phone-list-page">
 		<view class="icon-title-navBar-box">
-			<!-- <view @click="goUpPage" class="nav-bar-icon"></view> -->
+			<view @click="goUpPage" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">课程管理</text>
 		</view>
 		<!-- 查询职业 -->
@@ -21,7 +21,7 @@
 							<view class="item-card-row">
 								<!-- 数量 -->
 								<view class="ks-item-top">
-									<view>{{item.name}}</view>
+									<view>{{item.zyName}}</view>
 									<view class="ks-zyLevelName">{{item.zyLevelName}}</view>
 								</view>
 								<view class="ks-totalTm">

+ 2 - 2
pages/admin/Lianxi/list.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="phone-list-page">
 		<view class="icon-title-navBar-box">
-			<!-- <view @click="goUpPage" class="nav-bar-icon"></view> -->
+			<view @click="goUpPage" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">练习管理</text>
 		</view>
 		<!-- 查询职业 -->
@@ -22,7 +22,7 @@
 							<view class="item-card-row">
 								<!-- 考试名 + 等级 -->
 								<view class="ks-item-top">
-									<view class="ks-name">{{item.lxName}}</view>
+									<view class="ks-name">{{item.zyName}}</view>
 									<view class="ks-zyLevelName">{{item.zyLevelName}}</view>
 								</view>
 								<!-- 时间 -->

+ 7 - 2
pages/admin/ShouYe/shouye.vue

@@ -103,12 +103,12 @@ function tjBtnClick(data){
 		        break;
 		    case 'ks':
 		        uni.redirectTo({
-		        	url:'/pages/admin/Kaoshi/exam'
+		        	url:'/pages/admin/Kaoshi/list'
 		        })
 		        break;
 			case 'cj':
 			    uni.redirectTo({
-			    	url:'/pages/client/Chengji/lxScoreShijuan'
+			    	url:'/pages/admin/Chengji/list'
 			    })
 			    break;
 			case 'kc':
@@ -121,6 +121,11 @@ function tjBtnClick(data){
 			    	url:'/pages/admin/tongzhi/list'
 			    })
 			    break;
+			case 'lc':
+				uni.redirectTo({
+					url:'/pages/admin/Lianxi/list'
+				})
+				break;
 		}
 	}
 </script>

+ 6 - 1
pages/admin/my/index.vue

@@ -52,7 +52,7 @@
 	import passwordDialog from './passwordDialog.vue';
 	import shexiangDialogVue from "@/components/dialog/shexiangDialog.vue";
 	import zhuapaiConfrimVue from "@/components/zhuapaiConfirm/index.vue";
-	
+	import {useIsCanBack} from "@/store/isCanBack.js"
 	let myInfoData = reactive({
 		userImg: '',
 		realName: '',
@@ -66,6 +66,9 @@
 	const zpRef = ref(null);
 	const exitContent = '你确定要执行这个操作吗?';
 	const exitTitle = '退出登录';
+	
+	const store = useIsCanBack();
+	
 	function getMyInit() {
 		getUserInfo();
 	}
@@ -116,8 +119,10 @@
 			uni.reLaunch({
 				url: '/pages/Login/index'
 			});
+			store.setIsCanBack(true)
 		}).catch(err => {
 			toast('退出登录失败,请稍后重试')
+			store.setIsCanBack(false)
 		})
 	}
 	

+ 1 - 1
pages/client/Chengji/ksScoreShijuan.vue

@@ -6,7 +6,7 @@
 			<text class="nav-bar-title">{{data.ksName}}</text>
 		</view>
 		<!-- 上方区域 -->
-		<topCard @openCard="handleOpenCard" :name="data.ksName" :zyLevelName="data.zyLevelName" :userScore="data.userScore" :Score="data.ksScore"></topCard>
+		<topCard v-if="data.ksName" @openCard="handleOpenCard" :name="data.ksName" :zyLevelName="data.zyLevelName" :userScore="data.userScore" :Score="data.ksScore"></topCard>
 		
 			<!-- 段落 -->
 			<view class="score-shiti-content">