wangxy hai 2 meses
pai
achega
b9992e89c4

+ 1 - 1
components/listCard/kaoshiCard.vue

@@ -3,7 +3,7 @@
 		<!-- card title -->
 		<view class="card-head-box">
 			<view class="card-line-title">考试</view>
-			<view class="card-more" @click="checkMore">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
+			<view class="card-more" @click="checkMore" v-if="data.count">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
 		</view>
 		
 		<!-- kaoshi title -->

+ 1 - 1
components/listCard/kechengCard.vue

@@ -3,7 +3,7 @@
 		<!-- card title -->
 		<view class="card-head-box">
 			<view class="card-line-title">课程</view>
-			<view class="card-more" @click="checkMore">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
+			<view class="card-more" @click="checkMore" v-if="data.count">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
 		</view>
 		<!-- kaoshi title -->
 		<view class="card-name-box">

+ 1 - 1
components/listCard/lianxiCard.vue

@@ -3,7 +3,7 @@
 		<!-- card title -->
 		<view class="card-head-box">
 			<view class="card-line-title">练习</view>
-			<view class="card-more" @click="checkMore">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
+			<view class="card-more" @click="checkMore" v-if="data.count">更多<text class="more-num">{{data.count}}</text><icon class="more-jt"></icon></view>
 		</view>
 		<!-- kaoshi title -->
 		<view class="card-name-box">

+ 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.Score"></topCard>
+		<topCard @openCard="handleOpenCard" :name="data.ksName" :zyLevelName="data.zyLevelName" :userScore="data.userScore" :Score="data.ksScore"></topCard>
 		
 			<!-- 段落 -->
 			<view class="score-shiti-content">

+ 150 - 116
pages/client/Chengji/lxScoreShijuan.vue

@@ -1,87 +1,95 @@
 <template>
-	<view class="socre-shijuan">
+	<view class="phone-score-page">
 		<!-- 导航区域 -->
-		<view class="icon-title-navBar-box">
+		<view class="icon-title-bjcolor-navBar-box">
 			<view @click="handleBack" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">{{data.lxName}}</text>
 		</view>
 		<!-- 上方区域 -->
