瀏覽代碼

新增题库分类的接口,分类去题目逻辑修改中1

JXDS18FUJT 1 年之前
父節點
當前提交
af8c82d398

+ 13 - 1
src/api/modules/openApi.ts

@@ -12,11 +12,23 @@ class Wx {
 
 		});
 	}
+	//取模拟考试题库-无分页-旧接口
+	// selectTestK14QuestionInfoListnN(params:{
+	// 	subject?:number
+	// }):AxiosPromise<any>{
+	// 	return request({
+	// 		url: "/open-api/question/info/selectTestK14QuestionInfoListnN",
+	// 		params,
+	// 		method:'GET'
+
+	// 	});
+	// },
+	//取模拟考试题库-无分页-新接口
 	selectTestK14QuestionInfoListnN(params:{
 		subject?:number
 	}):AxiosPromise<any>{
 		return request({
-			url: "/open-api/question/info/selectTestK14QuestionInfoListnN",
+			url: "/open-api/question2/info/selectTestK14QuestionInfoListnN",
 			params,
 			method:'GET'
 

+ 23 - 5
src/api/modules/test.ts

@@ -4,28 +4,38 @@ import { AxiosPromise } from "axios";
 class Test {
 	/** 获取题目列表 */
 	getList(params: Test.listParams): AxiosPromise<Test.listRes> {
-		return request("/student/question/info/list", {
+		return request("/student/question2/info/list", {
 			params,
 		});
 	}
 
 	/**获取免费题列表 */
 	getFreeList(params: Test.listParams): AxiosPromise<Test.listRes> {
-		return request("/student/question/info/selectFreeQuestionInfo", {
+		return request("/student/question2/info/selectFreeQuestionInfo", {
 			params,
 		});
 	}
 
 	/**获取模拟考试题列表 */
 	getMockList(params: Test.listParams): AxiosPromise<Test.listRes> {
-		return request("/open-api/question/info/selectTestK14QuestionInfoList", {
+		return request("/open-api/question2/info/selectTestK14QuestionInfoList", {
 			params,
 		});
 	}
 
-	/** 根据ids批量获取问题详情  */
+	// /** 根据ids批量获取问题详情(旧)  */
+	// getQuestionInfoByIds(params: Test.QuestionInfoByIdsParams): AxiosPromise<Test.QuestionInfoByIdsRes> {
+	// 	return request("/student/question/info/getQuestionInfoByIds", {
+	// 		params: {
+	// 			...params,
+	// 			ids: params.ids.toString(),
+	// 		},
+	// 	});
+	// }
+
+	/** 根据ids批量获取问题详情(新)  */
 	getQuestionInfoByIds(params: Test.QuestionInfoByIdsParams): AxiosPromise<Test.QuestionInfoByIdsRes> {
-		return request("/student/question/info/getQuestionInfoByIds", {
+		return request("/student/question2/info/getQuestionInfoByIds", {
 			params: {
 				...params,
 				ids: params.ids.toString(),
@@ -90,3 +100,11 @@ export const getQuestionInfoByIds = async (params: Test.QuestionInfoByIdsParams)
 	});
 	return <Test.QuestionInfoByIdsRes>res.data;
 };
+//获取题库分类
+export const getQuestionColumn = (params:Test.getQuestionColumn): AxiosPromise<Test.getQuestionColumnRes[]>=>{
+	return request({
+		url:"/student/question2/info/getQuestionColumn",
+		params,
+		method:'GET'
+	})
+}

+ 1 - 1
src/api/request.ts

@@ -3,7 +3,7 @@ import { requestLogger, responseLogger } from "axios-logger";
 import store from "@/store";
 import { Toast } from "vant";
 const request = axios.create({
-	baseURL: import.meta.env.MODE === "production" ? "https://jpcj.zzxcx.net/prod-api/" : "http://192.168.8.63:8080/",
+	baseURL: import.meta.env.MODE === "production" ? "https://jpcj.zzxcx.net/prod-api/" : "https://jpcj1.zzxcx.net/jpcj-admin/",
 });
 
 request.interceptors.request.use((config) => {

+ 18 - 4
src/api/types/test.d.ts

@@ -3,7 +3,7 @@ declare namespace Test {
 		isCollection: boolean;
 		optsBack: any;
 		userAnswer(userAnswer: any): unknown;
-		isTrue?: null|Boolean;
+		isTrue?: null | Boolean;
 		answer: string;
 		answerkeyword: string;
 		answermp3: string;
@@ -28,7 +28,7 @@ declare namespace Test {
 		liceTruck: string;
 		mockIssue: string;
 		number: number;
-		opts: string|[string];
+		opts: string | [string];
 		placeIssue: string;
 		placeIssueName: string;
 		questionType: number;
@@ -49,6 +49,12 @@ declare namespace Test {
 	interface QuestionInfoByIdsParams extends Common.Paging {
 		ids: number[];
 	}
+	interface getQuestionColumn extends Common.Paging {
+		model: string
+		sort?: number
+		subject: string | number
+
+	}
 
 	interface QuestionInfoByIdsRes extends Common.Res {
 		rows: QuestionInfo[];
@@ -56,7 +62,7 @@ declare namespace Test {
 	}
 
 	interface getTopicClassParams {
-		
+
 
 		liceBus: string;
 		liceCar: string;
@@ -77,7 +83,15 @@ declare namespace Test {
 		classIssue: string;
 		classIssueName: string;
 	}
-
+	interface getQuestionColumnRes {
+		"createTime": string,
+		"id": number,
+		"columnId": number,
+		"sort": number,
+		"model": string,
+		"subject": string,
+		"title": string
+	}
 	interface selectJxQustionInfoRes {
 		excellIssue: string;
 		excellIssueName: string;

+ 10 - 14
src/views/classify/index.vue

@@ -3,7 +3,7 @@
 	<div class="cell-box">
 		<van-cell
 			class="cell"
-			:title="item.placeIssueName || item.classIssueName || item.excellIssueName || item.sequeIssueName"
+			:title="item.title"
 			is-link
 			center
 			v-for="(item, index) in classData"
@@ -15,14 +15,7 @@
 						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,
+							columnAll:item.columnId
 						},
 					});
 				}
@@ -38,7 +31,7 @@
 </template>
 
 <script setup lang="ts">
-import { getTopicClass } from "@/api";
+import { getQuestionColumn, getTopicClass } from "@/api";
 import { ref } from "vue";
 import { RouterBus } from "@/hooks";
 const {
@@ -47,11 +40,14 @@ const {
 } = new RouterBus();
 const classData = ref([]);
 const classifyTip = query.title === "地方专题" ? ref(["地方题库,如有个别地区增加【地方题库】,请选择该区域的【地方题库】+【必学题】学习,如果没有无需学习地方题库"]) : ref(["分类练习,学员可重点学习自己不懂的题目.", "建议新学员直接看软件必考题技巧,快速学习"]);
-getTopicClass(query.path as string, query).then(({ data }) => {
+getQuestionColumn({
+	model:query['model'] as string,
+	subject:query.subject=='1'?'k1_3':'k4_3'
+}).then(({ data }) => {
 	//地方专题第一个选项去掉
-	if (query.title == "地方专题") {
-		data.data?.shift();
-	}
+	// if (query.title == "地方专题") {
+	// 	data.data?.shift();
+	// }
 
 	classData.value = data.data;
 });

+ 87 - 0
src/views/classifyArea/index.vue

@@ -0,0 +1,87 @@
+<template>
+	<m-nav-bar :title="query.title" />
+	<div class="cell-box">
+		<van-cell
+			class="cell"
+			:title="item.title"
+			is-link
+			center
+			v-for="(item, index) in classData"
+			:key="index"
+			:border="false"
+			@click="
+				() => {
+					push({
+						name: 'exercise',
+						query: {
+							...query,
+							chapterId: item.columnId,
+						
+						},
+					});
+				}
+			">
+			<template #icon>
+				<div class="icon">{{ index + 1 }}</div>
+			</template>
+		</van-cell>
+		<view class="classify-tip">
+			<m-classify-tip :content="classifyTip"></m-classify-tip>
+		</view>
+	</div>
+</template>
+
+<script setup lang="ts">
+import { getQuestionColumn, getTopicClass } from "@/api";
+import { ref } from "vue";
+import { RouterBus } from "@/hooks";
+const {
+	route: { query },
+	router: { push },
+} = new RouterBus();
+const classData = ref([]);
+const classifyTip = query.title === "地方专题" ? ref(["地方题库,如有个别地区增加【地方题库】,请选择该区域的【地方题库】+【必学题】学习,如果没有无需学习地方题库"]) : ref(["分类练习,学员可重点学习自己不懂的题目.", "建议新学员直接看软件必考题技巧,快速学习"]);
+getQuestionColumn({
+	model:query['model'] as string,
+	subject:query.subject=='1'?'k1_4':'k4_4'
+}).then(({ data }) => {
+	//地方专题第一个选项去掉
+	// if (query.title == "地方专题") {
+	// 	data.data?.shift();
+	// }
+
+	classData.value = data.data;
+});
+</script>
+
+<style lang="scss" scoped>
+.classify-tip {
+	width: 375px;
+	margin-top: 20px;
+}
+.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;
+	}
+}
+</style>

+ 20 - 27
src/views/classifyChoose/index.vue

@@ -4,7 +4,7 @@
 		<div class="cell-box" style="padding-right: 0px">
 			<van-cell
 				class="cell"
-				:title="item.excellIssueName || item.placeIssueName || item.classIssueName || item.sequeIssueName"
+				:title="item.title"
 				is-link
 				center
 				v-for="(item, index) in classDataLeft"
@@ -16,14 +16,7 @@
 							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,
+								chapterId:item.columnId
 							},
 						});
 					}
@@ -95,7 +88,7 @@
 </template>
 
 <script setup lang="ts">
-import { getTopicClass } from "@/api";
+import { getQuestionColumn, getTopicClass } from "@/api";
 import { ref, reactive } from "vue";
 import { RouterBus } from "@/hooks";
 const {
@@ -106,27 +99,27 @@ const classDataLeft = ref([]);
 const classDataRight = ref([]);
 const classData = ref([]);
 const classifyTip = ref(["软件题库已同步更新至车管所最新,左边的红色必学题,每套题必须学完.", "模拟考试能连续5次以上达到96分左右,即可参加考试", "如果模拟考试达不到要求,请把右边的选学题也学习一遍"]);
-getTopicClass(query.path as string, {
-	...query,
-	excellIssueName: "必",
+getQuestionColumn({
+	model:query['model'] as string,
+	subject:query.subject=='1'?'k1_2':'k4_2'
 }).then(({ data }) => {
 	// res.data.data.shift();
 	console.log(data);
 	classDataLeft.value = data.data;
-	getTopicClass(query.path as string, {
-		...query,
-		excellIssueName: "新",
-	}).then(({ data }) => {
-		// data.data.shift();
-		classDataLeft.value = [...classDataLeft.value, ...data.data];
-	});
-	getTopicClass(query.path as string, {
-		...query,
-		excellIssueName: "地方",
-	}).then(({ data }) => {
-		// data.data.shift();
-		classDataLeft.value = [...classDataLeft.value, ...data.data];
-	});
+	// getTopicClass(query.path as string, {
+	// 	...query,
+	// 	excellIssueName: "新",
+	// }).then(({ data }) => {
+	// 	// data.data.shift();
+	// 	classDataLeft.value = [...classDataLeft.value, ...data.data];
+	// });
+	// getTopicClass(query.path as string, {
+	// 	...query,
+	// 	excellIssueName: "地方",
+	// }).then(({ data }) => {
+	// 	// data.data.shift();
+	// 	classDataLeft.value = [...classDataLeft.value, ...data.data];
+	// });
 	// getTopicClass(query.path as string, {
 	// 	...query,
 	// 	excellIssueName: "新",

+ 17 - 27
src/views/classifyOrder/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<m-nav-bar :title="query.title" />
 	<div class="cell-box">
-		<van-cell class="cell" :title="item.placeIssueName || item.classIssueName || item.excellIssueName || item.sequeIssueName" center v-for="(item, index) in classData" :key="index" :border="false">
+		<van-cell class="cell" :title="item.title" center v-for="(item, index) in classData" :key="index" :border="false">
 			<div class="select">
 				<div
 					class="select-item0"
@@ -11,14 +11,7 @@
 								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,
+									columnAll:item.columnId
 								},
 							});
 						}
@@ -32,14 +25,7 @@
 								name: 'exerciseStrict',
 								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,
+									columnAll:item.columnId
 								},
 							});
 						}
@@ -57,7 +43,7 @@
 </template>
 
 <script setup lang="ts">
-import { getTopicClass } from "@/api";
+import { getQuestionColumn, getTopicClass } from "@/api";
 import { ref } from "vue";
 import { RouterBus } from "@/hooks";
 const {
@@ -65,17 +51,21 @@ const {
 	router: { push },
 } = new RouterBus();
 const classData = ref();
-getTopicClass(query.path as string, query).then(({ data }) => {
-	switch (query.title) {
-		case "顺序练习":
-			if ((query.vehicle == "摩托车")) {
+getQuestionColumn({
+	model:query['model'] as string,
+	subject:query.subject=='1'?'k1':'k4'
+	
+}).then(({ data }) => {
+	// switch (query.title) {
+	// 	case "顺序练习":
+	// 		if ((query.vehicle == "摩托车")) {
 			
-			} else {
-				data.data?.shift();
-			}
+	// 		} else {
+	// 			data.data?.shift();
+	// 		}
 
-			break;
-	}
+	// 		break;
+	// }
 	classData.value = data.data;
 });
 </script>

+ 1 - 1
src/views/home/children/test/components/sujectOne.vue

@@ -130,7 +130,7 @@ const testList = [
 				icon: "地方专题",
 				name: "地方专题",
 				route: {
-					name: "classify",
+					name: "classifyArea",
 					query: {
 						...props.query,
 						path: "selectDfQuestionInfo",

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

@@ -87,7 +87,7 @@ const carTypeList = ref([
 		name: "轿车",
 		cert: "C1/C2/C3",
 		icon: "jiaoche",
-		query: { gs:'xc',liceCar:1 },
+		query: { model:"cart",liceCar:1 },
 		sujectList: [
 			{
 				name: "科目一",
@@ -96,7 +96,7 @@ const carTypeList = ref([
 					cert: "C1/C2/C3",
 					vehicle: "小车",
 					subject: 1,
-					gs:"xc"
+					model:"cart"
 				},
 			},
 			{
@@ -106,7 +106,7 @@ const carTypeList = ref([
 					cert: "C1/C2/C3",
 					vehicle: "小车",
 					subject: 2,
-					gs:"xc"
+					model:"cart"
 				},
 			},
 			{
@@ -116,7 +116,7 @@ const carTypeList = ref([
 					cert: "C1/C2/C3",
 					vehicle: "小车",
 					subject: 3,
-					gs:"xc"
+					model:"cart"
 				},
 			},
 			{
@@ -126,7 +126,7 @@ const carTypeList = ref([
 					cert: "C1/C2/C3",
 					vehicle: "小车",
 					subject: 4,
-					gs:"xc"
+					model:"cart"
 				},
 			},
 		],
@@ -135,7 +135,7 @@ const carTypeList = ref([
 		name: "客车",
 		cert: "A1/A3/B1",
 		icon: "keche",
-		query: { liceBus: 1,gs:'kc' },
+		query: { liceBus: 1,model:"bus" },
 		sujectList: [
 			{
 				name: "科目一",
@@ -144,7 +144,7 @@ const carTypeList = ref([
 					cert: "A1/A3/B1",
 					vehicle: "客车",
 					subject: 1,
-					gs:"kc"
+					model:"bus"
 				},
 			},
 			{
@@ -154,7 +154,7 @@ const carTypeList = ref([
 					cert: "A1/A3/B1",
 					vehicle: "客车",
 					subject: 1,
-					gs:"kc"
+					model:"bus"
 				},
 			},
 			{
@@ -164,7 +164,7 @@ const carTypeList = ref([
 					cert: "A1/A3/B1",
 					vehicle: "客车",
 					subject: 4,
-					gs:"kc"
+					model:"bus"
 				},
 			},
 			{
@@ -174,7 +174,7 @@ const carTypeList = ref([
 					cert: "A1/A3/B1",
 					vehicle: "客车",
 					subject: 4,
-					gs:"kc"
+					model:"bus"
 				},
 			},
 		],
@@ -183,7 +183,7 @@ const carTypeList = ref([
 		name: "货车",
 		cert: "A2/B2",
 		icon: "huoche",
-		query: { liceTruck: 1,gs:'hc' },
+		query: { liceTruck: 1,model:"truck" },
 		sujectList: [
 			{
 				name: "科目一",
@@ -192,7 +192,7 @@ const carTypeList = ref([
 					cert: "A2/B2",
 					vehicle: "货车",
 					subject: 1,
-					gs:"hc"
+					model:"truck"
 				},
 			},
 			{
@@ -202,7 +202,7 @@ const carTypeList = ref([
 					cert: "A2/B2",
 					vehicle: "货车",
 					subject: 2,
-					gs:"hc"
+					model:"truck"
 				},
 			},
 			{
@@ -212,7 +212,7 @@ const carTypeList = ref([
 					cert: "A2/B2",
 					vehicle: "货车",
 					subject: 3,
-					gs:"hc"
+					model:"truck"
 				},
 			},
 			{
@@ -222,7 +222,7 @@ const carTypeList = ref([
 					cert: "A2/B2",
 					vehicle: "货车",
 					subject: 4,
-					gs:"hc"
+					model:"truck"
 				},
 			},
 		],
@@ -231,7 +231,7 @@ const carTypeList = ref([
 		name: "摩托车",
 		cert: "D/E/F",
 		icon: "motuoche",
-		query: { liceMoto: 1,gs:'mtc' },
+		query: { liceMoto: 1,model:"mtc" },
 		sujectList: [
 			{
 				name: "科目一",
@@ -240,7 +240,7 @@ const carTypeList = ref([
 					cert: "D/E/F",
 					vehicle: "摩托车",
 					subject: 1,
-					gs:"mtc"
+					model:"mtc"
 				},
 			},
 			{
@@ -250,7 +250,7 @@ const carTypeList = ref([
 					cert: "D/E/F",
 					vehicle: "摩托车",
 					subject: 2,
-					gs:"mtc"
+					model:"mtc"
 				},
 			},
 			{
@@ -260,7 +260,7 @@ const carTypeList = ref([
 					cert: "D/E/F",
 					vehicle: "摩托车",
 					subject: 3,
-					gs:"mtc"
+					model:"mtc"
 				},
 			},
 			{
@@ -270,7 +270,7 @@ const carTypeList = ref([
 					cert: "D/E/F",
 					vehicle: "摩托车",
 					subject: 4,
-					gs:"mtc"
+					model:"mtc"
 				},
 			},
 		],