Jelajahi Sumber

修复了下一题语音和技巧讲解语音

zhangyujun 3 tahun lalu
induk
melakukan
71d392ad55

+ 8 - 0
src/components/m-exercise/components/bottomBar.vue

@@ -5,6 +5,12 @@ import { Dialog } from "vant";
 import { useRouter } from "vue-router";
 export default defineComponent({
 	props: {
+		audioPause:{
+			type:Function,
+			default:()=>{
+
+			}
+		},
 		currentSubjectIndex: {
 			type: Number,
 			default: 0,
@@ -58,6 +64,7 @@ export default defineComponent({
 					<van-tabbar-item
 						onClick={() => {
 							emit("lastSubject");
+							props.audioPause()
 						}}
 						v-slots={{
 							icon: () => <m-icon type="shangyiti" />,
@@ -97,6 +104,7 @@ export default defineComponent({
 					<van-tabbar-item
 						onClick={() => {
 							emit("nextSubject");
+							props.audioPause()
 						}}
 						v-slots={{
 							icon: () => <m-icon type="xiayiti" />,

+ 5 - 0
src/components/m-exercise/components/explainJq.vue

@@ -6,6 +6,10 @@
 			skillsShow: Boolean,
 		},
 		emits: {
+			"audioPause":()=>{
+				return undefined
+
+			},
 			subjectAudioPlay: (type: "读题" | "读官方解释" | "读技巧解释" | "读题+答案") => {
 				return undefined;
 			},
@@ -27,6 +31,7 @@
 									<span
 										onClick={() => {
 											emit("update:skillsShow", false);
+											emit("audioPause")
 										}}>
 										关闭
 									</span>

+ 5 - 0
src/components/m-exercise/components/explainJs.vue

@@ -6,6 +6,10 @@
 			officialShow: Boolean,
 		},
 		emits: {
+			"audioPause":()=>{
+				return undefined
+
+			},
 			subjectAudioPlay: (type: "读题" | "读官方解释" | "读技巧解释" | "读题+答案") => {
 				return undefined;
 			},
@@ -25,6 +29,7 @@
 									<span
 										onClick={() => {
 											emit("update:officialShow", false);
+											emit("audioPause")
 										}}>
 										关闭
 									</span>

+ 27 - 9
src/components/m-exercise/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<!-- 导航栏 -->
-	<van-nav-bar :title="query.vehicle + '>' + query.name" left-arrow @click-left="back" fixed placeholder>
+	<van-nav-bar :title="exerciseTitle" class="custom-title" left-arrow @click-left="back" fixed placeholder>
 		<template #right>
 			<m-icon type="shezhi" @click="setShow = true" />
 		</template>
@@ -80,9 +80,25 @@
 	<!-- 功能选择列表 -->
 	<functionList :currentSubject="currentSubject" @subjectAudioPlay="subjectAudioPlay" @addCurrentQuestion="addCurrentQuestion" v-model:skillsShow="skillsShow" />
 	<!-- 技巧讲解 -->
-	<explainJq :currentSubject="currentSubject" v-model:skillsShow="skillsShow" @subjectAudioPlay="subjectAudioPlay" />
+	<explainJq
+		@audioPause="
+			() => {
+				audioPause();
+			}
+		"
+		:currentSubject="currentSubject"
+		v-model:skillsShow="skillsShow"
+		@subjectAudioPlay="subjectAudioPlay" />
 	<!-- 官方解释 -->
-	<explainJs :currentSubject="currentSubject" v-model:officialShow="officialShow" @subjectAudioPlay="subjectAudioPlay" />
+	<explainJs
+		@audioPause="
+			() => {
+				audioPause();
+			}
+		"
+		:currentSubject="currentSubject"
+		v-model:officialShow="officialShow"
+		@subjectAudioPlay="subjectAudioPlay" />
 	<!-- 设置操作栏 -->
 	<van-popup v-model:show="setShow" position="bottom">
 		<van-cell center title="答对跳转下一题">
@@ -102,13 +118,14 @@
 		<subjectChangePopup :trueNum="trueNum" :falseNum="falseNum" v-model:currentSubjectIndex="currentSubjectIndex" :subjectList="subjectList" />
 	</van-popup>
 	<!-- 底部操作栏 -->
-	<bottomBar :currentSubjectIndex="currentSubjectIndex" :subjectTotal="subjectTotal" :trueNum="trueNum" :falseNum="falseNum" v-model:showSubjectChangePopup="showSubjectChangePopup" v-model:officialShow="officialShow" @lastSubject="lastSubject" @nextSubject="nextSubject" />
+	<bottomBar :audioPause="audioPause" :currentSubjectIndex="currentSubjectIndex" :subjectTotal="subjectTotal" :trueNum="trueNum" :falseNum="falseNum" v-model:showSubjectChangePopup="showSubjectChangePopup" v-model:officialShow="officialShow" @lastSubject="lastSubject" @nextSubject="nextSubject" />
 </template>
 
 <script lang="ts" setup>
-import { ref, defineProps } from "vue";
+import { ref, defineProps, computed } from "vue";
 import subjectChangePopup from "./components/subjectChangePopup.vue";
 import { useTopicMode, useAudioSet, useSubjectShowLogic } from "@/hooks/exercise";
+import {exerciseTitle} from "@/hooks/text/title"
 import { RouterBus } from "@/hooks";
 import subjectContext from "./components/subjectContext.vue";
 import functionList from "./components/functionList.vue";
@@ -127,7 +144,6 @@ const props = defineProps<{
 }>();
 
 const isVip = store.getters.getIsVip;
-
 //答题模式选择逻辑
 const { answerTypeList, currentType, typeParams } = useTopicMode();
 
@@ -143,13 +159,15 @@ const showSubjectChangePopup = ref(false);
 const { subjectList, currentSubject, currentSubjectIndex, subjectTotal, nextSubject, lastSubject, trueNum, falseNum, isJumpNext, userAnswerChange, addCurrentQuestion, skillsShow, officialShow } = useSubjectShowLogic(props.listType);
 
 //音频模块
-const { aotuPlayFlag, subjectAudioPlay, aotuPlaySet } = useAudioSet(currentSubject);
+const { aotuPlayFlag, subjectAudioPlay, aotuPlaySet, audioPause } = useAudioSet(currentSubject);
 </script>
 
 <style lang="scss" scoped>
-.visibility-hidden{
+:deep(.van-ellipsis) {
+	white-space: normal;
+}
+.visibility-hidden {
 	visibility: hidden;
-
 }
 .parsing-img {
 	width: 100%;

+ 6 - 1
src/components/m-wrong-preview/components/bottomBar.vue

@@ -5,6 +5,7 @@ import { Dialog } from "vant";
 import { useRouter } from "vue-router";
 import { json } from "stream/consumers";
 import { Console } from "console";
+import { RouterBus } from "@/hooks";
 export default defineComponent({
 	props: {
 		subjectList:{
@@ -46,6 +47,7 @@ export default defineComponent({
 		const vehicle = useRouter().currentRoute.value.query.vehicle as string; //路由qvehicle参数
 		const subject = useRouter().currentRoute.value.query.subject as string; //路由subject参数
 		const isVip = store.getters.getIsVip;
+			const { goWrongReview } = new RouterBus();
 		console.log(router.currentRoute.value);
 		// const vipClick = () => {
 		// 	if (store.getters.getIsVip || router.currentRoute.value.path == "/exerciseFree") {
@@ -76,7 +78,10 @@ export default defineComponent({
 					window.localStorage.setItem(vehicle+subject,JSON.stringify(wrongSet))
 					router.push({
 						path:"/wrongPreviewRes",
-						query:router.currentRoute.value.query
+						query:{
+							title:"错题重做",
+							...router.currentRoute.value.query
+						}
 					})
 			
 

+ 6 - 3
src/components/m-wrong-preview/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<!-- 导航栏 -->
-	<van-nav-bar :title="query.vehicle + '>' + query.name" left-arrow @click-left="back" fixed placeholder>
+	<van-nav-bar :title="title" left-arrow @click-left="back" fixed placeholder>
 		<!-- <template #right>
 			<m-icon type="shezhi" @click="setShow = true" />
 		</template> -->
@@ -106,7 +106,7 @@
 </template>
 
 <script lang="ts" setup>
-import { ref, defineProps } from "vue";
+import { ref, defineProps,computed } from "vue";
 import subjectChangePopup from "./components/subjectChangePopup.vue";
 import { useTopicMode, useAudioSet, useSubjectShowLogic } from "@/hooks/exercise";
 import { RouterBus } from "@/hooks";
@@ -139,7 +139,10 @@ const isSoundEffect = ref(true);
 // 显示题目选择栏
 const showSubjectChangePopup = ref(false);
 
-
+const title = computed(() => {
+	
+	return `(${query.cert})/${query.name}/${query.title}/${query.placeIssueName || query.classIssueName || query.excellIssueName || query.sequeIssueName||""}`;
+});
 
 //题目展示逻辑
 const { subjectList, currentSubject, currentSubjectIndex, subjectTotal, nextSubject, lastSubject, trueNum, falseNum, isJumpNext, userAnswerChange, addCurrentQuestion, skillsShow, officialShow } = useSubjectShowLogic(props.listType);

+ 1 - 0
src/hooks/exercise/audio.ts

@@ -74,5 +74,6 @@ export function useAudioSet(currentSubject: ComputedRef<any>) {
 		aotuPlayFlag,
 		aotuPlaySet,
 		subjectAudioPlay,
+		audioPause
 	};
 }

+ 2 - 2
src/hooks/index.ts

@@ -98,10 +98,10 @@ export class RouterBus {
 		this.router.push({ path: "/mockTest", query: this.route.query });
 	};
 	/** 错题重阅 */
-	goWrongReview = (ids: number | number[]) => {
+	goWrongReview = () => {
 		this.router.push({
 			path: "/wrongReview",
-			query: { ...this.route.query, wrongIds: ids },
+			query: { ...this.route.query, title: "错题重做" },
 		});
 	};
 }

+ 7 - 0
src/hooks/text/title.ts

@@ -0,0 +1,7 @@
+import { computed } from "vue";
+import { useRoute } from "vue-router";
+
+export const exerciseTitle = computed(() => {
+    const query = useRoute().query
+	return `(${query.cert})/${query.name}/${query.title}/${query.placeIssueName || query.classIssueName || query.excellIssueName || query.sequeIssueName || ""}`;
+});

+ 60 - 60
src/views/classify/index.vue

@@ -1,37 +1,37 @@
 <template>
-  <m-nav-bar :title="query.title" />
-  <div class="cell-box">
-    <van-cell
-      class="cell"
-      :title="
-        item.placeIssueName ||
-        item.classIssueName ||
-        item.excellIssueName ||
-        item.sequeIssueName
-      "
-      is-link
-      center
-      v-for="(item, index) in classData"
-      :key="index"
-      :border="false"
-      @click="
-        push({
-          name: 'exercise',
-          query: {
-            ...query,
-            placeIssue: item.placeIssue,
-            classIssue: item.classIssue,
-            excellIssue: item.excellIssue,
-            sequeIssue: item.sequeIssue,
-          },
-        })
-      "
-    >
-      <template #icon>
-        <div class="icon">{{ index + 1 }}</div>
-      </template>
-    </van-cell>
-  </div>
+	<m-nav-bar :title="query.title" />
+	<div class="cell-box">
+		<van-cell
+			class="cell"
+			:title="item.placeIssueName || item.classIssueName || item.excellIssueName || item.sequeIssueName"
+			is-link
+			center
+			v-for="(item, index) in classData"
+			:key="index"
+			:border="false"
+			@click="
+				() => {
+					push({
+						name: 'exercise',
+						query: {
+							...query,
+              classIssueName:item.classIssueName,
+              placeIssueName:item.placeIssueName,
+              excellIssueName:item.excellIssueName,
+              sequeIssueName:item.sequeIssueName,
+							placeIssue: item.placeIssue,
+							classIssue: item.classIssue,
+							excellIssue: item.excellIssue,
+							sequeIssue: item.sequeIssue,
+						},
+					});
+				}
+			">
+			<template #icon>
+				<div class="icon">{{ index + 1 }}</div>
+			</template>
+		</van-cell>
+	</div>
 </template>
 
 <script setup lang="ts">
@@ -39,40 +39,40 @@ import { getTopicClass } from "@/api";
 import { ref } from "vue";
 import { RouterBus } from "@/hooks";
 const {
-  route: { query },
-  router: { push },
+	route: { query },
+	router: { push },
 } = new RouterBus();
 const classData = ref();
 getTopicClass(query.path as string, query).then(({ data }) => {
-   data.data.shift();
-  classData.value = data.data;
+	data.data.shift();
+	classData.value = data.data;
 });
 </script>
 
 <style lang="scss" scoped>
 .cell-box {
-  display: flex;
-  padding: 5px 15px;
-  flex-wrap: wrap;
-  justify-content: space-between;
-  .cell {
-    width: 167px;
-    margin-top: 10px;
-    box-shadow: 0px 0px 10px rgba(124, 129, 136, 0.2);
-  }
-  .icon {
-    width: 20px;
-    height: 20px;
-    background: #498ef5;
-    border-radius: 50%;
-    font-weight: 500;
-    font-family: PingFang SC;
-    font-size: 13px;
-    display: flex;
-    justify-content: center;
-    align-items: center;
-    color: #ffffff;
-    margin-right: 5px;
-  }
+	display: flex;
+	padding: 5px 15px;
+	flex-wrap: wrap;
+	justify-content: space-between;
+	.cell {
+		width: 167px;
+		margin-top: 10px;
+		box-shadow: 0px 0px 10px rgba(124, 129, 136, 0.2);
+	}
+	.icon {
+		width: 20px;
+		height: 20px;
+		background: #498ef5;
+		border-radius: 50%;
+		font-weight: 500;
+		font-family: PingFang SC;
+		font-size: 13px;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		color: #ffffff;
+		margin-right: 5px;
+	}
 }
 </style>

+ 1 - 1
src/views/home/children/test/index.vue

@@ -15,7 +15,7 @@
 			</template>
 			<van-tabs class="test-type" animated>
 				<van-tab :title="sujectItem.name" v-for="(sujectItem, index) in carTypeItem.sujectList" :key="index" :name="sujectItem.name">
-					<component :is="sujectOne" :query="{ ...carTypeItem.query, ...sujectItem.query }"></component>
+					<component :is="sujectOne" :query="{ ...carTypeItem.query, ...sujectItem.query,title:'模拟考试' }"></component>
 				</van-tab>
 			</van-tabs>
 		</van-tab>

+ 1 - 0
src/views/mockTest/components/mockTestEnd.vue

@@ -39,6 +39,7 @@ const goWrongPreview = ()=>{
 	router.push({
 		path:"/wrongReview",
 		query:{
+			title:"错题重做",
 			...router.currentRoute.value.query
 		}
 

+ 242 - 238
src/views/mockTest/components/startTest.vue

@@ -1,6 +1,6 @@
 <template>
 	<!-- 导航栏 -->
-	<van-nav-bar :title="query.vehicle + '>' + query.name" left-arrow @click-left="back" fixed placeholder>
+	<van-nav-bar :title="title" left-arrow @click-left="back" fixed placeholder>
 		<template #right>
 			<m-icon type="shezhi" @click="setShow = true" />
 		</template>
@@ -147,280 +147,284 @@
 </template>
 
 <script lang="ts" setup>
-	import { ref, defineEmits } from "vue";
-	import { Dialog } from "vant";
-	import { useSubjectShowLogic, useTopicMode, useAudioSet } from "./hooks";
-	import { RouterBus } from "@/hooks";
-	const {
-		route: { query },
-		router: { back },
-	} = new RouterBus();
+import { ref, defineEmits, computed } from "vue";
+import { Dialog } from "vant";
+import { useSubjectShowLogic, useTopicMode, useAudioSet } from "./hooks";
+import { RouterBus } from "@/hooks";
+const {
+	route: { query },
+	router: { back },
+} = new RouterBus();
 
-	//父级传参
-	const props = defineProps<{
-		userTestData: {
-			testScores: number;
-			useTime: number;
-		};
-	}>();
-	const emits = defineEmits(["next", "update:userTestData"]);
+const title = computed(() => {
+	return `(${query.cert})/${query.name}/${query.title}/${query.placeIssueName || query.classIssueName || query.excellIssueName || query.sequeIssueName || ""}`;
+});
 
-	const useTime = ref(0);
-	const useTimeChange = (e: any) => {
-		useTime.value = 45 * 60 * 1000 - e.total;
+//父级传参
+const props = defineProps<{
+	userTestData: {
+		testScores: number;
+		useTime: number;
 	};
+}>();
+const emits = defineEmits(["next", "update:userTestData"]);
 
-	//计算分数
-	const scoreCalc = () => {
-		subjectList.value.forEach((item) => {
-			userAnswerChange(item);
-		});
-		emits("update:userTestData", {
-			useTime: useTime.value,
-			testScores: (trueNum.value / subjectTotal.value) * 100,
-		});
-		emits("next");
-	};
+const useTime = ref(0);
+const useTimeChange = (e: any) => {
+	useTime.value = 45 * 60 * 1000 - e.total;
+};
+
+//计算分数
+const scoreCalc = () => {
+	subjectList.value.forEach((item) => {
+		userAnswerChange(item);
+	});
+	emits("update:userTestData", {
+		useTime: useTime.value,
+		testScores: (trueNum.value / subjectTotal.value) * 100,
+	});
+	emits("next");
+};
 
-	const gotoTest = () => {
-		Dialog.confirm({
-			message: "确认交卷吗?",
+const gotoTest = () => {
+	Dialog.confirm({
+		message: "确认交卷吗?",
+	})
+		.then(() => {
+			scoreCalc();
 		})
-			.then(() => {
-				scoreCalc();
-			})
-			.catch(() => {});
-	};
+		.catch(() => {});
+};
 
-	//题目展示逻辑
-	const { currentSubject, currentSubjectIndex, subjectTotal, nextSubject, lastSubject, trueNum, falseNum, isJumpNext, subjectList, userAnswerChange } = useSubjectShowLogic();
+//题目展示逻辑
+const { currentSubject, currentSubjectIndex, subjectTotal, nextSubject, lastSubject, trueNum, falseNum, isJumpNext, subjectList, userAnswerChange } = useSubjectShowLogic();
 
-	//设置操作栏
-	const setShow = ref(false); //显示设置栏
-	const isSoundEffect = ref(true); //答题音效
-	//设置操作栏end
+//设置操作栏
+const setShow = ref(false); //显示设置栏
+const isSoundEffect = ref(true); //答题音效
+//设置操作栏end
 
-	//音频模块
-	const { subjectAudioPlay } = useAudioSet(currentSubject);
-	//音频模块end
+//音频模块
+const { subjectAudioPlay } = useAudioSet(currentSubject);
+//音频模块end
 </script>
 
 <style lang="scss" scoped>
-	.dowm-box {
+.dowm-box {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	padding: 10px;
+	position: sticky;
+	top: 45px;
+	font-size: 30px;
+	background-color: #ffffff;
+}
+.parsing-img {
+	width: 100%;
+	margin-top: 10px;
+}
+.function-list {
+	width: 100%;
+	font-size: 13px;
+	display: flex;
+	justify-content: space-around;
+	flex-wrap: wrap;
+	padding: 15px;
+	box-sizing: border-box;
+	.function-item {
+		margin-bottom: 20px;
+		width: 30%;
 		display: flex;
+		flex-direction: column;
 		align-items: center;
-		justify-content: center;
-		padding: 10px;
-		position: sticky;
-		top: 45px;
-		font-size: 30px;
-		background-color: #ffffff;
-	}
-	.parsing-img {
-		width: 100%;
-		margin-top: 10px;
-	}
-	.function-list {
-		width: 100%;
 		font-size: 13px;
-		display: flex;
-		justify-content: space-around;
-		flex-wrap: wrap;
-		padding: 15px;
-		box-sizing: border-box;
-		.function-item {
-			margin-bottom: 20px;
-			width: 30%;
-			display: flex;
-			flex-direction: column;
-			align-items: center;
-			font-size: 13px;
-			font-weight: 400;
-			color: #8a9099;
-			span {
-				margin-top: 5px;
-			}
-		}
-	}
-	.answerType {
-		width: 100%;
-		font-size: 13px;
-		display: flex;
-		justify-content: space-around;
-		padding: 15px;
-		box-sizing: border-box;
+		font-weight: 400;
+		color: #8a9099;
 		span {
-			border-radius: 20px;
-			padding: 3px 10px;
-			background-color: #b8c0cc;
-			color: #ffffff;
-		}
-		.selected {
-			background-color: #498ef5;
+			margin-top: 5px;
 		}
 	}
-	.divider {
-		width: 100%;
-		height: 10px;
-		background-color: #f2f3f5;
+}
+.answerType {
+	width: 100%;
+	font-size: 13px;
+	display: flex;
+	justify-content: space-around;
+	padding: 15px;
+	box-sizing: border-box;
+	span {
+		border-radius: 20px;
+		padding: 3px 10px;
+		background-color: #b8c0cc;
+		color: #ffffff;
 	}
-	.problem-box {
-		font-size: 17px;
-		padding: 15px;
-		.problem {
-			.type {
-				width: 47px;
-				height: 24px;
-				background: #498ef5;
-				border-radius: 10px 10px 0px 10px;
-				font-size: 11px;
-				padding: 2px 7px;
-				margin-right: 5px;
-			}
-			.text {
-				font-family: PingFang SC;
-				font-weight: 400;
-				color: #0a1a33;
-				letter-spacing: 0.3px;
-			}
-			.img {
-				width: 100%;
-				margin-top: 10px;
-			}
+	.selected {
+		background-color: #498ef5;
+	}
+}
+.divider {
+	width: 100%;
+	height: 10px;
+	background-color: #f2f3f5;
+}
+.problem-box {
+	font-size: 17px;
+	padding: 15px;
+	.problem {
+		.type {
+			width: 47px;
+			height: 24px;
+			background: #498ef5;
+			border-radius: 10px 10px 0px 10px;
+			font-size: 11px;
+			padding: 2px 7px;
+			margin-right: 5px;
 		}
-		.answer {
-			margin-top: 25px;
+		.text {
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #0a1a33;
+			letter-spacing: 0.3px;
 		}
-		.answer-box {
-			display: flex;
-			margin-top: 25px;
-			align-items: center;
-			.iconTrue {
-				background-color: #01c18d;
-			}
-			.answer-text {
-				margin-left: 10px;
-			}
-			.true {
-				color: #01c18d;
-			}
-			.false {
-				color: #ff4d53;
-			}
+		.img {
+			width: 100%;
+			margin-top: 10px;
 		}
-
-		.choose-icon {
-			width: 30px;
-			height: 30px;
-			border-radius: 50%;
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			font-size: 17px;
-			box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.16);
-			box-sizing: border-box;
-			margin-left: 5px;
-			margin-top: 1px;
+	}
+	.answer {
+		margin-top: 25px;
+	}
+	.answer-box {
+		display: flex;
+		margin-top: 25px;
+		align-items: center;
+		.iconTrue {
+			background-color: #01c18d;
 		}
-		.selected {
-			background-color: #498ef5;
+		.answer-text {
+			margin-left: 10px;
 		}
-		.checkbox-btn {
-			width: 266px;
-			height: 40px;
-			margin: auto;
-			margin-top: 25px;
-			left: 50%;
-			transform: translateX(-50%);
+		.true {
+			color: #01c18d;
 		}
-		.checkbox-answer {
-			padding: 8px 10px;
-			background-color: #f2f3f5;
-			margin-top: 25px;
+		.false {
+			color: #ff4d53;
 		}
 	}
-	.skills-box {
+
+	.choose-icon {
+		width: 30px;
+		height: 30px;
+		border-radius: 50%;
 		display: flex;
-		align-items: center;
 		justify-content: center;
-		height: 100%;
-		.skills {
-			width: 290px;
+		align-items: center;
+		font-size: 17px;
+		box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.16);
+		box-sizing: border-box;
+		margin-left: 5px;
+		margin-top: 1px;
+	}
+	.selected {
+		background-color: #498ef5;
+	}
+	.checkbox-btn {
+		width: 266px;
+		height: 40px;
+		margin: auto;
+		margin-top: 25px;
+		left: 50%;
+		transform: translateX(-50%);
+	}
+	.checkbox-answer {
+		padding: 8px 10px;
+		background-color: #f2f3f5;
+		margin-top: 25px;
+	}
+}
+.skills-box {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	height: 100%;
+	.skills {
+		width: 290px;
+		background: #ffffff;
+		box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.16);
+		border-radius: 10px;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		padding: 20px 16px;
+		box-sizing: border-box;
+		.title {
+			font-size: 15px;
+			font-family: PingFang SC;
+			font-weight: bold;
+			line-height: 21px;
+			color: #0a1a33;
+		}
+		.img {
+			width: 258px;
+			height: 129px;
+			border: 1px solid #e8e8e8;
+			margin-top: 16px;
+		}
+		.divider {
+			margin-top: 20px;
+			color: #0a1a33;
 			background: #ffffff;
-			box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.16);
-			border-radius: 10px;
+		}
+		.text {
+			font-size: 13px;
+			font-family: PingFang SC;
+			font-weight: 400;
+			line-height: 19px;
+			color: #5c6066;
+			margin-top: 10px;
+		}
+		.btn {
+			width: 100%;
 			display: flex;
-			flex-direction: column;
-			align-items: center;
-			padding: 20px 16px;
+			justify-content: space-between;
+			padding: 0 40px;
 			box-sizing: border-box;
-			.title {
-				font-size: 15px;
-				font-family: PingFang SC;
-				font-weight: bold;
-				line-height: 21px;
-				color: #0a1a33;
-			}
-			.img {
-				width: 258px;
-				height: 129px;
-				border: 1px solid #e8e8e8;
-				margin-top: 16px;
-			}
-			.divider {
-				margin-top: 20px;
-				color: #0a1a33;
-				background: #ffffff;
-			}
-			.text {
+			margin-top: 20px;
+			span {
+				width: 76px;
+				height: 30px;
+				border-radius: 15px;
 				font-size: 13px;
-				font-family: PingFang SC;
-				font-weight: 400;
-				line-height: 19px;
-				color: #5c6066;
-				margin-top: 10px;
-			}
-			.btn {
-				width: 100%;
 				display: flex;
-				justify-content: space-between;
-				padding: 0 40px;
-				box-sizing: border-box;
-				margin-top: 20px;
-				span {
-					width: 76px;
-					height: 30px;
-					border-radius: 15px;
-					font-size: 13px;
-					display: flex;
-					justify-content: center;
-					align-items: center;
-					&:active {
-						background-color: #afaaaa;
-						filter: brightness(50%);
-					}
-					&:nth-of-type(1) {
-						border: 1px solid #707070;
-						color: #5c6066;
-					}
-					&:nth-of-type(2) {
-						background: #498ef5;
-						border: 1px solid #498ef5;
-						color: #ffffff;
-					}
+				justify-content: center;
+				align-items: center;
+				&:active {
+					background-color: #afaaaa;
+					filter: brightness(50%);
+				}
+				&:nth-of-type(1) {
+					border: 1px solid #707070;
+					color: #5c6066;
+				}
+				&:nth-of-type(2) {
+					background: #498ef5;
+					border: 1px solid #498ef5;
+					color: #ffffff;
 				}
 			}
 		}
 	}
+}
 
-	.submitButton {
-		background-color: #498ef5;
-		position: fixed;
-		left: 50%;
-		transform: translateX(-50%);
-		bottom: 0;
-		width: 80%;
-		color: #ffffff;
-		font-size: 16px;
-	}
+.submitButton {
+	background-color: #498ef5;
+	position: fixed;
+	left: 50%;
+	transform: translateX(-50%);
+	bottom: 0;
+	width: 80%;
+	color: #ffffff;
+	font-size: 16px;
+}
 </style>

+ 21 - 21
src/views/mockTest/index.vue

@@ -1,38 +1,38 @@
 <template>
-  <component
-    :is="currentComponent"
-    @next="next"
-    v-model:userTestData="userTestData"
-  ></component>
+	<component :is="currentComponent" @next="next" v-model:userTestData="userTestData"></component>
 </template>
 
 <script lang="ts" setup>
 import initMockTest from "./components/initMockTest.vue";
 import mockTestEnd from "./components/mockTestEnd.vue";
 import startTest from "./components/startTest.vue";
-
+import { useRouter } from "vue-router";
 import { ref, reactive } from "vue";
-
+const router = useRouter();
+const vehicle = useRouter().currentRoute.value.query.vehicle as string; //路由qvehicle参数
+const subject = useRouter().currentRoute.value.query.subject as string; //路由subject参数
 const userTestData = ref({
-  testScores: 0,
-  useTime: 0,
+	testScores: 0,
+	useTime: 0,
 });
+//清除错题的缓存
+window.localStorage.setItem(vehicle+subject,"[]");
 
 const currentComponent = ref<any>(initMockTest);
 const comIndex = ref(0);
 const next = () => {
-  comIndex.value = (comIndex.value + 1) % 3;
-  switch (comIndex.value) {
-    case 0:
-      currentComponent.value = initMockTest;
-      break;
-    case 1:
-      currentComponent.value = startTest;
-      break;
-    case 2:
-      currentComponent.value = mockTestEnd;
-      break;
-  }
+	comIndex.value = (comIndex.value + 1) % 3;
+	switch (comIndex.value) {
+		case 0:
+			currentComponent.value = initMockTest;
+			break;
+		case 1:
+			currentComponent.value = startTest;
+			break;
+		case 2:
+			currentComponent.value = mockTestEnd;
+			break;
+	}
 };
 </script>
 

+ 15 - 3
src/views/wrongPreviewRes/index.vue

@@ -1,15 +1,22 @@
 <template>
    	<div class="btn-box">
 		<m-button @click="goWrongPreview" class="btn1" text="错题重做" />
-		<m-button @click="againTest" class="btn2" text="放弃错题" />
+		<m-button @click="goHomeTest" class="btn2" text="返回首页" />
 	</div>
 </template>
 
 <script lang="ts" setup>
 import { useRouter } from "vue-router"
-
+import { Toast } from "vant";
 const router = useRouter()
+const vehicle = useRouter().currentRoute.value.query.vehicle as string; //路由qvehicle参数
+const subject = useRouter().currentRoute.value.query.subject as string; //路由subject参数
 const goWrongPreview = ()=>{
+
+	if(window.localStorage.getItem(vehicle+subject)==""||window.localStorage.getItem(vehicle+subject)=="[]"||!window.localStorage.getItem(vehicle+subject)){
+		Toast("没有错题了")
+		return
+	}
     router.push({
         path:"/wrongReview",
         query:router.currentRoute.value.query
@@ -17,7 +24,12 @@ const goWrongPreview = ()=>{
 
 
 }
-const againTest = ()=>{
+const goHomeTest = ()=>{
+	   router.push({
+        path:"/home/test",
+        
+    })
+
 
 }