From c3e6002ca3bdaf7c9b519f3d4c25dd4dbdb91845 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=84=86=E7=9A=AE=E9=B8=AD?= <1003092440@qq.com>
Date: Sat, 26 Aug 2023 14:10:16 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 1 +
src/components/j-navbar/j-navbar.vue | 4 +-
src/jtools/api/question.js | 9 ++-
src/pages/index/components/Subject1.vue | 12 ++--
src/pages/index/components/Subject2.vue | 9 +++
src/pages/index/index.vue | 63 +++++++++++--------
.../questionBank/components/Question.vue | 9 ++-
src/pages/questionBank/exclusiveExercise.vue | 31 ++++++---
src/pages/questionBank/questionBank.vue | 2 +
9 files changed, 95 insertions(+), 45 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index b839c5e..44cd0fd 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -27,4 +27,5 @@ export default {
/*每个页面公共css */
@import "uni_modules/uview-plus/index.scss";
@import "static/style/index.scss";
+button::after{ border: none;}
diff --git a/src/components/j-navbar/j-navbar.vue b/src/components/j-navbar/j-navbar.vue
index d025d0e..435cf48 100644
--- a/src/components/j-navbar/j-navbar.vue
+++ b/src/components/j-navbar/j-navbar.vue
@@ -140,8 +140,8 @@ export default {
.cu-bar {
width: 100%;
.content {
- // width: 350rpx;
- display: flex;
+ width: 350rpx;
+ // display: flex;
flex-direction: row;
flex: 1;
align-items: center;
diff --git a/src/jtools/api/question.js b/src/jtools/api/question.js
index e41c896..f879c9f 100644
--- a/src/jtools/api/question.js
+++ b/src/jtools/api/question.js
@@ -13,7 +13,8 @@ export function questionCategory(data) {
return request({
url: 'driver-api/tdQuestion/questionCategory',
method: 'POST',
- data
+ data,
+ noToken: true
});
}
@@ -45,7 +46,8 @@ export function testTotal(data) {
export function querySysConfigList(carTypeId, configKey) {
return request({
url: 'driver-api/tdSysConfigList/querySysConfigList?configKey=' + configKey + '&carTypeId=' + carTypeId,
- method: 'GET'
+ method: 'GET',
+ noToken: true
});
}
@@ -54,6 +56,7 @@ export function queryProjectList(data) {
return request({
url: 'driver-api/tdTestProject/queryProjectList',
method: 'POST',
- data
+ data,
+ noToken:true
});
}
diff --git a/src/pages/index/components/Subject1.vue b/src/pages/index/components/Subject1.vue
index 61975e5..f05c71b 100644
--- a/src/pages/index/components/Subject1.vue
+++ b/src/pages/index/components/Subject1.vue
@@ -4,9 +4,10 @@
-
+
+
-
+
顺序练习
{{getDoNum}}/{{subject=='1'?orderQuestion_subject1.length:orderQuestion_subject4.length}}
@@ -14,9 +15,10 @@
-
+
+
-
+
模拟考试
去考试
@@ -174,7 +176,7 @@
},
toExclusive(){
uni.navigateTo({
- url:"/pages/questionBank/exclusiveExercise"
+ url:"/pages/questionBank/exclusiveExercise?subject="+this.subject
})
},
toWrongList(){
diff --git a/src/pages/index/components/Subject2.vue b/src/pages/index/components/Subject2.vue
index 5b034c6..779d9c5 100644
--- a/src/pages/index/components/Subject2.vue
+++ b/src/pages/index/components/Subject2.vue
@@ -74,6 +74,15 @@ export default {
await this.getDiverType()
},
methods:{
+ getOperateList(){
+ queryProjectList({
+ "carTypeId": storage.get('carType') || '1001',
+ "subject": String(this.subject),
+ "type": "2"
+ }).then(resp=>{
+ console.log(resp);
+ })
+ },
toVideo(){
uni.navigateTo({
url:"/pages/questionBank/videoDetail?driveType="+this.diverTypeList[this.diverTypeIndex].configItemCode+"&subject="+this.subject+"&projectId="+this.projectId+"&type=1"
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 75b817e..764c2e0 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -4,11 +4,11 @@
-
-
+
+
-
+
@@ -17,53 +17,66 @@
import { mapState,mapActions } from 'pinia' //引入映射函数
import useQuestionStore from '@/jtools/store/question' //引入store
import storage from '@/jtools/storage';
+ import {
+ querySysConfigList,
+ } from '@/jtools/api/question';
import Subject1 from "./components/Subject1";
import Subject2 from "./components/Subject2";
export default {
components: {Subject1,Subject2},
data() {
return {
+ subject:storage.get('curSubject') || '1',
curTab:Number(storage.get('curSubject'))-1,
- tIndex:Number(storage.get('curSubject'))-1,
searchValue:'',
cityName:'',
- categoryList:[{
- name:'科目1'
- },{
- name:'科目2'
- },{
- name:'科目3'
- },{
- name:'科目4'
- }],
- rightList:storage.get(`rightList_subject${this.tIndex+1}`) || [],
- wrongList:storage.get(`wrongList_subject${this.tIndex+1}`) || [],
+ categoryList:[],
+ rightList:storage.get(`rightList_subject${this.subject}`) || [],
+ wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
};
},
+ onLoad(){
+ this.getSubjectConfig()
+ },
onShow() {
- if(this.tIndex==0||this.tIndex==3){
- this.rightList=storage.get(`rightList_subject${this.tIndex+1}`) || []
- this.wrongList=storage.get(`wrongList_subject${this.tIndex+1}`) || []
+ if(this.subject=='1'||this.subject=='4'){
+ this.rightList=storage.get(`rightList_subject${this.subject}`) || []
+ this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
}
},
methods:{
...mapActions(useQuestionStore,['getOrderQuestion_sub4','getOrderQuestion_sub1','changeSubject']),
+ //获取科目配置
+ getSubjectConfig(){
+ const carTypeId=storage.get('carType') || '1001'
+ querySysConfigList(carTypeId,'Subject').then(resp=>{
+ if(resp.code==='0000'){
+ this.categoryList=resp.data.map(item=>{
+ return{
+ ...item,
+ name:item.configItemName
+ }
+ })
+ }
+ })
+ },
//切换科目
async changeCategory(val){
- this.tIndex=val.index
- if(this.tIndex==0){
+ this.subject=val.configItemCode
+ console.log();
+ if(this.subject=='1'){
await this.getOrderQuestion_sub1()
- }else if(this.tIndex==3){
+ }else if(this.subject=='4'){
await this.getOrderQuestion_sub4()
}else{
- this.changeSubject(val.index+1)
+ this.changeSubject(this.subject)
setTimeout(()=>{
this.$refs.subjectRef.getDiverType()
},100)
}
- if(this.tIndex==0||this.tIndex==3){
- this.rightList=storage.get(`rightList_subject${this.tIndex+1}`) || []
- this.wrongList=storage.get(`wrongList_subject${this.tIndex+1}`) || []
+ if(this.subject=='1'||this.subject=='4'){
+ this.rightList=storage.get(`rightList_subject${this.subject}`) || []
+ this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
}
},
}
diff --git a/src/pages/questionBank/components/Question.vue b/src/pages/questionBank/components/Question.vue
index 57a7736..0093f28 100644
--- a/src/pages/questionBank/components/Question.vue
+++ b/src/pages/questionBank/components/Question.vue
@@ -11,7 +11,7 @@
{{getQuestType(quesItem.type)}}
- {{quesItem.question}}
+ {{quesItem.question}}
@@ -35,7 +35,7 @@
+ v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer) || showBestAnswer">
答案:{{getRightOp(quesItem.trueAnswer)}}
{{quesItem.bestAnswer}}
@@ -263,6 +263,7 @@ export default {
},
data() {
return {
+ showBestAnswer:false,
nowPrice:68,
showVip:false,
popupShow:false,
@@ -304,6 +305,9 @@ export default {
},
methods: {
...mapActions(useQuestionStore,['getCurrentIndex']),
+ isShowBest(val){
+ this.showBestAnswer=val
+ },
duoxuan(val){
if(val&&val.length>1){
this.questionList[this.topicIndex].isChoose=true
@@ -694,6 +698,7 @@ export default {
}
.tag_box {
+ vertical-align: middle;
display: inline-block;
width: 78rpx;
height: 42rpx;
diff --git a/src/pages/questionBank/exclusiveExercise.vue b/src/pages/questionBank/exclusiveExercise.vue
index 6d84b11..6915fdc 100644
--- a/src/pages/questionBank/exclusiveExercise.vue
+++ b/src/pages/questionBank/exclusiveExercise.vue
@@ -21,7 +21,7 @@
-
+
{{listItem.title}}
{{listItem.subTitle}}
@@ -30,10 +30,10 @@
常见考点
-
-
+
+
{{index+1}}
- {{item.configItemName}}
+ {{item.configItemName}}
@@ -85,16 +85,21 @@
isError:0,
image:neverWriteIcon
}],
- testCenterList:[]
+ testCenterList:[],
+ subject:'1'
}
},
- onLoad(){
+ onLoad(op){
+ if(op.subject){
+ this.subject=op.subject
+ }
this.getExamPoint()
},
methods: {
getExamPoint(){
const carTypeId=storage.get('carType') || '1001'
- querySysConfigList(carTypeId,'ExamKeys').then(resp=>{
+ const examKey = this.subject=='1'?'ExamKeysOfSubjectOne':'ExamKeysOfSubjectFour'
+ querySysConfigList(carTypeId,examKey).then(resp=>{
if(resp.code==='0000'){
this.testCenterList=resp.data
}
@@ -128,10 +133,20 @@
.dot_item{
width: 40rpx;
height: 40rpx;
- line-height: 40rpx;
+ line-height: 41rpx;
color: #fff;
text-align: center;
background: #0BD032;
border-radius: 50%;
}
+.topic_cont_text{
+ height:45rpx;
+ overflow: hidden;
+ word-break: break-all; /* break-all(允许在单词内换行。) */
+ text-overflow: ellipsis; /* 超出部分省略号 */
+ display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
+ -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
+ -webkit-line-clamp:1; /** 显示的行数 **/
+
+ }
diff --git a/src/pages/questionBank/questionBank.vue b/src/pages/questionBank/questionBank.vue
index 7d3b8fc..8381f1e 100644
--- a/src/pages/questionBank/questionBank.vue
+++ b/src/pages/questionBank/questionBank.vue
@@ -116,8 +116,10 @@
clickAnswer: item.trueAnswer
}
})
+ this.$refs.question.isShowBest(true)
this.$refs.question.getQuestionList(JSON.stringify(list))
} else {
+ this.$refs.question.isShowBest(false)
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
}
},
--
2.38.1.windows.1