diff --git a/.env.development b/.env.development index 5968371..5b6f2bd 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VITE_APP_TITLE = 金武联驾校 VITE_APP_ENV = 'development' # 金武联驾校/开发环境 -VITE_APP_BASE_API = 'http://192.168.1.2:8888/' +VITE_APP_BASE_API = 'http://118.31.23.45:8888/' # -VITE_WEB_BASE_URL = 'http://192.168.1.2:8888/' +VITE_WEB_BASE_URL = 'http://118.31.23.45:8888/' diff --git a/src/components/j-navbar/j-navbar.vue b/src/components/j-navbar/j-navbar.vue index c78a8f5..67923cd 100644 --- a/src/components/j-navbar/j-navbar.vue +++ b/src/components/j-navbar/j-navbar.vue @@ -109,14 +109,24 @@ export default { backPath: { type: String, default: '' + }, + isDefineBack:{ + type:Boolean, + default:false } }, methods: { goBack() { - if(this.backPath) { - this.$tools.routerTo(this.backPath) - } else { - uni.navigateBack(); + if(this.isDefineBack){ + this.$emit('toBack') + }else{ + if(this.backPath) { + uni.switchTab({ + url:this.backPath + }) + } else { + uni.navigateBack(); + } } } } diff --git a/src/jtools/api/question.js b/src/jtools/api/question.js index e41a574..2f44de5 100644 --- a/src/jtools/api/question.js +++ b/src/jtools/api/question.js @@ -7,4 +7,28 @@ export function queryQuestion(data) { method: 'POST', data, }); +} + +export function questionCategory(data) { + return request({ + url: 'driver-api/tdQuestion/questionCategory', + method: 'POST', + data, + }); +} + +export function getTestQuestion(data) { + return request({ + url: 'driver-api/tdQuestion/getTestQuestion', + method: 'POST', + data, + }); +} + +export function submitTest(data) { + return request({ + url: 'driver-api/tdQuestionTest/testSubmit', + method: 'POST', + data, + }); } \ No newline at end of file diff --git a/src/jtools/store/question.js b/src/jtools/store/question.js index 1018b56..20ffec6 100644 --- a/src/jtools/store/question.js +++ b/src/jtools/store/question.js @@ -12,6 +12,8 @@ const question = defineStore({ state: () => ({ currentCartype: storage.get('carType') || '1001', orderQuestion: [], //顺序做题 + currentIndex_subject1:0,//科目一索引 顺序做题 + currentIndex_subject4:0,//科目四索引 顺序做题 }), actions: { @@ -26,6 +28,10 @@ const question = defineStore({ } }) }, + //获取索引 + getCurrentIndex(index,val){ + this[`currentIndex_subject${val}`]=index + } } }); diff --git a/src/pages/index/components/Subject1.vue b/src/pages/index/components/Subject1.vue index 01f0f2d..74a2ca0 100644 --- a/src/pages/index/components/Subject1.vue +++ b/src/pages/index/components/Subject1.vue @@ -77,7 +77,7 @@ - 科{{type==1?'一':'四'}}精品视频课 + 科{{subject==1?'一':'四'}}精品视频课 全部10节课 > @@ -86,7 +86,7 @@ - 科{{type==1?'一':'四'}}易错试题 + 科{{subject==1?'一':'四'}}易错试题 @@ -101,14 +101,14 @@ import useQuestionStore from '@/jtools/store/question' //引入store export default { props:{ - type:{ + subject:{ type:[String,Number], } }, data() { return { - rightList:storage.get('rightList'), - wrongList:storage.get('wrongList'), + rightList:storage.get(`rightList_subject${this.subject}`) || [], + wrongList:storage.get(`wrongList_subject${this.subject}`) || [], allQuestionNum:0, } }, @@ -136,12 +136,12 @@ }, toAnswer(title) { uni.navigateTo({ - url:"/pages/questionBank/questionBank?navTitle="+title + url:"/pages/questionBank/questionBank?navTitle="+title+"&subject="+this.subject }) }, toExams(){ uni.navigateTo({ - url:"/pages/questionBank/practiceExams" + url:"/pages/questionBank/practiceExams?subject="+this.subject }) }, toExclusive(){ @@ -151,7 +151,7 @@ }, toWrongList(){ uni.navigateTo({ - url:"/pages/questionBank/wrongQuestion" + url:"/pages/questionBank/wrongQuestion?subject="+this.subject }) } } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 40eaa94..6dafd6a 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -5,7 +5,7 @@ @@ -118,6 +146,7 @@ width: 349rpx; height: 76rpx; background: #DEEFE5; + border:none; border-radius: 38rpx; line-height: 76rpx; text-align: center; diff --git a/src/pages/questionBank/practiceExams.vue b/src/pages/questionBank/practiceExams.vue index 76a1afb..9c2f2e1 100644 --- a/src/pages/questionBank/practiceExams.vue +++ b/src/pages/questionBank/practiceExams.vue @@ -2,17 +2,16 @@ - 模拟考试 - + 模拟考试 +