From 9e4b78882e8ce03b5a236df8ba61efdb2a6bc82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=84=86=E7=9A=AE=E9=B8=AD?= <1003092440@qq.com> Date: Fri, 25 Aug 2023 15:06:46 +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 | 6 +- src/jtools/store/question.js | 95 +++-- src/pages.json | 2 +- src/pages/index/components/Subject1.vue | 16 +- src/pages/index/components/Subject2.vue | 30 +- src/pages/index/index.vue | 24 +- src/pages/questionBank/baseOperate.vue | 4 +- .../questionBank/components/Question.vue | 3 + src/pages/questionBank/examResult.vue | 24 +- src/pages/questionBank/exclusiveExercise.vue | 20 +- src/pages/questionBank/practiceResult.vue | 4 +- src/pages/questionBank/questionBank.vue | 26 +- src/pages/questionBank/videoDetail.vue | 7 +- src/pages/questionBank/wrongQuestion.vue | 361 ++++++++++-------- src/static/image/index/jpsp.png | Bin 0 -> 96772 bytes src/static/image/tabbar/tab-home-selected.png | Bin 1976 -> 2060 bytes src/static/image/tabbar/tab-home.png | Bin 3056 -> 2659 bytes src/static/image/tabbar/tab-mine-selected.png | Bin 1795 -> 4254 bytes src/static/image/tabbar/tab-mine.png | Bin 2305 -> 5994 bytes 19 files changed, 393 insertions(+), 229 deletions(-) create mode 100644 src/static/image/index/jpsp.png diff --git a/src/App.vue b/src/App.vue index 15b6237..b839c5e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,7 +4,11 @@ import useQuestionStore from '@/jtools/store/question' //引入store export default { onLaunch: function () { useUserStore().queryVipList() - useQuestionStore().getOrderQuestion('1') + if(useQuestionStore().curSubject=='1'){ + useQuestionStore().getOrderQuestion_sub1() + }else if(useQuestionStore().curSubject=='4'){ + useQuestionStore().getOrderQuestion_sub4() + } if(useUserStore().isLogin) { useUserStore().getUserInfo() useUserStore().searchUserVip() diff --git a/src/jtools/store/question.js b/src/jtools/store/question.js index ac374c7..fb7bb1b 100644 --- a/src/jtools/store/question.js +++ b/src/jtools/store/question.js @@ -11,39 +11,78 @@ const question = defineStore({ id: 'question', state: () => ({ currentCartype: storage.get('carType') || '1001', - orderQuestion: [], //顺序做题 + orderQuestion_subject1: [], //科目一顺序做题 + orderQuestion_subject4:[],//科目二顺序做题 currentIndex_subject1:0,//科目一索引 顺序做题 currentIndex_subject4:0,//科目四索引 顺序做题 + curSubject:storage.get('curSubject') || '1' }), actions: { - // 获取顺序做题 - getOrderQuestion(val) { - queryQuestion({ - carTypeId: this.currentCartype, - subject: val, - // questionIdList:[10982,10983,10985,10986] - }).then(res => { - if (res.code == '0000') { - this.orderQuestion = res.data - const falseList =storage.get(`wrongList_subject${val}`) || [] - const trueList =storage.get(`rightList_subject${val}`) || [] - const falseArr=[] - const rightArr=[] - this.orderQuestion.forEach(item=>{ - if(falseList.includes(item.questionId)){ - falseArr.push(item.questionId) - } - if(trueList.includes(item.questionId)){ - rightArr.push(item.questionId) - } - }) - console.log('falseArr',falseArr); - storage.set(`wrongList_subject${val}`,falseArr) - storage.set(`rightList_subject${val}`,rightArr) - console.log(storage.get(`wrongList_subject${val}`)); - } - }) + //改变当前科目 + changeSubject(val){ + this.curSubject=val + storage.set('curSubject',val) + }, + // 获取顺序做题科目1 + getOrderQuestion_sub1() { + this.curSubject='1' + storage.set('curSubject','1') + if(!this.orderQuestion_subject1.length){ + queryQuestion({ + carTypeId: this.currentCartype, + subject: '1', + // questionIdList:[10982,10983,10985,10986] + }).then(res => { + if (res.code == '0000') { + this.orderQuestion_subject1 = res.data + const falseList =storage.get('wrongList_subject1') || [] + const trueList =storage.get('rightList_subject1')|| [] + const falseArr=[] + const rightArr=[] + this.orderQuestion_subject1.forEach(item=>{ + if(falseList.includes(item.questionId)){ + falseArr.push(item.questionId) + } + if(trueList.includes(item.questionId)){ + rightArr.push(item.questionId) + } + }) + storage.set('wrongList_subject1',falseArr) + storage.set('rightList_subject1',rightArr) + } + }) + } + }, + // 获取顺序做题科目4 + getOrderQuestion_sub4() { + this.curSubject='4' + storage.set('curSubject','4') + if(!this.orderQuestion_subject4.length){ + queryQuestion({ + carTypeId: this.currentCartype, + subject: '4', + // questionIdList:[10982,10983,10985,10986] + }).then(res => { + if (res.code == '0000') { + this.orderQuestion_subject4 = res.data + const falseList =storage.get('wrongList_subject4') || [] + const trueList =storage.get('rightList_subject4')|| [] + const falseArr=[] + const rightArr=[] + this.orderQuestion_subject4.forEach(item=>{ + if(falseList.includes(item.questionId)){ + falseArr.push(item.questionId) + } + if(trueList.includes(item.questionId)){ + rightArr.push(item.questionId) + } + }) + storage.set('wrongList_subject4',falseArr) + storage.set('rightList_subject4',rightArr) + } + }) + } }, //获取索引 getCurrentIndex(index,val){ diff --git a/src/pages.json b/src/pages.json index efff1f5..39c249a 100644 --- a/src/pages.json +++ b/src/pages.json @@ -100,7 +100,7 @@ { "path": "pages/index/videoVip", "style": { - "navigationBarTitleText": "视频精品课", + "navigationBarTitleText": "开通会员", "enablePullDownRefresh": false } }, diff --git a/src/pages/index/components/Subject1.vue b/src/pages/index/components/Subject1.vue index 56138ce..61975e5 100644 --- a/src/pages/index/components/Subject1.vue +++ b/src/pages/index/components/Subject1.vue @@ -8,7 +8,7 @@ 顺序练习 - {{getDoNum}}/{{orderQuestion.length}} + {{getDoNum}}/{{subject=='1'?orderQuestion_subject1.length:orderQuestion_subject4.length}} @@ -81,7 +81,10 @@ 全部10节课 > - + + + + @@ -120,7 +123,7 @@ }, computed: { - ...mapState(useQuestionStore, ["orderQuestion"]) ,//映射函数,取出tagslist + ...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]) ,//映射函数,取出tagslist getDoNum(){ return this.rightList.length+this.wrongList.length } @@ -249,4 +252,11 @@ background: #00B74F; border-radius: 16rpx; } + .play_btn_2 { + width: 65rpx; + height: 65rpx; + position: absolute; + left: 165.5rpx; + top: 78rpx + } diff --git a/src/pages/index/components/Subject2.vue b/src/pages/index/components/Subject2.vue index 3b69f74..5b034c6 100644 --- a/src/pages/index/components/Subject2.vue +++ b/src/pages/index/components/Subject2.vue @@ -19,19 +19,25 @@ {{item.description}} - + + + + 基础操作讲解 - + 全部 - - + + + + + 上车、下车的方法 上车、下车的方法 @@ -74,7 +80,6 @@ export default { }) }, getVideoList(){ - console.log(this.subject); queryProjectList({ "carTypeId": storage.get('carType') || '1001', "driveType": this.diverTypeList[this.diverTypeIndex].configItemCode, @@ -99,7 +104,6 @@ export default { this.getVideoList() }, checkVideo(val){ - console.log(val); this.projectId=this.operateList[val]?.projectId this.videoIndex=val }, @@ -148,4 +152,18 @@ export default { background: #00B74F; border-radius: 8rpx; } + .play_btn_3{ + width: 65rpx; + height: 65rpx; + position: absolute; + left:117.5rpx; + top: 52rpx + } + .play_btn_2{ + width: 65rpx; + height: 65rpx; + position: absolute; + left: calc((100% - 65rpx)/2); + top: 148.5rpx + } diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index ebab377..75b817e 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -1,14 +1,14 @@