From 135bcc71eede3c05ba489037ce84c2c30b4f36e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=84=86=E7=9A=AE=E9=B8=AD?= <1003092440@qq.com> Date: Wed, 30 Aug 2023 23:15:41 +0800 Subject: [PATCH 1/3] =?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/pages.json | 10 +- src/pages/index/components/Subject1.vue | 33 ++- src/pages/index/components/Subject2.vue | 71 ++++-- src/pages/index/videoVip.vue | 6 +- src/pages/me/info.vue | 10 +- src/pages/me/uploadPic.vue | 217 ++++++++++++++++++ src/pages/me/vip.vue | 22 +- src/pages/questionBank/baseOperate.vue | 23 +- .../questionBank/components/Question.vue | 10 +- src/pages/questionBank/exclusiveExercise.vue | 21 +- src/static/image/index/danxuan.png | Bin 0 -> 3735 bytes src/static/image/index/panduan.png | Bin 0 -> 3615 bytes src/static/image/index/tupian.png | Bin 0 -> 3944 bytes 13 files changed, 368 insertions(+), 55 deletions(-) create mode 100644 src/pages/me/uploadPic.vue create mode 100644 src/static/image/index/danxuan.png create mode 100644 src/static/image/index/panduan.png create mode 100644 src/static/image/index/tupian.png diff --git a/src/pages.json b/src/pages.json index 417cfb7..447ce32 100644 --- a/src/pages.json +++ b/src/pages.json @@ -144,8 +144,14 @@ "navigationBarTitleText": "真实考场模拟", "enablePullDownRefresh": false } - - } + }, + { + "path": "pages/me/uploadPic", + "style": { + "navigationBarTitleText": "上传证件照", + "enablePullDownRefresh": false + } + } ], "globalStyle": { diff --git a/src/pages/index/components/Subject1.vue b/src/pages/index/components/Subject1.vue index d3f2976..aeccebc 100644 --- a/src/pages/index/components/Subject1.vue +++ b/src/pages/index/components/Subject1.vue @@ -1,7 +1,7 @@ diff --git a/src/pages/me/tijian.vue b/src/pages/me/tijian.vue index 2bfe482..bcbeb2f 100644 --- a/src/pages/me/tijian.vue +++ b/src/pages/me/tijian.vue @@ -1,42 +1,222 @@ + .upload-img { + width: 165rpx; + height: 165rpx; + border: 1px dashed #c4c4c4; + display: flex; + justify-content: center; + align-items: center; + } + + .fontColor { + color: #383838; + font-weight: 400; + } + + ::v-deep .u-textarea__count { + background-color: #f9faf9 !important; + } + + ::v-deep .u-upload__button>.u-icon>.u-icon__icon { + font-size: 90rpx !important; + } + + ::v-deep .u-button--square { + border-radius: 40rpx !important; + } + ::v-deep .u-button--primary{ + background-color: #05C341 !important; + border-color: #05C341 !important; + } + \ No newline at end of file diff --git a/src/pages/me/uploadPic.vue b/src/pages/me/uploadPic.vue index b90bfd2..8de9c9e 100644 --- a/src/pages/me/uploadPic.vue +++ b/src/pages/me/uploadPic.vue @@ -5,21 +5,21 @@ - + 点击 + - 第二步 核实后再提交 diff --git a/src/pages/me/vip.vue b/src/pages/me/vip.vue index 1b6050f..816943b 100644 --- a/src/pages/me/vip.vue +++ b/src/pages/me/vip.vue @@ -12,8 +12,8 @@ - - + + @@ -44,7 +44,7 @@ - + 3步轻松学{{ getKmTitle(item.subjects) }} @@ -165,8 +165,8 @@ export default { return '开通vip助您快速拿证' } }, - vipHasOpened(item) { - return !!this.vipOnList.find(it => it.memberId == item.memberId) + vipHasOpened(item) {; + return !!this.vipOnList.some(it => it.subjects.includes(item.subjects) ) }, // 去精选500题 item=> 当前科目vip信息 to500(item) { @@ -261,6 +261,7 @@ export default { left: 10px; display: flex; align-items: center; + z-index: 1; } .corner { @@ -277,6 +278,7 @@ export default { justify-content: center; font-size: 12px; color: #fff; + z-index: 1; } .renew { @@ -292,6 +294,7 @@ export default { border-radius: 26rpx; font-size: 12px; color: #F6E99F; + z-index: 1; } .buy { @@ -308,6 +311,7 @@ export default { border-radius: 30rpx; font-size: 14px; color: #F6E99F; + z-index: 1; } .study { diff --git a/src/pages/questionBank/baseOperate.vue b/src/pages/questionBank/baseOperate.vue index 000b6e5..b30b8dc 100644 --- a/src/pages/questionBank/baseOperate.vue +++ b/src/pages/questionBank/baseOperate.vue @@ -1,17 +1,17 @@ @@ -12,9 +13,11 @@ mapState, mapActions } from 'pinia' //引入映射函数 + import useQuestionStore from '@/jtools/store/question' //引入store import useUserStore from '@/jtools/store/user' import { - getTestQuestion + getTestQuestion, + queryQuestionId } from '@/jtools/api/question'; import storage from '@/jtools/storage'; import Question from './components/Question.vue'; @@ -24,63 +27,105 @@ }, data() { return { - type:'', - isShowAll:true, - title:"模拟考试", - subject:1, - isSubmit:false, - tabsList:[{ - label:"模拟考试", - value:0 - },{ - label:"考前密卷", - value:1 + type: '', + collectList: storage.get(`collectList_subject${this.subject}`) || [], + questionArr:[], + isShowAll: true, + title: "模拟考试", + subject: 1, + isSubmit: false, + tabsList: [{ + label: "模拟考试", + value: 0 + }, { + label: "考前秘卷", + value: 1 }] } }, onLoad(op) { - if(op.title){ - this.title=op.title + if (op.title) { + this.title = op.title } - if(op.subject){ - this.subject=op.subject - const param={} - if(op.isExam1){ - param.isExam1=op.isExam1 + if (op.subject) { + this.subject = op.subject + const param = {} + if (op.isExam1) { + param.isExam1 = op.isExam1 } - getTestQuestion({ - carTypeId: storage.get('carType') || '1001', - subject: this.subject, - ...param - }).then(async (resp)=>{ - if(resp.code==='0000'){ - let arr=resp.data - if(this.title==='考前密卷'){ - await this.searchUserVip() - const res = this.vipOnList.some(item => item.subjects == this.subject) - if (!res) { - arr = arr.slice(0, 3) - this.isShowAll = false - } - } - this.type='exam' - this.$refs.question.getQuestionList(JSON.stringify(arr)) + if(op.needVip){ + this.isShowAll = op.needVip + } + let arr=[] + if(op.questionIdList){ + const idList=JSON.parse(op.questionIdList) + arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.includes(qItem.questionId)) + } + arr.forEach(item => { + let isCollect = false + if (this.collectList.includes(item.questionId)) { + isCollect = true } + this.questionArr.push({ + isChoose: false, + isCollect: isCollect, + ...item + }) }) + this.type = 'exam' + this.$refs.question.getQuestionList(JSON.stringify(this.questionArr),this.title) } }, computed: { - ...mapState(useUserStore, ["vipOnList"]) + ...mapState(useUserStore, ["vipOnList","token"]), + ...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4", "version"]), //映射函数,取出tagslist }, methods: { ...mapActions(useUserStore, ['searchUserVip']), - toBack(){ + toBack() { this.$refs.question.submitPaper() }, - changeTab(val){ - if(val==1){ - uni.navigateTo({ - url:"/pages/questionBank/practiceExams?subject="+this.subject+'&title=考前密卷&isExam1=1' + changeTab(val) { + if (val == 1) { + const param=this.subject=='1'?{isExam1: '1'}:{isExam2: '1'} + queryQuestionId({ + versionId: this.version, + carTypeId: storage.get('carType') || '1001', + subject: this.subject, + ...param + }).then(async (resp) => { + if (resp.code === '0000') { + if (this.token) { + await this.searchUserVip() + const result = this.vipOnList.some(item => item.subjects.includes(this.subject)) + if (result) { + const listJson = JSON.stringify(resp.data) + uni.navigateTo({ + url: "/pages/questionBank/practiceExams?title=考前密卷" + "&subject=" + this.subject + "&questionIdList=" + listJson + }) + } else { + if (resp.data && resp.data.length > 3) { + const arr = resp.data.slice(0, 3) + } else { + const arr = resp.data + } + const listJson = JSON.stringify(arr) + uni.navigateTo({ + url: "/pages/questionBank/practiceExams?title=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson+"&needVip="+result + }) + } + } else { + uni.redirectTo({ + url: '/pages/login/login' + }); + } + } else if (resp.code === '4001') { + uni.showToast({ + title: '当前题库非最新版,请更新~', + icon: 'none' + }) + this.getAllQuestion() + } }) } } @@ -89,17 +134,19 @@ + \ No newline at end of file diff --git a/src/pages/questionBank/practiceResult.vue b/src/pages/questionBank/practiceResult.vue index 91322f4..bad9958 100644 --- a/src/pages/questionBank/practiceResult.vue +++ b/src/pages/questionBank/practiceResult.vue @@ -88,11 +88,18 @@ this.subject=op.subject this.allRightList=storage.get(`rightList_subject${this.subject}`) || [] this.allWrongList=storage.get(`wrongList_subject${this.subject}`) || [] - this.percent=(((this.allRightList.length+this.wrongList.length) / this.orderQuestion.length)*100).toFixed(0) + this.percent=(((this.allRightList.length+this.wrongList.length) / this[`orderQuestion_subject${this.subject}`].length)*100).toFixed(0) } }, + onUnload() { + //#ifdef MP-WEIXIN + uni.reLaunch({ + url:"/pages/index/index" + }) + //#endif + }, computed: { - ...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject1"]), //映射函数,取出tagslist + ...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]), //映射函数,取出tagslist getNotDoNum(){ return this[`orderQuestion_subject${this.subject}`].length-(this.allRightList.length+this.allWrongList.length) } diff --git a/src/pages/questionBank/questionBank.vue b/src/pages/questionBank/questionBank.vue index 9c0c3a8..b367be7 100644 --- a/src/pages/questionBank/questionBank.vue +++ b/src/pages/questionBank/questionBank.vue @@ -1,10 +1,11 @@ @@ -17,7 +18,8 @@ import useUserStore from '@/jtools/store/user' import Question from './components/Question.vue'; import { - queryQuestion + queryQuestion, + queryQuestionId } from '@/jtools/api/question'; import storage from '@/jtools/storage'; export default { @@ -26,6 +28,9 @@ }, data() { return { + loadTxt:'加载中...', + collectList: storage.get(`collectList_subject${this.subject}`) || [], + loading:false, isShowAll: true, needVip: false, subject: 1, @@ -41,94 +46,89 @@ } }, async onLoad(op) { + this.loading=true if (op.needVip) { this.needVip = op.needVip } - if(op.subject){ - this.subject=op.subject + if (op.subject) { + this.subject = op.subject } if (op && op.navTitle) { this.navTitle = op.navTitle - const param = {} + let arr=[] + let param={} + if(op.needVip){ + this.isShowAll = !Boolean(op.needVip=='true') + } if (this.navTitle === '顺序答题') { - if(this.subject=='1'){ - this.questionArr = [...this.orderQuestion_subject1] - }else if(this.subject=='4'){ - this.questionArr = [...this.orderQuestion_subject4] - } - this.$refs.question.getQuestionList(JSON.stringify(this.questionArr)) - } else { - if (this.navTitle === '错题本') { - param.questionIdList = storage.get(`wrongList_subject${this.subject}`) || [] - } else if (this.navTitle === '收藏夹') { - param.questionIdList = storage.get(`collectList_subject${this.subject}`) || [] - } - if (op.questionList) { - param.questionIdList = JSON.parse(op.questionList) - } - if (op.chapter) { - param.chapter = op.chapter - } - if (op.examKey) { - param.examKey = op.examKey - } - if(op.isError&&op.isError=='1'){ - param.isError=Number(op.isError) - } - if(op.isNew&&op.isNew=='1'){ - param.isNew=Number(op.isNew) - } - if(op.type){ - param.type=op.type - } - if(op.isImage){ - param.isImage=op.isImage + if (this.subject == '1') { + arr = [...this.orderQuestion_subject1] + } else if (this.subject == '4') { + arr = [...this.orderQuestion_subject4] } + } else if(op.questionIdList){ + const idList=JSON.parse(op.questionIdList) + arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.includes(qItem.questionId)) + }else{ if(op.isVip){ param.isVip=op.isVip } - param.subject=this.subject - param.carTypeId=storage.get('carType') || '1001' - queryQuestion(param).then(async (res) => { - if (res.code == '0000') { - this.questionArr = res.data - if (this.needVip === 'true') { - if (this.token) { - await this.searchUserVip() - const res = this.vipOnList.some(item => item.subjects == this.subject) - if (!res) { - this.questionArr = this.questionArr.slice(0, 3) - this.isShowAll = false - } - } else { - uni.redirectTo({ - url: '/pages/login/login' - }); - } - } - this.$refs.question.getQuestionList(JSON.stringify(this.questionArr)) - } + const resp=await queryQuestionId({ + subject:this.subject, + carTypeId:storage.get('carType') || '1001', + versionId:this.version, + ...params }) + let list=[] + if(resp.code==='0000'){ + await this.searchUserVip() + const res = this.vipOnList.some(item => item.subjects.includes(this.subject)) + if (!res) { + list=resp.data.slice(0,3) + }else{ + list=resp.data + } + } + if(op.needVip){ + this.isShowAll = op.needVip + } + arr=this[`orderQuestion_subject${this.subject}`].filter(qItem=>list.includes(qItem.questionId)) } + arr.forEach(item => { + let isCollect = false + if (this.collectList.includes(item.questionId)) { + isCollect = true + } + this.questionArr.push({ + isChoose: false, + isCollect: isCollect, + ...item + }) + }) + this.loading=false + this.$refs.question.getQuestionList(JSON.stringify(this.questionArr),this.navTitle) + this.$refs.question.getOriginArr(JSON.stringify(this.questionArr)) } }, computed: { - ...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]), //映射函数,取出tagslist - ...mapState(useUserStore, ["vipOnList", "token"]) + ...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4","version"]), //映射函数,取出tagslist + ...mapState(useUserStore, ["vipOnList", "token"]), }, methods: { ...mapActions(useUserStore, ['searchUserVip']), + ...mapActions(useQuestionStore, ['getAllQuestion']), changeTab(val) { if (val == 1) { let list = JSON.parse(JSON.stringify(this.questionArr)) list = list.map(item => { return { ...item, - clickAnswer: item.trueAnswer + clickAnswer: item.trueAnswer, + isChoose: true, } }) this.$refs.question.isShowBest(true) - this.$refs.question.getQuestionList(JSON.stringify(list)) + this.$refs.question.getQuestionList(JSON.stringify(list),this.navTitle) } else { this.$refs.question.isShowBest(false) this.$refs.question.getQuestionList() diff --git a/src/pages/questionBank/videoDetail.vue b/src/pages/questionBank/videoDetail.vue index 171ab0e..c6ba947 100644 --- a/src/pages/questionBank/videoDetail.vue +++ b/src/pages/questionBank/videoDetail.vue @@ -25,11 +25,9 @@ - - - + - {{item.videoTime}} @@ -48,10 +46,10 @@ 收起 - - - + + {{item.videoTime}} @@ -266,4 +264,10 @@ display: inline-block; margin-right: 15px; } + .hide { + backface-visibility: hidden; + transform: translate3d(0, 0, 0); + -webkit-backface-visibility: hidden; + -webkit-transform: translate3d(0, 0, 0); + } \ No newline at end of file diff --git a/src/pages/questionBank/wrongQuestion.vue b/src/pages/questionBank/wrongQuestion.vue index 65fe126..a52ebaf 100644 --- a/src/pages/questionBank/wrongQuestion.vue +++ b/src/pages/questionBank/wrongQuestion.vue @@ -5,23 +5,22 @@ - + {{title}} - + {{tIndex==0?'错题':'收藏'}}情况 - + {{tIndex==0?wrongList.length:collectList.length}} - + @@ -47,41 +46,28 @@ --> - + - - - - 科{{subject==1?'一':'四'}}精品视频课 - 全部10节课 > - - - - - - - - - - - + {{tIndex==0?'错题':'收藏题'}}分类 - - + + + {{item.categoryName}} {{item.num}} @@ -92,6 +78,11 @@