-		<topCard @openCard="handleOpenCard" :name="data.lxName" :zyLevelName="data.zyLevelName" :userScore="data.userScore" :Score="data.Score"></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 @openCard="handleOpenCard" :name="data.lxName" :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">
-				<text  @click="handleOpenCard"><i></i> {{activeSt && activeSt.onlyNum||0}}/{{data.StListForSearch.length}}</text>
-				<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 class="score-bottom-box" v-if="activeSt">
+			<view @click="handleOpenCard" class="score-num-box">
+				<icon class="score-num-icon"></icon>
+				<text class="active-num" @click="handleOpenCard"><i></i>
+					{{activeSt && activeSt.onlyNum||0}}/{{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>
+			</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>
 
@@ -91,10 +99,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 lxApi from "@/api/lianxi.js"
 	const {
 		checkDanxuanReply,
@@ -103,11 +119,11 @@
 		checkTiankongReply,
 		getLetterByIndex
 	} = useQuestionTools();
-	
-	
+
+
 	const hisId = ref(null)
 	const popupRef = ref(null)
-	
+
 	const data = reactive({
 		lxId: null,
 		lxName: '',
@@ -118,13 +134,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
@@ -132,7 +148,7 @@
 			return ''
 		}
 	})
-	
+
 	const activeSt = computed(() => {
 		if (questionData.value.length) {
 			return questionData.value.length && questionData.value[progress.dlIndex].qas[progress.dtIndex];
@@ -140,9 +156,9 @@
 			return null
 		}
 	})
-	
+
 	const answerRes = computed(() => {
-		const qa = activeSt.value ;
+		const qa = activeSt.value;
 		let score = qa.score;
 		let reply = '';
 		let result = '';
@@ -154,7 +170,7 @@
 			} else {
 				reply = '未答'
 			}
-			
+
 			if (qa.result) {
 				result = getLetterByIndex(qa.result)
 			} else {
@@ -163,7 +179,7 @@
 		}
 		if (qa.stTypeId == 2) {
 			// 多选题
-			
+
 			if (qa.reply && qa.reply.length) {
 				reply = qa.reply.map(item => {
 					if (item.trim()) {
@@ -187,27 +203,35 @@
 			// 判断题
 			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
@@ -222,14 +246,14 @@
 			return false
 		}
 	});
-	
-	
+
+
 	onLoad((options) => {
 		hisId.value = options.hisId;
 		initPage()
 	})
-	
-	
+
+
 	function getQaClass(qa) {
 		if (qa.marked && qa.marked === true) {
 			return 'paragraph-qa-block-mark';
@@ -261,15 +285,15 @@
 			}
 		}
 	}
-	
-	
+
+
 	function handleBack() {
 		uni.redirectTo({
-			url: "/pages/admin/Lianxi/list"
+			url: "/pages/client/Lianxi/list"
 		})
 	}
-	
-	
+
+
 	function formatDuanluoList() {
 		let uIndex = 0; // 试题num
 		let iDuanluo = 0; // 段落num
@@ -279,7 +303,7 @@
 				qas: [],
 			};
 			paragraph.name = duanluo.name;
-	
+
 			let iQa = 0; // 当前试题序号
 			let order = 0; // 当前题型中第几题
 			for (const iDanxuan of duanluo.danxuan) {
@@ -292,7 +316,7 @@
 				uIndex++;
 				order++;
 				iQa++;
-	
+
 				data.StListForSearch.push({
 					stId: iDanxuan.stId,
 					paragraphName: paragraph.name,
@@ -312,7 +336,7 @@
 				uIndex++;
 				order++;
 				iQa++;
-	
+
 				data.StListForSearch.push({
 					stId: iDuoxuan.stId,
 					paragraphName: paragraph.name,
@@ -332,7 +356,7 @@
 				uIndex++;
 				order++;
 				iQa++;
-	
+
 				data.StListForSearch.push({
 					stId: iPanduan.stId,
 					paragraphName: paragraph.name,
@@ -352,7 +376,7 @@
 				uIndex++;
 				order++;
 				iQa++;
-	
+
 				data.StListForSearch.push({
 					stId: iTiankong.stId,
 					paragraphName: paragraph.name,
@@ -363,10 +387,10 @@
 			}
 			iDuanluo++;
 			questionData.value.push(paragraph)
-	
+
 		}
 	}
-	
+
 	function handlePrev() {
 		const qa = data.StListForSearch.find(item => item.stId == activeSt.value.stId);
 		const index = qa.num - 1;
@@ -375,9 +399,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;
@@ -387,24 +411,34 @@
 			progress.dtIndex = result.dtIndex
 		}
 	}
-	
-	
-	
+
+
+
 	function initPage() {
-		lxApi.getClientLianxiChengjiView({hisId: hisId.value}).then(res => {
-			const { duanluoList,lxName, zyLevelName,userScore,ksScore } = res.data;
+		lxApi.getClientLianxiChengjiView({
+			hisId: hisId.value
+		}).then(res => {
+			const {
+				duanluoList,
+				lxName,
+				zyLevelName,
+				userScore,
+				ksScore
+			} = res.data;
 			data.lxName = lxName;
 			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')
 	}
@@ -412,4 +446,4 @@
 
 <style>
 
-</style>
+</style>

+ 1 - 1
pages/client/Kaoshi/exam.vue

@@ -366,7 +366,7 @@
 				// 清空缓存
 				removeCacheKs(data.operId);
 			}
-		}).catch(err => {
+		}).finally(err => {
 			uni.hideLoading()
 		})
 	}

+ 10 - 2
pages/client/Lianxi/exam.vue

@@ -145,7 +145,8 @@
 		zhuapai: 0,
 		duanluo: [],
 		StListForSearch: [],
-		from: ''
+		from: '',
+		hisId: null
 	})
 	
 	const markDB = ref([]);
@@ -216,7 +217,7 @@
 	// 考试得分相关 start
 	function handleScoreConfirm() {
 		uni.redirectTo({
-			url: '/pages/client/Chengji/lxScoreShijuan?from=lianxi'
+			url: `/pages/client/Chengji/lxScoreShijuan?hisId=${data.hisId}&from=lianxi`
 		})
 	}
 	
@@ -292,11 +293,18 @@
 				result.replyList.push(opt)
 			})
 		})
+		
+		uni.showLoading({
+			title: '加载中'
+		})
 	
 		lxApi.getClientLianxiSubmit(result).then(res => {
 			if (res.code == 0) {
+				data.hisId = res.data.hisId;
 				subScoreRef.value.showDialog(res.data);
 			}
+		}).finally(() => {
+			uni.hideLoading()
 		})
 	}