From f762ca430d983ce285b3b14f98a6e2ce7fd37171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=84=86=E7=9A=AE=E9=B8=AD?= <1003092440@qq.com> Date: Mon, 28 Aug 2023 02:02: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/jtools/api/question.js | 11 + src/pages/index/components/Subject1.vue | 47 +-- src/pages/index/components/Subject2.vue | 345 +++++++++++------- src/pages/index/index.vue | 3 +- src/pages/questionBank/baseOperate.vue | 95 ++++- .../questionBank/components/Question.vue | 58 ++- src/pages/questionBank/exclusiveExercise.vue | 109 +++++- src/pages/questionBank/practiceExams.vue | 45 ++- src/pages/questionBank/questionBank.vue | 47 ++- src/pages/questionBank/videoDetail.vue | 55 +-- src/pages/questionBank/wrongQuestion.vue | 4 +- 11 files changed, 578 insertions(+), 241 deletions(-) diff --git a/src/jtools/api/question.js b/src/jtools/api/question.js index f879c9f..0c97c80 100644 --- a/src/jtools/api/question.js +++ b/src/jtools/api/question.js @@ -60,3 +60,14 @@ export function queryProjectList(data) { noToken:true }); } +// + +//获取专项题目数量 +export function querySpecialNum(data) { + return request({ + url: 'driver-api/tdQuestion/querySpecialNum', + method: 'POST', + data, + noToken:true + }); +} diff --git a/src/pages/index/components/Subject1.vue b/src/pages/index/components/Subject1.vue index cd8e40d..d3f2976 100644 --- a/src/pages/index/components/Subject1.vue +++ b/src/pages/index/components/Subject1.vue @@ -15,7 +15,7 @@ </view> </view> <view class="box-item flex ai-c jc-c"> - <view class="flex jc-c ai-c relative" style="width: 230rpx;height: 230rpx;" @tap="toExams"> + <view class="flex jc-c ai-c relative" style="width: 230rpx;height: 230rpx;" @tap="toExams('title=模拟考试')"> <image style="width: 230rpx;height: 230rpx;position: absolute;left: 0;top: 0;" src="../../../static/image/index/orange_bg.png"></image> <view class="btn2-item flex ai-c jc-c"> <view class="text-center cor-fff" style="line-height: 40rpx;"> @@ -60,7 +60,7 @@ <view class="mt5">真实考场模拟</view> </view> </view> - <view class="wp33 flex ai-c jc-c"> + <view class="wp33 flex ai-c jc-c" @tap="toExams('title=考前密卷&isExam1=1')"> <view class="text-center wp100"> <image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/testbeforeicon.png"></image> @@ -137,36 +137,41 @@ }) }, toVip(){ - if(storage.get('token')){ - uni.navigateTo({ - url:"/pages/index/videoVip?subject="+this.subject - }) - }else{ - uni.navigateTo({ - url:'/pages/login/login' - }) - } + // if(storage.get('token')){ + // uni.navigateTo({ + // url:"/pages/index/videoVip?subject="+this.subject + // }) + // }else{ + // uni.navigateTo({ + // url:'/pages/login/login' + // }) + // } + uni.showToast({ + title:'敬请期待', + icon:'none' + }) }, toClass(){ - if(storage.get('token')){ + uni.showToast({ + title:'敬请期待', + icon:'none' + }) + }, + toAnswer(title,val) { + if(title=='精简500题'){ uni.navigateTo({ - url:"/pages/questionBank/baseOperate" + url:"/pages/questionBank/questionBank?navTitle="+title+"&subject="+this.subject+"&needVip="+val+"&isVip=1" }) }else{ uni.navigateTo({ - url:'/pages/login/login' + url:"/pages/questionBank/questionBank?navTitle="+title+"&subject="+this.subject+"&needVip="+val }) } }, - toAnswer(title,val) { - uni.navigateTo({ - url:"/pages/questionBank/questionBank?navTitle="+title+"&subject="+this.subject+"&needVip="+val - }) - }, - toExams(){ + toExams(val){ if(storage.get('token')){ uni.navigateTo({ - url:"/pages/questionBank/practiceExams?subject="+this.subject + url:"/pages/questionBank/practiceExams?subject="+this.subject+'&'+val }) }else{ uni.navigateTo({ diff --git a/src/pages/index/components/Subject2.vue b/src/pages/index/components/Subject2.vue index 779d9c5..ad4d6ab 100644 --- a/src/pages/index/components/Subject2.vue +++ b/src/pages/index/components/Subject2.vue @@ -1,11 +1,13 @@ <template> - <view> - <view class="box-nav"> - <image style="width: 100%;" src="../../../static/image/index/index_bg.jpg"></image> + <view> + <view class="box-nav"> + <image style="width: 100%;" src="../../../static/image/index/index_bg.jpg"></image> <view style="width: 100%;position: absolute;top: 80px;left: 0;" class="flex jc-c"> - <image style="width: 694rpx" mode="widthFix" :src="subject=='2'?'../../../static/image/index/subject2_bg.png':'../../../static/image/index/subject3_bg.png'"></image> + <image style="width: 694rpx" mode="widthFix" + :src="subject=='2'?'../../../static/image/index/subject2_bg.png':'../../../static/image/index/subject3_bg.png'"> + </image> </view> - </view> + </view> <view class="p14lr" style="margin-top: -20px;"> <view class="video_box"> <view class="flex ai-c jc-sb mt5"> @@ -15,15 +17,24 @@ <u-icon name="list" color="#05C341" size="18"></u-icon> </view> </view> - <view class="flex ai-c jc-fa mt15" style="flex-wrap: wrap;"> - <view class="tab_iem mr10 mb10" :class="videoIndex===index?'checked_tab':''" v-for="(item,index) of operateList" :key="index" @tap="checkVideo(index)">{{item.description}}</view> - </view> - <view @tap="toVideo"> - <view class="wp100 relative" style="height: 362rpx;border-radius: 16rpx;"> - <image style="width: 100%;height: 362rpx;border-radius: 16rpx;" id="myVideo" src="../../../static/image/index/jpsp.png"></image> - <image class="play_btn_2" src="../../static/image/index/play.png" /> - </view> + <view class="skill-sequence-panel-content-wrapper"> + <scroll-view class="skill-sequence-panel-content" scroll-x :scroll-into-view="intoindex"> + <view class="skill-sequence-skill-wrapper tab_iem m15tb" :class="videoIndex===index?'checked_tab':''" + v-for="(item,index) of operateList" :key="index" :id='"text"+index' @tap="checkVideo(index)"> + {{item.description}} + </view> + </scroll-view> </view> + <swiper class="swiper" :current="videoIndex" style="height: 362rpx;" :autoplay="false" + :disable-programmatic-animation="true" @change="onChange"> + <swiper-item v-for="(item,index) of operateList" :key="index" @tap="toVideo"> + <view class="wp100 relative p5lr" style="height: 362rpx;border-radius: 16rpx;overflow: hidden;"> + <image style="width: 100%;height: 362rpx;border-radius: 16rpx;" mode="widthFix" + :src="item.videoList[0].videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image> + <image class="play_btn_2" src="../../static/image/index/play.png" /> + </view> + </swiper-item> + </swiper> </view> <view class="video_box mt10"> <view class="flex ai-c jc-sb"> @@ -33,19 +44,20 @@ <u-icon color="#666" name="arrow-right" size="18"></u-icon> </view> </view> - <view class="flex p14lr p20tb bc-fff mt10" style="border-bottom: 1rpx solid #DDDCDC;;" v-for="(item,index) of operateList" :key="index" @tap="toVideo"> - <view class="pic relative"> - <image class="pic" src="../../static/image/index/index_bg.jpg"></image> - <image class="play_btn_3" src="../../static/image/index/play.png" /> - </view> - <view class="ml10"> - <text class="fs16 cor-000 fw600">上车、下车的方法</text> - <view class="fs14 mt5 cor-666">上车、下车的方法</view> - </view> + <view class="flex p14lr p20tb bc-fff mt10" style="border-bottom: 1rpx solid #DDDCDC;" + v-for="(item,index) of videoList" :key="index" @click="toOperateDetail(item.videoId)"> + <view class="pic relative" style="overflow: hidden;"> + <image class="pic" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image> + <image class="play_btn_3" src="../../static/image/index/play.png" /> + </view> + <view class="ml10"> + <text class="fs16 cor-000 fw600">{{baseList[0]?.description}}</text> + <view class="fs14 mt5 cor-666">{{item.description}}</view> + </view> </view> </view> </view> - </view> + </view> </template> <script> @@ -54,125 +66,198 @@ queryProjectList } from '@/jtools/api/question'; import storage from '@/jtools/storage'; -export default { - name: "Subject2", - props:{ - subject:{ - type:[String,Number] - } - }, - data(){ - return{ - diverTypeIndex:0, - diverTypeList:[], - videoIndex:0, - projectId:undefined, - operateList:[] - } - }, - async mounted(){ - await this.getDiverType() - }, - methods:{ - getOperateList(){ - queryProjectList({ - "carTypeId": storage.get('carType') || '1001', - "subject": String(this.subject), - "type": "2" - }).then(resp=>{ - console.log(resp); - }) + export default { + name: "Subject2", + props: { + subject: { + type: [String, Number] + } }, - toVideo(){ - uni.navigateTo({ - url:"/pages/questionBank/videoDetail?driveType="+this.diverTypeList[this.diverTypeIndex].configItemCode+"&subject="+this.subject+"&projectId="+this.projectId+"&type=1" - }) + data() { + return { + intoindex: '', + diverTypeIndex: 0, + diverTypeList: [], + videoIndex: 0, + projectId: undefined, + operateList: [], + baseList: [], + videoList: [] + } }, - getVideoList(){ - queryProjectList({ - "carTypeId": storage.get('carType') || '1001', - "driveType": this.diverTypeList[this.diverTypeIndex].configItemCode, - "subject": String(this.subject), - "type": "1" - }).then(resp=>{ - this.operateList=resp.data - this.projectId=this.operateList[0]?.projectId - }) + async mounted() { + await this.getDiverType() }, - getDiverType(){ - const carTypeId=storage.get('carType') || '1001' - querySysConfigList(carTypeId,'DriveType').then(resp=>{ - if(resp.code==='0000'){ - this.diverTypeList=resp.data + methods: { + onChange(e) { + this.videoIndex = e.detail.current + this.$nextTick(() => { + const index = this.videoIndex - 1 < 0 ? 0 : this.videoIndex - 1 + this.intoindex = "text" + index + }); + }, + getOperateList() { + queryProjectList({ + "carTypeId": storage.get('carType') || '1001', + "subject": String(this.subject), + "driveType": this.diverTypeList[this.diverTypeIndex].configItemCode, + "type": "2" + }).then(resp => { + if (resp.code === '0000') { + this.baseList = resp.data + this.videoList = resp.data[0].videoList.slice(0, 5) + } + }) + }, + formateTime(time) { + const h = parseInt(time / 3600) + const minute = parseInt(time / 60 % 60) + const second = Math.ceil(time % 60) + const hours = h < 10 ? '0' + h : h + const formatSecond = second > 59 ? 59 : second + return `${hours > 0 ? `${hours}:` : ''}${minute < 10 ? '0' + minute : minute}:${formatSecond < 10 ? '0' + formatSecond : formatSecond}` + }, + toVideo() { + let arr = JSON.parse(JSON.stringify(this.operateList)) + arr = arr.map(item => { + return { + ...item, + videoUrl: item.videoList[0]?.videoUrl, + videoTime:this.formateTime(item.videoList[0]?.videoTime) + } + }) + let jsonString = JSON.stringify(arr) + uni.navigateTo({ + url: "/pages/questionBank/videoDetail?videoList=" + jsonString + "&subject=" + this.subject + + "&projectId=" + this.projectId + "&type=1" + }) + }, + toOperateDetail(val){ + let arr = JSON.parse(JSON.stringify(this.baseList[0].videoList)) + arr = arr.map(item => { + return { + ...item, + projectId:item.videoId, + videoTime:this.formateTime(item.videoTime) + } + }) + let jsonString = JSON.stringify(arr) + uni.navigateTo({ + url: "/pages/questionBank/videoDetail?videoList=" + jsonString + "&subject=" + this.subject + + "&projectId=" + val + "&type=2" + }) + }, + getVideoList() { + queryProjectList({ + "carTypeId": storage.get('carType') || '1001', + "driveType": this.diverTypeList[this.diverTypeIndex].configItemCode, + "subject": String(this.subject), + "type": "1" + }).then(resp => { + this.operateList = resp.data + this.projectId = this.operateList[0]?.projectId + }) + }, + getDiverType() { + const carTypeId = storage.get('carType') || '1001' + querySysConfigList(carTypeId, 'DriveType').then(resp => { + if (resp.code === '0000') { + this.diverTypeList = resp.data this.getVideoList() + this.getOperateList() } }) }, - changeDiverType(){ - this.diverTypeIndex=this.diverTypeIndex==0?1:0 + changeDiverType() { + this.diverTypeIndex = this.diverTypeIndex == 0 ? 1 : 0 + this.videoIndex = 0 this.getVideoList() }, - checkVideo(val){ - this.projectId=this.operateList[val]?.projectId - this.videoIndex=val - }, - toDetail(){ - uni.navigateTo({ - url:"/pages/questionBank/baseOperate" - }) + checkVideo(val) { + this.projectId = this.operateList[val]?.projectId + this.videoIndex = val + }, + toDetail() { + uni.navigateTo({ + url: "/pages/questionBank/baseOperate?subject=" + this.subject + }) + } } } -} </script> <style scoped> -.box-nav{ - width: 100%; - position: relative; -} -.center-box{ - position: absolute; - width: 100%; - top: 170rpx; - padding: 0 28rpx; -} -.video_box{ - width: 100%; - background: #FFFFFF; - border-radius: 16rpx; - padding: 14px; -} -.tab_iem{ - padding: 0 5px; - height: 56rpx; - line-height: 56rpx; - text-align: center; - background: #F5F5F5; - border-radius: 10rpx; - color:#333 + .box-nav { + width: 100%; + position: relative; } -.checked_tab{ - background: linear-gradient(90deg, #11DF20 0%, #01B74F 100%); - color:#fff -} -.pic{ - width: 300rpx; - height: 169rpx; - 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 - } -</style> + + .center-box { + position: absolute; + width: 100%; + top: 170rpx; + padding: 0 28rpx; + } + + .video_box { + width: 100%; + background: #FFFFFF; + border-radius: 16rpx; + padding: 14px; + } + + .tab_iem { + padding: 0 5px; + height: 56rpx; + line-height: 56rpx; + text-align: center; + background: #F5F5F5; + border-radius: 10rpx; + color: #333 + } + + .checked_tab { + background: linear-gradient(90deg, #11DF20 0%, #01B74F 100%); + color: #fff + } + + .pic { + width: 300rpx; + height: 169rpx; + 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 + } + + /*scroll-view外层*/ + .skill-sequence-panel-content-wrapper { + position: relative; + white-space: nowrap; + } + + /*scroll-view本身*/ + .skill-sequence-panel-content { + min-width: 100%; + } + + /*scroll-view内层*/ + .skill-sequence-skill-wrapper { + display: inline-block; + margin-right: 15px; + } +</style> \ No newline at end of file diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 764c2e0..0f88e09 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -8,8 +8,9 @@ <Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" /> </template> <template v-else> - <subject2 :subject="subject" ref="subjectRef" /> + <Subject2 :subject="subject" ref="subjectRef" /> </template> + </view> </view> </template> diff --git a/src/pages/questionBank/baseOperate.vue b/src/pages/questionBank/baseOperate.vue index 393f780..e897511 100644 --- a/src/pages/questionBank/baseOperate.vue +++ b/src/pages/questionBank/baseOperate.vue @@ -8,11 +8,15 @@ <!-- <view class="flex ai-c"> <view class="car_item mr10" v-for="(item,index) of carTypeList" :key="index" @tap="chooseCar(item.value)" :class="item.value===tCar?'checked_car':'unchecked_car'">{{item.label}}</view> </view> --> - <view class="flex p14 bc-fff mt10" style="border-radius: 16rpx;" v-for="(item,index) of videoList" :key="index" @tap="toDetail"> - <image class="pic" src="../../static/image/index/index_bg.png"></image> + <view class="flex p14lr p20tb bc-fff mt10" style="border-bottom: 1rpx solid #DDDCDC;;" + v-for="(item,index) of videoList" :key="index" @tap="toOperateDetail(item.videoId)"> + <view class="pic relative" style="overflow: hidden;"> + <image class="pic" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image> + <image class="play_btn_2" src="../../static/image/index/play.png" /> + </view> <view class="ml10"> - <text class="fs16 cor-000 fw600">上车、下车的方法</text> - <view class="fs14 mt5 cor-666">上车、下车的方法</view> + <text class="fs16 cor-000 fw600">{{allVideoList[0]?.description}}</text> + <view class="fs14 mt5 cor-666">{{item.description}}</view> </view> </view> </view> @@ -20,25 +24,22 @@ </template> <script> + import { + querySysConfigList, + queryProjectList + } from '@/jtools/api/question'; + import storage from '@/jtools/storage'; export default { data(){ return{ + subject:'1', tCar:0, categoryList:[{ name:'手动挡C1' },{ name:'自动挡C2' }], - carTypeList:[{ - label:'捷达', - value:0 - },{ - label:'新桑塔纳', - value:1 - },{ - label:'爱丽舍', - value:2 - }], + allVideoList:[], videoList:[{ label:"111" },{ @@ -50,12 +51,69 @@ }] } }, + onLoad(op){ + if(op.subject){ + this.subject=op.subject + this.getDiverType() + } + }, methods:{ + formateTime(time) { + const h = parseInt(time / 3600) + const minute = parseInt(time / 60 % 60) + const second = Math.ceil(time % 60) + const hours = h < 10 ? '0' + h : h + const formatSecond = second > 59 ? 59 : second + return `${hours > 0 ? `${hours}:` : ''}${minute < 10 ? '0' + minute : minute}:${formatSecond < 10 ? '0' + formatSecond : formatSecond}` + }, + toOperateDetail(val){ + let arr = JSON.parse(JSON.stringify(this.allVideoList[0].videoList)) + arr = arr.map(item => { + return { + ...item, + projectId:item.videoId, + videoTime:this.formateTime(item.videoTime) + } + }) + let jsonString = JSON.stringify(arr) + uni.navigateTo({ + url: "/pages/questionBank/videoDetail?videoList=" + jsonString + "&subject=" + this.subject + + "&projectId=" + val + "&type=2" + }) + }, + getOperateList() { + queryProjectList({ + "carTypeId": storage.get('carType') || '1001', + "subject": String(this.subject), + "driveType": this.categoryList[this.tCar].configItemCode, + "type": "2" + }).then(resp => { + if(resp.code==='0000'){ + this.videoList=resp.data[0]?resp.data[0].videoList:[] + this.allVideoList=resp.data + } + }) + }, + getDiverType() { + const carTypeId = storage.get('carType') || '1001' + querySysConfigList(carTypeId, 'DriveType').then(resp => { + if (resp.code === '0000') { + this.categoryList=resp.data.map(item=>{ + return { + ...item, + name:item.configItemName + } + }) + this.getOperateList() + } + }) + }, chooseCar(val){ this.tCar=val }, changeCategory(val){ - + this.tCar=val.index + this.getOperateList() }, toDetail(){ uni.navigateTo({ @@ -93,4 +151,11 @@ background: #00B74F; border-radius: 8rpx; } + .play_btn_2 { + width: 65rpx; + height: 65rpx; + position: absolute; + left: 117.5rpx; + top: 52rpx + } </style> \ No newline at end of file diff --git a/src/pages/questionBank/components/Question.vue b/src/pages/questionBank/components/Question.vue index 0093f28..dbf455e 100644 --- a/src/pages/questionBank/components/Question.vue +++ b/src/pages/questionBank/components/Question.vue @@ -1,7 +1,7 @@ <template> <view class="content"> <view class="flex ai-c jc-c"> - <view class="flex type_box jc-sb ai-c"> + <view class="flex type_box jc-sb ai-c" v-if="navTitle!=='考前密卷'"> <view class="type_item" v-for="(item,index) of tabsList" :key="index" :class="tCurrent==item.value?'checked':'unchecked'" @tap="sectionChange(item.value)">{{item.label}}</view> </view> </view> @@ -83,7 +83,7 @@ <view class="wp100 flex jc-sb ai-c p14 bc-fff" v-if="isShowAll" style="position: fixed;bottom: 0;left: 0;"> <view style="width: 220rpx;"> <view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view> - <view v-else class="btn" style="text-align: center;" @tap="submitPaper"> + <view v-else-if="type=='exam'" class="btn" style="text-align: center;" @tap="submitPaper"> <u-count-down ref="countDown_1" :time=" 1*60*60 * 1000" format="HH:mm:ss" @change="timeChange"></u-count-down> <text>交卷</text> </view> @@ -147,8 +147,14 @@ </view> <template #confirmButton> <view class="p10" > - <u-button :customStyle="{width:'45%',marginRight:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#666',border:'1px solid #666',display:'inline-block'}" @click="continueExam">继续考试</u-button> - <u-button :customStyle="{width:'45%',marginLeft:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#fff',backgroundColor:'#05C341',display:'inline-block'}" @click="toSubmit">现在交卷</u-button> + <template v-if="isShowAll"> + <u-button :customStyle="{width:'45%',marginRight:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#666',border:'1px solid #666',display:'inline-block'}" @click="continueExam">继续考试</u-button> + <u-button :customStyle="{width:'45%',marginLeft:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#fff',backgroundColor:'#05C341',display:'inline-block'}" @click="toSubmit">现在交卷</u-button> + </template> + <template v-else> + <u-button :customStyle="{width:'45%',marginRight:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#666',border:'1px solid #666',display:'inline-block'}" @click="toLeave">确定离开</u-button> + <u-button :customStyle="{width:'45%',marginLeft:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#fff',backgroundColor:'#05C341',display:'inline-block'}" @click="continueExam">继续考试</u-button> + </template> </view> </template> </u-modal> @@ -157,7 +163,7 @@ <view class="wp100 flex jc-sb p14 bc-fff"> <view style="width: 220rpx;"> <view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view> - <view v-else class="btn" style="text-align: center;" @tap="submitPaper"> + <view v-else-if="type=='exam'" class="btn" style="text-align: center;" @tap="submitPaper"> <u-count-down ref="countDown_2" :time="1 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down> <text>交卷</text> </view> @@ -263,6 +269,7 @@ export default { }, data() { return { + originArray:'', showBestAnswer:false, nowPrice:68, showVip:false, @@ -305,6 +312,11 @@ export default { }, methods: { ...mapActions(useQuestionStore,['getCurrentIndex']), + toLeave(){ + uni.switchTab({ + url:'/pages/index/index' + }) + }, isShowBest(val){ this.showBestAnswer=val }, @@ -414,8 +426,10 @@ export default { }) }, submitPaper(){ - this.$refs.countDown_1.pause(); - this.$refs.countDown_2.pause(); + if(this.isShowAll){ + this.$refs.countDown_1.pause(); + this.$refs.countDown_2.pause(); + } this.$refs.countDown_3.pause(); this.$emit('update:isSubmit',true) }, @@ -581,6 +595,7 @@ export default { this.questionList[this.topicIndex].clickAnswer = this.questionList[this.topicIndex].clickAnswer.replace(reg2,""); } } + this.originArray=JSON.stringify(this.questionList) if(this.tCurrent!==1&&this.questionList[this.topicIndex].type!='3'){ const arr1=this.questionList[this.topicIndex].clickAnswer.split('') const arr2=this.questionList[this.topicIndex].trueAnswer.split('') @@ -644,19 +659,24 @@ export default { this.$emit('changeTab',index) }, getQuestionList(val) { - const arr = JSON.parse(val) - this.questionList=[] - arr.forEach(item=>{ - let isCollect=false - if(this.collectList.includes(item.questionId)){ - isCollect=true - } - this.questionList.push({ - isChoose:false, - isCollect:isCollect, - ...item + if(val&&val.length){ + const arr = JSON.parse(val) + this.questionList=[] + arr.forEach(item=>{ + let isCollect=false + if(this.collectList.includes(item.questionId)){ + isCollect=true + } + this.questionList.push({ + isChoose:false, + isCollect:isCollect, + ...item + }) }) - }) + }else{ + this.questionList=JSON.parse(this.originArray) + } + if(this.navTitle==='顺序答题'){ this.pickerTopic(this[`currentIndex_subject${this.subject}`]) }else{ diff --git a/src/pages/questionBank/exclusiveExercise.vue b/src/pages/questionBank/exclusiveExercise.vue index 6915fdc..102d221 100644 --- a/src/pages/questionBank/exclusiveExercise.vue +++ b/src/pages/questionBank/exclusiveExercise.vue @@ -46,6 +46,7 @@ import neverWriteIcon from "../../static/image/practice/neverWrite_icon.png" import { querySysConfigList, + querySpecialNum } from '@/jtools/api/question'; import storage from '@/jtools/storage'; export default { @@ -94,8 +95,90 @@ this.subject=op.subject } this.getExamPoint() + this.getQuestionNum() }, methods: { + getQuestionNum(){ + querySpecialNum({ + carTypeId:storage.get('carType') || '1001', + subject:this.subject + }).then(resp=>{ + if(resp.code==='0000'){ + if(this.subject=='1'){ + this.list=[{ + title:'新规题', + subTitle:resp.data.newQuestionNum+'题', + isNew:1, + isError:0, + image:newRulesIcon + },{ + title:'易错题', + isNew:0, + isError:1, + subTitle:resp.data.errorQuestionNum+'题', + image:errorIcon + },{ + title:'单选题', + subTitle:resp.data.radioQuestionNum+'题', + isNew:0, + isError:0, + image:newRulesIcon + },{ + title:'判断题', + subTitle:resp.data.judgeQuestionNum+'题', + isNew:0, + isError:0, + image:errorIcon + },{ + title:'图片题', + subTitle:resp.data.imageQuestionNum+'题', + isNew:0, + isError:0, + image:neverWriteIcon + }] + }else{ + this.list=[{ + title:'新规题', + subTitle:resp.data.newQuestionNum+'题', + isNew:1, + isError:0, + image:newRulesIcon + },{ + title:'易错题', + isNew:0, + isError:1, + subTitle:resp.data.errorQuestionNum+'题', + image:errorIcon + },{ + title:'单选题', + subTitle:resp.data.radioQuestionNum+'题', + isNew:0, + isError:0, + image:newRulesIcon + },{ + title:'多选题', + subTitle:resp.data.multipleChoiceQuestionNum+'题', + isNew:0, + isError:0, + image:neverWriteIcon + },{ + title:'判断题', + subTitle:resp.data.judgeQuestionNum+'题', + isNew:0, + isError:0, + image:errorIcon + },{ + title:'图片题', + subTitle:resp.data.imageQuestionNum+'题', + isNew:0, + isError:0, + image:neverWriteIcon + }] + } + + } + }) + }, getExamPoint(){ const carTypeId=storage.get('carType') || '1001' const examKey = this.subject=='1'?'ExamKeysOfSubjectOne':'ExamKeysOfSubjectFour' @@ -106,13 +189,31 @@ }) }, toAnswer(title,isError,isNew) { - uni.navigateTo({ - url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew - }) + if(title=='单选题'){ + uni.navigateTo({ + url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&type=2"+"&subject="+this.subject + }) + }else if(title=='多选题'){ + uni.navigateTo({ + url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&type=3"+"&subject="+this.subject + }) + }else if(title=='判断题'){ + uni.navigateTo({ + url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&type=1"+"&subject="+this.subject + }) + }else if(title=='图片题'){ + uni.navigateTo({ + url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&isImage=1"+"&subject="+this.subject + }) + }else{ + uni.navigateTo({ + url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew+"&subject="+this.subject + }) + } }, toQuestionBank(val){ uni.navigateTo({ - url:"/pages/questionBank/questionBank?navTitle="+val.configItemName+"&examKey="+val.configItemCode + url:"/pages/questionBank/questionBank?navTitle="+val.configItemName+"&examKey="+val.configItemCode+"&subject="+this.subject }) }, toIconSkill(){ diff --git a/src/pages/questionBank/practiceExams.vue b/src/pages/questionBank/practiceExams.vue index eef5241..13d34ca 100644 --- a/src/pages/questionBank/practiceExams.vue +++ b/src/pages/questionBank/practiceExams.vue @@ -2,12 +2,17 @@ <view> <!-- <u-navbar title="模拟考试" @rightClick="rightClick" :autoBack="true"> </u-navbar> --> - <j-navbar :isDefineBack="true" @toBack="toBack">模拟考试</j-navbar> - <Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" type="exam" :subject="subject" navTitle="模拟考试" /> + <j-navbar :isDefineBack="true" @toBack="toBack">{{title}}</j-navbar> + <Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" :type="type" :isShowAll="isShowAll" :subject="subject" :navTitle="title" @changeTab="changeTab" /> </view> </template> <script> + import { + mapState, + mapActions + } from 'pinia' //引入映射函数 + import useUserStore from '@/jtools/store/user' import { getTestQuestion } from '@/jtools/api/question'; @@ -19,6 +24,9 @@ }, data() { return { + type:'', + isShowAll:true, + title:"模拟考试", subject:1, isSubmit:false, tabsList:[{ @@ -31,23 +39,50 @@ } }, onLoad(op) { + if(op.title){ + this.title=op.title + } 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 - }).then(resp=>{ + subject: this.subject, + ...param + }).then(async (resp)=>{ if(resp.code==='0000'){ - this.$refs.question.getQuestionList(JSON.stringify(resp.data)) + 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)) } }) } }, computed: { + ...mapState(useUserStore, ["vipOnList"]) }, methods: { + ...mapActions(useUserStore, ['searchUserVip']), toBack(){ this.$refs.question.submitPaper() + }, + changeTab(val){ + if(val==1){ + uni.navigateTo({ + url:"/pages/questionBank/practiceExams?subject="+this.subject+'&title=考前密卷&isExam1=1' + }) + } } } } diff --git a/src/pages/questionBank/questionBank.vue b/src/pages/questionBank/questionBank.vue index 8381f1e..9c0c3a8 100644 --- a/src/pages/questionBank/questionBank.vue +++ b/src/pages/questionBank/questionBank.vue @@ -50,26 +50,12 @@ if (op && op.navTitle) { this.navTitle = op.navTitle const param = {} - if (this.navTitle === '顺序答题' || this.navTitle === '精简500题') { + if (this.navTitle === '顺序答题') { if(this.subject=='1'){ this.questionArr = [...this.orderQuestion_subject1] }else if(this.subject=='4'){ this.questionArr = [...this.orderQuestion_subject4] - } - 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)) } else { if (this.navTitle === '错题本') { @@ -92,9 +78,34 @@ if(op.isNew&&op.isNew=='1'){ param.isNew=Number(op.isNew) } - queryQuestion(param).then(res => { + if(op.type){ + param.type=op.type + } + if(op.isImage){ + param.isImage=op.isImage + } + 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)) } }) @@ -120,7 +131,7 @@ this.$refs.question.getQuestionList(JSON.stringify(list)) } else { this.$refs.question.isShowBest(false) - this.$refs.question.getQuestionList(JSON.stringify(this.questionArr)) + this.$refs.question.getQuestionList() } }, rightClick() { diff --git a/src/pages/questionBank/videoDetail.vue b/src/pages/questionBank/videoDetail.vue index db18207..35788cd 100644 --- a/src/pages/questionBank/videoDetail.vue +++ b/src/pages/questionBank/videoDetail.vue @@ -1,7 +1,7 @@ <template> <view> - <sunny-video style="width: 100%" videoHeight="422rpx" ref="sunny-video" title="测试视频" - src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" /> + <sunny-video style="width: 100%" videoHeight="422rpx" ref="sunny-video" + :src="videoList[currentIndex].videoUrl" /> <view class="p14tb bc-fff"> <view class="skill-sequence-panel-content-wrapper pr14" v-if="videoType=='test'"> <scroll-view class="skill-sequence-panel-content" scroll-x> @@ -10,7 +10,7 @@ </scroll-view> </view> <view class="flex ai-c jc-sb mt10 wp100 p14"> - <text class="fs18 fw600 cor-000">C1捷达-基础操作视频讲解</text> + <text class="fs18 fw600 cor-000">{{title}}</text> <view class="flex" @tap="popupShow=true" v-if="videoType!='test'"> <text class="fs14 cor-666">更多</text> <u-icon color="#666" name="arrow-right" size="18"></u-icon> @@ -20,17 +20,19 @@ <view> </view> </view> - <view class="bc-fff pl14"> + <view class="bc-fff pl14 pb10"> <view class="skill-sequence-panel-content-wrapper"> <scroll-view class="skill-sequence-panel-content" scroll-x :scroll-left="164*currentIndex"> <view class="skill-sequence-skill-wrapper" v-for="(item, index) in videoList" :key="index" - @click="checkVideo(item.projectId)"> + @tap="checkVideo(item.projectId)"> <view> <view class="mb10 relative"> - <image class="contain-box" src="../../static/image/index/jpsp.png"></image> + <view class="contain-box" style="overflow: hidden;"> + <image class="contain-box" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image> + </view> <view v-if="projectId==item.projectId" class="playLogo">播放中</view> <image class="play_btn" src="../../static/image/index/play.png" /> - <text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">13:14</text> + <text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">{{item.videoTime}}</text> </view> <text :style="{color:projectId==item.projectId?'#FF6E02':'#333'}">{{item.description}}</text> </view> @@ -45,11 +47,11 @@ </view> <view style="max-height: 800rpx;overflow-y: scroll;" class="p14lr"> <view class="flex bc-fff mt10" style="border-radius: 16rpx;" v-for="(item,index) of videoList" :key="index" - @tap="toDetail"> - <view class="pic relative"> - <image class="pic" src="../../static/image/index/jpsp.png"></image> + @tap="checkVideo(item.projectId)"> + <view class="pic relative" style="overflow: hidden;"> + <image class="pic" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image> <image class="play_btn_2" src="../../static/image/index/play.png" /> - <text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">13:14</text> + <text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">{{item.videoTime}}</text> </view> <view class="ml10"> <text class="fs16 cor-000 fw600">{{item.description}}</text> @@ -69,6 +71,7 @@ export default { data() { return { + title:'', currentIndex:0, videoIndex: 0, testList: [{ @@ -131,34 +134,34 @@ if(op.projectId){ this.projectId=op.projectId } - if(op.driveType){ - this.param.driveType=op.driveType - } if(op.subject){ this.param.subject=op.subject } if(op.type){ this.param.type=op.type } - this.getVieoList() + if(op.type=='1'){ + if(this.param.subject=='2'){ + this.title='科二基础项目讲解' + }else{ + this.title='科三基础项目讲解' + } + }else{ + this.title='基础操作讲解' + } + if(op.videoList){ + this.videoList=JSON.parse(op.videoList) + this.currentIndex=this.videoList.findIndex(item=>item.projectId==this.projectId) + } }, methods: { - getVieoList(){ - queryProjectList({ - "carTypeId": storage.get('carType') || '1001', - "driveType": this.param.driveType, - "subject": this.param.subject, - "type": this.param.type - }).then(resp=>{ - this.videoList=resp.data - this.currentIndex=this.videoList.findIndex(item=>item.projectId==this.projectId) - }) - }, checkTest(val) { this.videoIndex = val }, checkVideo(val) { + this.popupShow=false this.projectId = val + this.currentIndex=this.videoList.findIndex(item=>item.projectId==this.projectId) } } } diff --git a/src/pages/questionBank/wrongQuestion.vue b/src/pages/questionBank/wrongQuestion.vue index e07c5d2..65fe126 100644 --- a/src/pages/questionBank/wrongQuestion.vue +++ b/src/pages/questionBank/wrongQuestion.vue @@ -63,12 +63,12 @@ <image class="contain-box" src="../../../static/image/index/jpsp.png"></image> <image class="play_btn_2" src="../../static/image/index/play.png" /> </view> - <view class="ml15 text-center"> + <!-- <view class="ml15 text-center"> <u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff" text="去看视频" color="linear-gradient(90deg, #11DF20 0%, #00B74F 100%)" icon="play-circle"> </u-button> <view class="cor-333 fs15 fw600 mt10">科{{subject==1?'一':'四'}}易错试题</view> - </view> + </view> --> </view> </view> -- 2.38.1.windows.1