11 Commits

24 changed files with 995 additions and 985 deletions

View File

@@ -1,9 +1,11 @@
<script>
import useUserStore from '@/jtools/store/user'
import useQuestionStore from '@/jtools/store/question' //引入store
export default {
onLaunch: function () {
useUserStore().queryVipList()
if(useUserStore().isLogin) {
useQuestionStore().getOrderQuestion('1')
useUserStore().getUserInfo()
useUserStore().searchUserVip()
}

View File

@@ -7,7 +7,7 @@
<view class="u-back-text u-line-1 u-m-l-20" v-if="backText" :style="[backTextStyle]">{{ backText || '' }}</view>
</view>
<slot name="left"></slot>
<view class="content fs32 fwb" :style="[{ top: statusBarHeight + 'px' }]"><slot></slot></view>
<view class="content fs16" :style="[{ top: statusBarHeight + 'px' }]"><slot></slot></view>
<view class="right">
<slot name="right"></slot>
</view>
@@ -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();
}
}
}
}

View File

@@ -21,14 +21,14 @@ export function getCode(data) {
export function logout() {
return request({
url: 'driver-api/tdSysUser/loginOut',
method: 'get',
method: 'get'
});
}
export function getInfo() {
return request({
url: 'driver-api/tdSysUser/queryUserMessage',
method: 'get',
method: 'get'
});
}
@@ -38,4 +38,4 @@ export function bindSchool(data) {
method: 'post',
data
});
}
}

View File

@@ -0,0 +1,59 @@
import request from '../request/index.js';
export function queryQuestion(data) {
return request({
url: 'driver-api/tdQuestion/queryQuestion',
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,
});
}
export function testTotal(data) {
return request({
url: 'driver-api/tdQuestionTest/testTotal',
method: 'POST',
data,
});
}
//获取配置
export function querySysConfigList(carTypeId,configKey) {
return request({
url: 'driver-api/tdSysConfigList/querySysConfigList?configKey='+configKey+'&carTypeId='+carTypeId,
method: 'GET',
});
}
//获取项目列表 (考试项目和基础操作)
export function queryProjectList(data) {
return request({
url: 'driver-api/tdTestProject/queryProjectList',
method: 'POST',
data,
});
}

View File

@@ -1,20 +1,38 @@
import { defineStore } from 'pinia';
import {
defineStore
} from 'pinia';
import http from '@/jtools/request/index';
import constants from '@/jtools/constants';
import {
queryQuestion
} from '@/jtools/api/question';
import storage from '@/jtools/storage';
const question = defineStore({
id: 'question',
state: () => ({
orderQuestionList: [], //顺序做题
}),
id: 'question',
state: () => ({
currentCartype: storage.get('carType') || '1001',
orderQuestion: [], //顺序做题
currentIndex_subject1:0,//科目一索引 顺序做题
currentIndex_subject4:0,//科目四索引 顺序做题
}),
actions: {
// 获取顺序做题
getQuestionList(arr) {
this.orderQuestionList=[...arr]
},
actions: {
// 获取顺序做题
getOrderQuestion(val) {
queryQuestion({
carTypeId: this.currentCartype,
subject: val
}).then(res => {
if (res.code == '0000') {
this.orderQuestion = res.data
}
})
},
//获取索引
getCurrentIndex(index,val){
this[`currentIndex_subject${val}`]=index
}
}
});
export default question;
export default question;

View File

@@ -62,12 +62,11 @@ const useUserStore = defineStore({
storage.remove('userInfo')
},
// 查询当前用户的vip开通情况
searchUserVip() {
queryVip({ carTypeId: this.currentCartype,memberId: null, subject:'' }).then(resp => {
async searchUserVip() {
const resp=await queryVip({ carTypeId: this.currentCartype,memberId: null, subject:'' })
if(resp.code == '0000') {
this.vipOnList = resp.data
}
})
},
// 查询所有的vip
queryVipList() {

View File

@@ -124,6 +124,13 @@
"navigationBarTitleText": "章节练习",
"enablePullDownRefresh": false
}
},
{
"path": "pages/index/testRoom",
"style": {
"navigationBarTitleText": "考场实况",
"enablePullDownRefresh": false
}
}
],

View File

@@ -4,19 +4,23 @@
<image style="width: 100%;" src="../../static/image/index/index_bg.jpg"></image>
<view class="center-box flex jc-sb ai-c">
<view class="box-item flex ai-c jc-c">
<view class="btn-item flex ai-c jc-c">
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toAnswer('顺序答题')">
<view class="fs16">顺序练习</view>
<text class="fs14">0/2344</text>
</view>
<view class="flex jc-c ai-c" style="width: 230rpx;height: 230rpx;background-image: url(../../../static/image/index/green_bg.png);background-size: 100% 100%;">
<view class="btn-item flex ai-c jc-c">
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toAnswer('顺序答题',false)">
<view class="fs16">顺序练习</view>
<text class="fs14">{{rightList.length+wrongList.length}}/{{orderQuestion.length}}</text>
</view>
</view>
</view>
</view>
<view class="box-item flex ai-c jc-c">
<view class="btn2-item flex ai-c jc-c">
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toExams">
<view class="fs16">模拟考试</view>
<text class="fs14">考试</text>
</view>
<view class="flex jc-c ai-c" style="width: 230rpx;height: 230rpx;background-image: url(../../../static/image/index/orange_bg.png);background-size: 100% 100%;">
<view class="btn2-item flex ai-c jc-c">
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toExams">
<view class="fs16">模拟考试</view>
<text class="fs14">去考试</text>
</view>
</view>
</view>
</view>
</view>
@@ -31,7 +35,7 @@
<view class="mt5">VIP课程</view>
</view>
</view>
<view class="wp33 flex ai-c jc-c" @tap="toAnswer('精简500题')">
<view class="wp33 flex ai-c jc-c" @tap="toAnswer('精简500题',true)">
<view class="text-center wp100">
<image style="width: 72rpx;height: 72rpx;margin: 0 auto"
src="../../static/image/index/500icon.png">
@@ -47,7 +51,7 @@
<view class="mt5">专项练习</view>
</view>
</view>
<view class="wp33 flex ai-c jc-c">
<view class="wp33 flex ai-c jc-c" @tap="toTestRoom">
<view class="text-center wp100">
<image style="width: 72rpx;height: 72rpx;margin: 0 auto;"
src="../../static/image/index/realicon.png"></image>
@@ -73,7 +77,7 @@
<view style="padding: 0 28rpx;margin-top: 30rpx;" @tap="toClass">
<view class="video-box">
<view class="flex jc-sb ai-c wp100">
<text style="color: #05C341;font-size: 36rpx;">精品视频课</text>
<text style="color: #05C341;font-size: 36rpx;">{{subject==1?'一':'四'}}精品视频课</text>
<text class="cor-666 fs12">全部10节课 ></text>
</view>
<view class="flex ai-c mt20">
@@ -82,7 +86,7 @@
<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">易错试题</view>
<view class="cor-333 fs15 fw600 mt10">{{subject==1?'一':'四'}}易错试题</view>
</view>
</view>
@@ -92,11 +96,34 @@
</template>
<script>
import { mapState,mapActions } from 'pinia' //引入映射函数
import storage from '@/jtools/storage';
import useQuestionStore from '@/jtools/store/question' //引入store
export default {
props:{
subject:{
type:[String,Number],
}
},
data() {
return {}
return {
rightList:storage.get(`rightList_subject${this.subject}`) || [],
wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
allQuestionNum:0,
}
},
onLoad(){
// this.allQuestionNum=useQuestionStore().orderQuestion.length
},
computed: {
...mapState(useQuestionStore, ["orderQuestion"]) //映射函数取出tagslist
},
methods: {
toTestRoom(){
uni.navigateTo({
url:"/pages/index/testRoom"
})
},
toVip(){
uni.navigateTo({
url:"/pages/index/videoVip"
@@ -107,14 +134,14 @@
url:"/pages/questionBank/baseOperate"
})
},
toAnswer(title) {
toAnswer(title,val) {
uni.navigateTo({
url:"/pages/questionBank/questionBank?navTitle="+title
url:"/pages/questionBank/questionBank?navTitle="+title+"&subject="+this.subject+"&needVip="+val
})
},
toExams(){
uni.navigateTo({
url:"/pages/questionBank/practiceExams"
url:"/pages/questionBank/practiceExams?subject="+this.subject
})
},
toExclusive(){
@@ -124,7 +151,7 @@
},
toWrongList(){
uni.navigateTo({
url:"/pages/questionBank/wrongQuestion"
url:"/pages/questionBank/wrongQuestion?subject="+this.subject
})
}
}

View File

@@ -1,25 +1,25 @@
<template>
<view>
<view class="box-nav">
<image style="width: 100%;" src="../../static/image/index/index_bg.png"></image>
<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="../../../static/image/index/vipAds.png"></image>
<image style="width: 694rpx" mode="widthFix" src="../../../static/image/index/subject2_bg.png"></image>
</view>
</view>
<view class="p14lr" style="margin-top: -20px;">
<view class="video_box">
<view class="flex ai-c jc-sb">
<view class="flex ai-c jc-sb mt5">
<text class="fs18 cor-000">科二考试项目讲解</text>
<view class="flex ai-c" style="height: 34rpx;line-height: 34rpx;">
<text style="color:#05C341;font-size: 16px;">自动挡</text>
<view class="flex ai-c" style="height: 34rpx;line-height: 34rpx;" @tap="changeDiverType">
<text style="color:#05C341;font-size: 16px;">{{diverTypeList[diverTypeIndex].configItemName}}</text>
<u-icon name="list" color="#05C341" size="18"></u-icon>
</view>
</view>
<view class="flex ai-c jc-sb mt15">
<view class="tab_iem" :class="videoIndex===item.value?'checked_tab':''" v-for="(item,index) of operateList" :key="index" @tap="checkVideo(item.value)">{{item.label}}</view>
<view class="tab_iem" :class="videoIndex===item.value?'checked_tab':''" v-for="(item,index) of operateList" :key="index" @tap="checkVideo(index)">{{item.description}}</view>
</view>
<view class="mt15">
<video style="width: 100%;height: 362rpx;border-radius: 16rpx;" id="myVideo" src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4"></video>
<video style="width: 100%;height: 362rpx;border-radius: 16rpx;" id="myVideo" :src="operateList[videoIndex].videoList[0].videoUrl"></video>
</view>
</view>
<view class="video_box mt10">
@@ -35,27 +35,56 @@
</template>
<script>
import {
querySysConfigList,
queryProjectList
} from '@/jtools/api/question';
import storage from '@/jtools/storage';
export default {
name: "Subject2",
data(){
return{
videoIndex:0,
operateList:[{
label:"侧方停车",
value:0,
},{
label:"倒车入库",
value:1
},{
label:"曲线行驶",
value:2
},{
label:"直角转弯",
value:3
}]
props:{
subject:{
type:[String,Number]
}
},
data(){
return{
diverTypeIndex:0,
diverTypeList:[],
videoIndex:0,
operateList:[]
}
},
async mounted(){
await this.getDiverType()
},
methods:{
getVideoList(){
console.log('index',this.diverTypeIndex);
console.log(this.diverTypeList[this.diverTypeIndex]);
queryProjectList({
"carTypeId": storage.get('carType') || '1001',
"driveType": this.diverTypeList[this.diverTypeIndex].configItemCode,
"subject": String(this.subject),
"projectId":'1001',
"type": "1"
}).then(resp=>{
this.operateList=resp.data
})
},
getDiverType(){
const carTypeId=storage.get('carType') || '1001'
querySysConfigList(carTypeId,'DriveType').then(resp=>{
if(resp.code==='0000'){
this.diverTypeList=resp.data
this.getVideoList()
}
})
},
changeDiverType(){
this.diverTypeIndex=this.diverTypeIndex==0?1:0
this.getVideoList()
},
checkVideo(val){
this.videoIndex=val
},

View File

@@ -1,14 +1,14 @@
<template>
<view>
<u-sticky bgColor="#fff">
<u-tabs :list="categoryList" :scrollable="false" @click="changeCategory"></u-tabs>
<u-tabs :list="categoryList" :scrollable="false" @change="changeCategory"></u-tabs>
</u-sticky>
<view style="height: 100vh;background-color: rgb(245, 245, 245);">
<template v-if="tIndex===0 || tIndex===3">
<Subject1 />
<Subject1 :subject="tIndex+1" />
</template>
<template v-else>
<subject2 />
<subject2 :subject="tIndex+1" />
</template>
</view>
</view>
@@ -38,314 +38,19 @@
};
},
onLoad() {
this.getAllQuestion()
},
methods:{
...mapActions(useQuestionStore, ['getQuestionList']), //映射action
...mapActions(useQuestionStore,['getOrderQuestion']),
//切换科目
changeCategory(val){
this.tIndex=val.index
console.log(this.tIndex);
if(this.tIndex==0){
this.getOrderQuestion('1')
}else if(this.tIndex==3){
this.getOrderQuestion('4')
}
},
//获取全部题库
getAllQuestion(){
const arr = [{
questionId: 0,
questionTypeDesc: '单选',
questionDesc: '第一题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'C',
}, {
questionId: 1,
questionTypeDesc: '单选',
questionDesc: '第二题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'B',
}, {
questionId: 2,
questionTypeDesc: '单选',
questionDesc: '第三题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
},
{
questionId: 3,
questionTypeDesc: '单选',
questionDesc: '第四题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 4,
questionTypeDesc: '单选',
questionDesc: '第5题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
},
{
questionId: 5,
questionTypeDesc: '单选',
questionDesc: '第6题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 6,
questionTypeDesc: '单选',
questionDesc: '第7题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 7,
questionTypeDesc: '单选',
questionDesc: '第8题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 8,
questionTypeDesc: '单选',
questionDesc: '第9题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'C',
}, {
questionId: 9,
questionTypeDesc: '单选',
questionDesc: '第10题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'B',
}, {
questionId: 10,
questionTypeDesc: '单选',
questionDesc: '第11题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
},
{
questionId: 11,
questionTypeDesc: '单选',
questionDesc: '第12题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 12,
questionTypeDesc: '单选',
questionDesc: '第13题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
},
{
questionId: 13,
questionTypeDesc: '单选',
questionDesc: '第14题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 14,
questionTypeDesc: '单选',
questionDesc: '第15题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 15,
questionTypeDesc: '单选',
questionDesc: '第16题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}
]
this.getQuestionList(arr)
},
}
}
}
</script>

View File

@@ -0,0 +1,100 @@
<template>
<view>
<u-sticky bgColor="#fff">
<u-tabs :list="categoryList" :scrollable="false" @click="changeCategory"></u-tabs>
</u-sticky>
<view class="p14">
<view class="flex ai-c" v-if="carTypeList&&carTypeList.length">
<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" 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="ml10" style="width: calc(100% - 320rpx);">
<text class="fs16 cor-000 fw600">八一考场</text>
<view class="fs14 mt40 cor-666 flex jc-sb ai-c wp100" >
<text>共9条路线视频</text>
<text>蜀山区</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data(){
return{
tCar:0,
categoryList:[{
name:'全部'
},{
name:'蜀山区'
},{
name:'长丰县'
},{
name:'瑶海区'
},{
name:'肥东县'
},{
name:'庐江县'
}],
carTypeList:[],
videoList:[{
label:"111"
},{
label:'222'
},{
label:'333'
},{
label:'444'
}]
}
},
methods:{
chooseCar(val){
this.tCar=val
},
changeCategory(val){
},
toDetail(){
uni.navigateTo({
url:'/pages/questionBank/videoDetail?type=test'
})
}
}
}
</script>
<style scoped>
::v-deep .u-tabs__wrapper__nav__line {
background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%) !important;
bottom: 14rpx !important;
}
.car_item{
font-size: 28rpx;
padding:0 34rpx;
height: 58rpx;
line-height: 58rpx;
border-radius: 29rpx;
}
.checked_car{
background-color: #05C341;
color: #fff;
}
.unchecked_car{
border: 1px solid #DDD;
color: #666;
box-sizing: border-box;
}
.pic{
width: 300rpx;
height: 169rpx;
background: #00B74F;
border-radius: 8rpx;
}
::v-deep .u-tabs__wrapper__nav__item{
padding: 0 !important;
}
</style>

View File

@@ -2,8 +2,8 @@
<view class="flex fld-c p15">
<u-sticky>
<view class="flex ai-c">
<view v-for="(item,index) in vipAllList" :key="index" class="km-item" :class="{ actived: index==current }"
@click="current=index">
<view v-for="(item, index) in vipAllList" :key="index" class="km-item" :class="{ actived: index == current }"
@click="current = index">
{{ getKmTitle(item.subjects) }}
</view>
</view>
@@ -11,17 +11,17 @@
<view class="mt15">
<swiper class="swiper" :current="current" style="height: 120px;" :autoplay="false" :display-multiple-items="1.45"
:disable-programmatic-animation="true" @change="onChange">
<swiper-item v-for="(item,index) in vipAllList" :key="index">
<swiper-item v-for="(item, index) in vipAllList" :key="index">
<view class="relative">
<image src="../../static/image/mine/vip_card.png" mode="widthFix" style="width:95%;"></image>
<view class="vip-info">
<u-avatar class="br-p50 overflow-h" style="border: 3px solid #873E1D;" :size="35" mp-avatar></u-avatar>
<view class="ml10">
<view class="fs16 fwb" style="color: #7E4012;line-height: 16px;">
{{item.memberName}}
{{ item.memberName }}
</view>
<view class="mt5 fs12" style="color: #7E4012;line-height: 12px;">
{{getExpireText(item)}}
{{ getExpireText(item) }}
</view>
</view>
</view>
@@ -29,7 +29,7 @@
VIP已开通
</view>
<view v-if="vipHasOpened(item)" class="renew">
{{item.price}}元立即续费
{{ item.price }}元立即续费
</view>
<view v-else class="buy">
立即充值
@@ -43,10 +43,10 @@
<view class="mt20">
<swiper class="swiper" :current="current" style="height: 300px;" :autoplay="false"
:disable-programmatic-animation="true" @change="onChange">
<swiper-item v-for="(item,index) in vipAllList" :key="index">
<swiper-item v-for="(item, index) in vipAllList" :key="index">
<view v-if="index == 0 || index == 3" class="p15 br8 cor-fff">
<view class="fs18 cor-000 fwb">
3步轻松学{{getKmTitle(item.subjects)}}
3步轻松学{{ getKmTitle(item.subjects) }}
</view>
<view class="mt25 flex ai-c jc-sb">
<view class="flex ai-c">
@@ -106,7 +106,7 @@
<view class="flex ai-c mt20">
<image src="../../static/image/index/index_bg.png" mode="widthFix" style="flex: 1;border-radius: 33rpx;"></image>
<view class="ml18 text-center">
<u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff"
<u-button :customStyle="{ width: '200rpx', height: '66rpx', borderRadius: '33rpx' }" iconColor="#fff"
text="去看视频" color="linear-gradient(90deg, #E66501 0%, #F8A42C 100%)" icon="play-circle" @click="toPlaceLive(item)">
</u-button>
<view class="cor-333 fs15 mt17">真实考场模拟</view>
@@ -115,198 +115,198 @@
</view>
</view>
</swiper-item>
<swiper-item>
</swiper-item>
</swiper>
</view>
</view>
</template>
<script>
import useUserStore from '@/jtools/store/user'
export default {
computed: {
vipAllList() {
return useUserStore().vipAllList.filter(it=>[1,2,3,4].includes(Number(it.subjects)))
},
vipOnList() {
return useUserStore().vipOnList
},
import useUserStore from '@/jtools/store/user'
export default {
computed: {
vipAllList() {
return useUserStore().vipAllList.filter(it => [1, 2, 3, 4].includes(Number(it.subjects)))
},
data() {
vipOnList() {
return useUserStore().vipOnList
},
},
data() {
return {
current: 0
}
},
methods: {
onChange(e) {
this.current = e.detail.current
},
getKmTitle(km) {
return {
current: 0
'1': '科一',
'2': '科二',
'3': '科三',
'4': '科四',
}[km]
},
getExpireText(item) {
const vipOn = this.vipOnList.find(it => it.memberId == item.memberId)
if (vipOn) {
return `${vipOn.endDate.split(' ')[0]}到期`
} else {
return '开通vip助您快速拿证'
}
},
methods: {
onChange(e) {
this.current = e.detail.current
},
getKmTitle(km) {
return {
'1': '科一',
'2': '科二',
'3': '科三',
'4': '科四',
}[km]
},
getExpireText(item) {
const vipOn = this.vipOnList.find(it => it.memberId == item.memberId)
if(vipOn) {
return `${vipOn.endDate.split(' ')[0]}到期`
} else {
return '开通vip助您快速拿证'
}
},
vipHasOpened(item) {
return !!this.vipOnList.find(it => it.memberId == item.memberId)
},
// 去精选500题 item=> 当前科目vip信息
to500(item) {
// 当前vip是否已开通
if(this.vipHasOpened(item)) {
// 跳转
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
icon: 'none'
})
}
},
// 去真实考场 item=> 当前科目vip信息
toRealExam(item) {
// 当前vip是否已开通
if(this.vipHasOpened(item)) {
// 跳转
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
icon: 'none'
})
}
},
// 去秘卷 item=> 当前科目vip信息
toSpecExam(item) {
// 当前vip是否已开通
if(this.vipHasOpened(item)) {
// 跳转
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
icon: 'none'
})
}
},
// 去考场实况 item=> 当前科目vip信息
toPlaceLive(item) {
// 当前vip是否已开通
if(this.vipHasOpened(item)) {
// 跳转
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
icon: 'none'
})
}
vipHasOpened(item) {
return !!this.vipOnList.find(it => it.memberId == item.memberId)
},
// 去精选500题 item=> 当前科目vip信息
to500(item) {
// 当前vip是否已开通
if (this.vipHasOpened(item)) {
// 跳转
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
icon: 'none'
})
}
},
// 去真实考场 item=> 当前科目vip信息
toRealExam(item) {
// 当前vip是否已开通
if (this.vipHasOpened(item)) {
// 跳转
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
icon: 'none'
})
}
},
// 去秘卷 item=> 当前科目vip信息
toSpecExam(item) {
// 当前vip是否已开通
if (this.vipHasOpened(item)) {
// 跳转
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
icon: 'none'
})
}
},
// 去考场实况 item=> 当前科目vip信息
toPlaceLive(item) {
// 当前vip是否已开通
if (this.vipHasOpened(item)) {
// 跳转
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
icon: 'none'
})
}
}
}
}
</script>
<style lang="scss" scoped>
.km-item {
margin-right: 8px;
width: 72px;
height: 30px;
line-height: 30px;
font-size: 12px;
color: #333;
text-align: center;
border-radius: 15px;
border: 1px solid #CCCCCC;
}
.km-item {
margin-right: 8px;
width: 72px;
height: 30px;
line-height: 30px;
font-size: 12px;
color: #333;
text-align: center;
border-radius: 15px;
border: 1px solid #CCCCCC;
}
.actived {
background: linear-gradient(90deg, #E66501 0%, #F8A42C 100%);
color: #fff;
}
.actived {
background: linear-gradient(90deg, #E66501 0%, #F8A42C 100%);
color: #fff;
}
.km-item:last-of-type {
margin-right: 0;
}
.km-item:last-of-type {
margin-right: 0;
}
.vip-info {
position: absolute;
top: 15px;
left: 10px;
display: flex;
align-items: center;
}
.vip-info {
position: absolute;
top: 15px;
left: 10px;
display: flex;
align-items: center;
}
.corner {
position: absolute;
bottom: 0;
left: 0;
width: 77px;
height: 23px;
background: linear-gradient(0deg, #E66501 0%, #F8A42C 100%);
opacity: 0.86;
border-radius: 0px 8px 0px 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
color: #fff;
}
.corner {
position: absolute;
bottom: 0;
left: 0;
width: 77px;
height: 23px;
background: linear-gradient(0deg, #E66501 0%, #F8A42C 100%);
opacity: 0.86;
border-radius: 0px 8px 0px 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
color: #fff;
}
.renew {
position: absolute;
right: 10%;
bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 185rpx;
height: 52rpx;
background: #873E1D;
border-radius: 26rpx;
font-size: 12px;
color: #F6E99F;
}
.buy {
position: absolute;
left: 45%;
transform: translateX(-50%);
bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 200rpx;
height: 60rpx;
background: #873E1D;
border-radius: 30rpx;
font-size: 14px;
color: #F6E99F;
}
.renew {
position: absolute;
right: 10%;
bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 185rpx;
height: 52rpx;
background: #873E1D;
border-radius: 26rpx;
font-size: 12px;
color: #F6E99F;
}
.study {
display: flex;
align-items: center;
justify-content: center;
width: 161rpx;
height: 67rpx;
background: #F6E99F;
border-radius: 34rpx;
font-size: 12px;
color: #873E1D;
}
.video-box {
padding: 20rpx;
width: 694rpx;
height: 369rpx;
background: #F9F3E7;
border: 2rpx solid #CF8B6D;
border-radius: 16rpx;
}
.buy {
position: absolute;
left: 45%;
transform: translateX(-50%);
bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
width: 200rpx;
height: 60rpx;
background: #873E1D;
border-radius: 30rpx;
font-size: 14px;
color: #F6E99F;
}
.study {
display: flex;
align-items: center;
justify-content: center;
width: 161rpx;
height: 67rpx;
background: #F6E99F;
border-radius: 34rpx;
font-size: 12px;
color: #873E1D;
}
.video-box {
padding: 20rpx;
width: 694rpx;
height: 369rpx;
background: #F9F3E7;
border: 2rpx solid #CF8B6D;
border-radius: 16rpx;
}
</style>

View File

@@ -1,30 +1,37 @@
<template>
<view>
<view class="chapter_item p14" v-for="(item,index) of chapterList" :key="index" @tap="toQuestion">
{{item.label}}
<view class="chapter_item p14" v-for="(item,index) of chapterList" :key="index" @tap="toQuestion(item.configItemCode)">
{{item.configItemName}}
</view>
</view>
</template>
<script>
import {
querySysConfigList
} from '@/jtools/api/question';
import storage from '@/jtools/storage';
export default {
data() {
return {
chapterList:[
{label:'驾驶证申请相关'},
{label:'驾驶证申请相关'},
{label:'驾驶证登记处罚'},
{label:'机动车强制报废'},
{label:'其他考点'},
{label:'驾驶证登记处罚'},
{label:'机动车强制报废'},
{label:'其他考点'}]
chapterList:[]
}
},
onLoad(){
this.getChapterList()
},
methods:{
toQuestion(){
getChapterList(){
const carTypeId=storage.get('carType') || '1001'
querySysConfigList(carTypeId,'ChapterOfSubjectOne').then(resp=>{
if(resp.code==='0000'){
this.chapterList=resp.data
}
})
},
toQuestion(code){
uni.navigateTo({
url:"/pages/questionBank/questionBank?navTitle="+章节技巧
url:"/pages/questionBank/questionBank?navTitle=章节技巧&chapter="+code
})
}
}

View File

@@ -5,45 +5,47 @@
<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>
<swiper class="swiper mt20" :current="swiperIndex" :duration="duration" :autoplay="false" :disable-programmatic-animation="true" @change="onChange" @animationfinish="onAnimationfinish" @touchend="touchEnd" >
<swiper class="swiper mt20" :current="swiperIndex" :duration="duration" :autoplay="false" :disable-programmatic-animation="true" @change="onChange" @animationfinish="onAnimationfinish" @touchend="touchEnd" >
<swiper-item v-for="(quesItem,quesIndex) in swiperList" :key="quesIndex">
<scroll-view scroll-y="true" class="swiper-scroll">
<view>
<view class="m14lr">
<text class="tag_box">{{quesItem.questionTypeDesc}}</text>
<text class="fs18">{{quesItem.questionDesc}}</text>
<text class="tag_box">{{getQuestType(quesItem.type)}}</text>
<text class="fs18">{{quesItem.question}}</text>
</view>
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList"
:key="item.op" @tap="answerQues(item.op,index)">
<template
v-if="quesItem.clickAnswer&&item.op===quesItem.rightOp">
<u-icon class="mr15" name="checkmark-circle-fill" color="#05C341" size="30"></u-icon>
</template>
<template
v-else-if="quesItem.clickAnswer===item.op&&item.op!==quesItem.rightAnswer">
<u-icon class="mr15" name="close-circle-fill" color="red" size="30"></u-icon>
</template>
<template v-else-if="!item.chooseOption">
<view class="option_item">{{item.op}}</view>
</template>
<text class="fs18">{{item.opDesc}}</text>
:key="item.op" @tap="answerQues(item.opValue,index)">
<template v-if="item.opDesc">
<template
v-if="quesItem.clickAnswer&&quesItem.trueAnswer.includes(item.opValue)">
<u-icon class="mr15" name="checkmark-circle-fill" color="#05C341" size="32"></u-icon>
</template>
<template
v-else-if="quesItem.clickAnswer&&quesItem.clickAnswer.includes(item.opValue)&&!quesItem.trueAnswer.includes(item.opValue)">
<u-icon class="mr15" name="close-circle-fill" color="red" size="32"></u-icon>
</template>
<template v-else-if="!item.chooseOption">
<view class="option_item">{{item.op}}</view>
</template>
<text class="fs18">{{item.opDesc}}</text>
</template>
</view>
<view class="m14lr mt30"
v-if="quesItem.clickAnswer&&quesItem.clickAnswer!==quesItem.rightOp || tCurrent===1">
v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer) || tCurrent===1">
<view class="answer_box">
<text class="fs18 fw600 cor-000">答案:{{quesItem.rightOp}}</text>
<view class="fs18 cor-000" style="text-indent:2em;"> 这里是相关解释文字这里是相关解释文字相关解释文字</view>
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
<view class="fs18 cor-000" style="text-indent:2em;"> {{quesItem.bestAnswer}}</view>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
<view class="wp100 flex jc-sb ai-c p14 bc-fff" v-if="isShowAll" style="position: fixed;bottom: 0;left: 0;">
<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;">
<button v-if="type==='practice'" class="btn">四步学科一</button>
<view v-else class="btn" style="text-align: center;" @tap="submitPaper">
<u-count-down ref="countDown_1" :time="1 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
<u-count-down ref="countDown_1" :time=" 1*60*60 * 1000" format="HH:mm:ss" @change="timeChange"></u-count-down>
<text>交卷</text>
</view>
</view>
@@ -90,15 +92,15 @@
<text>确认交卷</text>
<view class="mt20 flex ai-c jc-sb">
<view class="text-center">
<text style="color:#FF6E02">99</text>
<text style="color:#FF6E02">{{questionList.length-rightList.length-wrongList.length}}</text>
<view class="cor-333">未答题数</view>
</view>
<view class="text-center">
<u-count-down ref="countDown_3" class="balckColor" :time="1 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
<u-count-down ref="countDown_3" class="balckColor" :time="1*60*60 * 1000" format="HH:mm:ss"></u-count-down>
<view>剩余时间</view>
</view>
<view class="text-center">
<text style="color:#333">9</text>
<text style="color:#333">{{(rightList.length/questionList.length * 100).toFixed(0)}}</text>
<view class="cor-333">考试得分</view>
</view>
</view>
@@ -139,7 +141,7 @@
<text class="cor-666">题板</text>
</view>
</view>
<view class="flex ai-c jc-sb p14" style="flex-wrap: wrap;max-height: 400px;overflow-y: scroll;">
<view class="flex ai-c jc-fs p14" style="flex-wrap: wrap;max-height: 400px;overflow-y: scroll;">
<view v-for="(item,index) of questionList" :key="index" style="width:20%;" class="flex ai-c jc-c" @tap="chooseQueston(index)">
<view class="tCircle mb10" :class="{
'active':index == topicIndex,
@@ -186,7 +188,15 @@
</template>
<script>
import {
mapState,
mapActions
} from 'pinia' //引入映射函数
import storage from '@/jtools/storage';
import useQuestionStore from '@/jtools/store/question' //引入store
import {
submitTest
} from '@/jtools/api/question';
export default {
props:{
tabsList:{
@@ -203,6 +213,13 @@ export default {
isShowAll:{
type:Boolean,
default:true
},
subject:{
type:[String,Number],
default:1,
},
navTitle:{
type:String
}
},
data() {
@@ -218,20 +235,58 @@ export default {
qIndex:0,
rightList:[],
wrongList:[],
collectList:storage.get('collectList') || [],
questionList: [],//数据源
collectList:storage.get(`collectList_subject${this.subject}`) || [],
questionList: [{isCollect:true}],//数据源
swiperList: [], // 轮播图数据列表
swiperIndex: 0, // 轮播图当前位置
isChange: false, // 是否切换
topicIndex: 0, // 题目位置
duration: 200, // 动画过渡时长
time:0,
}
},
onLoad() {
this.getQuestionList()
this.renderSwiper(0)
},
computed: {
...mapState(useQuestionStore, ["currentIndex_subject1","currentIndex_subject2"]) //映射函数取出tagslist
},
methods: {
...mapActions(useQuestionStore,['getCurrentIndex']),
timeChange(e){
this.time=e
if(e.hours==0&&e.minutes==0&&e.seconds==0&&e.milliseconds==0){
uni.showToast({
title:"考试结束,将为您自动交卷~",
icon:'none'
})
setTimeout(()=>{
this.toSubmit()
},1000)
}
},
//获取正确选项
getRightOp(val){
let rightOp=''
this.questionList[this.topicIndex].optionList.forEach(item=>{
if(this.questionList[this.topicIndex].trueAnswer.includes(item.opValue)){
if(rightOp){
rightOp=rightOp+'、'+item.op
}else{
rightOp=item.op
}
}
})
return rightOp
},
//获取题类型
getQuestType(val){
if(val=='1'){
return '判断'
}else if(val=='2'){
return '单选'
}else if(val=='3'){
return '多选'
}
},
//开通VIP
toVip(){
this.showVip=true
@@ -255,14 +310,29 @@ export default {
},
//交卷
toSubmit(){
uni.navigateTo({
url:"/pages/questionBank/examResult"
const restTime=this.time.hours*60*60+this.time.minutes*60+this.time.seconds
const score=(this.rightList.length/this.questionList.length * 100).toFixed(0)
submitTest({
"carTypeId": storage.get('carType') || '1001',
"score": score,
"testTime": 60*60-restTime,
subject:this.subject
}).then(resp=>{
const doNotNum=this.questionList.length-this.rightList.length-this.wrongList.length
const list = JSON.stringify(this.wrongList)
if(resp.code==='0000'){
uni.navigateTo({
url:"/pages/questionBank/examResult?doNotNum="+doNotNum+"&wrongList="+list+"&score="+score+"&subject="+this.subject+"&navTitle="+this.navTitle
})
}
})
},
//查看考试结果
toResult(){
const allDoNum=this.wrongList.length+this.rightList.length
const list = JSON.stringify(this.wrongList)
uni.navigateTo({
url:"/pages/questionBank/practiceResult"
url:"/pages/questionBank/practiceResult?allDoNum="+allDoNum+"&wrongList="+list+"&subject="+this.subject+"&navTitle="+this.navTitle
})
},
toCollect(){
@@ -284,7 +354,7 @@ export default {
icon:'none'
})
}
storage.set('collectList',this.collectList)
storage.set(`collectList_subject${this.subject}`,this.collectList)
},
cancel(){
this.tipShow=false
@@ -337,6 +407,7 @@ export default {
// 轮播图当前位置小于原来时则表示为上一题
this.topicIndex--;
}
this.getCurrentIndex(this.topicIndex,this.subject)
// 更新轮播图位置数值,为更新时让 Vue 能监听到数据有改变
this.swiperIndex = e.detail.current;
},
@@ -362,24 +433,44 @@ export default {
// 选择题目
pickerTopic(index) {
this.topicIndex = index;
this.index=this.topicIndex
this.getCurrentIndex(this.topicIndex,this.subject)
this.renderSwiper(index);
},
isArrEqual(arr1, arr2){
return arr1.length === arr2.length && arr1.every((ele) => arr2.includes(ele));
},
//答题
answerQues(op, index) {
if (!this.questionList[this.topicIndex].clickAnswer) {
this.questionList[this.topicIndex].optionList[index].chooseOption = op
this.questionList[this.topicIndex].clickAnswer = op
}
const falseList =storage.get(`wrongList_subject${this.subject}`) || []
const trueList =storage.get(`rightList_subject${this.subject}`) || []
if (!this.questionList[this.topicIndex].clickAnswer) {
this.questionList[this.topicIndex].optionList[index].chooseOption =`${this.questionList[this.topicIndex].optionList[index].chooseOption?this.questionList[this.topicIndex].optionList[index].chooseOption:''}${op}`
this.questionList[this.topicIndex].clickAnswer = `${this.questionList[this.topicIndex].optionList[index].clickAnswer?this.questionList[this.topicIndex].optionList[index].clickAnswer:''}${op}`
}
if(this.tCurrent!==1){
if(this.questionList[this.topicIndex].clickAnswer===this.questionList[this.topicIndex].rightOp){
const arr1=this.questionList[this.topicIndex].clickAnswer.split('')
const arr2=this.questionList[this.topicIndex].trueAnswer.split('')
if(this.isArrEqual(arr1,arr2)){
//判断选择的答案和实际的答案是否相同如果相同判断如果该题的ID在不在正确的数组中不在则Push(存储的的同理)
//如果这道题在错误的数组中则把这道题在错误数组中删掉
if(!this.rightList.includes(this.questionList[this.topicIndex].questionId)){
this.rightList.push(this.questionList[this.topicIndex].questionId)
}
console.log(this.rightList);
if(!trueList.includes(this.questionList[this.topicIndex].questionId)){
trueList.push(this.questionList[this.topicIndex].questionId)
storage.set(`rightList_subject${this.subject}`,trueList)
}
if(this.wrongList.includes(this.questionList[this.topicIndex].questionId)){
const wIndex=this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
this.wrongList.splice(wIndex,1)
}
if(falseList.includes(this.questionList[this.topicIndex].questionId)){
const wIndex=falseList.indexOf(this.questionList[this.topicIndex].questionId)
falseList.splice(wIndex,1)
storage.set(`wrongList_subject${this.subject}`,falseList)
}
//答对题目 如果不是最后一题,跳下一题
if(this.topicIndex<this.questionList.length-1){
this.topicIndex ++;
this.qIndex=this.topicIndex
@@ -403,6 +494,15 @@ export default {
if(!this.wrongList.includes(this.questionList[this.topicIndex].questionId)){
this.wrongList.push(this.questionList[this.topicIndex].questionId)
}
if(!falseList.includes(this.questionList[this.topicIndex].questionId)){
falseList.push(this.questionList[this.topicIndex].questionId)
storage.set(`wrongList_subject${this.subject}`,falseList)
}
if(trueList.includes(this.questionList[this.topicIndex].questionId)){
const rIndex=trueList.indexOf(this.questionList[this.topicIndex].questionId)
trueList.splice(rIndex,1)
storage.set(`rightList_subject${this.subject}`,trueList)
}
}
}
},
@@ -411,309 +511,24 @@ export default {
this.getQuestionList()
this.renderSwiper(0)
},
getQuestionList() {
this.questionList = [{
questionId: 0,
questionTypeDesc: '单选',
questionDesc: '第一题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'C',
}, {
questionId: 1,
questionTypeDesc: '单选',
questionDesc: '第二题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'B',
}, {
questionId: 2,
questionTypeDesc: '单选',
questionDesc: '第三题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
},
{
questionId: 3,
questionTypeDesc: '单选',
questionDesc: '第四题,在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 4,
questionTypeDesc: '单选',
questionDesc: '第5题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
},
{
questionId: 5,
questionTypeDesc: '单选',
questionDesc: '第6题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 6,
questionTypeDesc: '单选',
questionDesc: '第7题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 7,
questionTypeDesc: '单选',
questionDesc: '第8题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 8,
questionTypeDesc: '单选',
questionDesc: '第9题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'C',
}, {
questionId: 9,
questionTypeDesc: '单选',
questionDesc: '第10题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'B',
}, {
questionId: 10,
questionTypeDesc: '单选',
questionDesc: '第11题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
},
{
questionId: 11,
questionTypeDesc: '单选',
questionDesc: '第12题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 12,
questionTypeDesc: '单选',
questionDesc: '第13题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
},
{
questionId: 13,
questionTypeDesc: '单选',
questionDesc: '第14题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 14,
questionTypeDesc: '单选',
questionDesc: '第15题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}, {
questionId: 15,
questionTypeDesc: '单选',
questionDesc: '第16题在实习期内驾驶机动车的应当在车身后部粘贴或者悬挂哪种标志',
optionList: [{
op: 'A',
opDesc: '注意新手标志'
}, {
op: 'B',
opDesc: '注意新手标志'
}, {
op: 'C',
opDesc: '注意新手标志'
}, {
op: 'D',
opDesc: '注意新手标志'
}],
rightOp: 'A',
}
]
if(this.tCurrent===1){
this.questionList=this.questionList.map(item=>{
return{
...item,
clickAnswer:item.rightOp
}
})
}
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({
isCollect:isCollect,
...item
})
})
if(this.navTitle==='顺序答题'){
this.pickerTopic(this[`currentIndex_subject${this.subject}`])
}else{
this.renderSwiper(0)
}
}
}
}

View File

@@ -1,23 +1,24 @@
<template>
<view>
<!-- <u-navbar title="本次成绩" @rightClick="rightClick" :autoBack="true"></u-navbar> -->
<j-navbar>本次成绩</j-navbar>
<j-navbar backPath="/pages/index/index">本次成绩</j-navbar>
<view class="p14 wp100">
<GradesChart color="#FF6E02" titleName="32分" :actualValue="0.32" />
<GradesChart color="#FF6E02" :titleName="score+'分'" :actualValue="Number(scorePrecent)" />
<view class="top_box flex jc-c" style="flex-direction: column;">
<view class="wp100 text-center" style="margin-top: -153rpx;">
<text>太棒了正确率很高了</text>
<text v-if="score>=90">太棒了正确率很高了</text>
<text v-else>很遗憾考试不及格</text>
<button class="centerBtn">马上提分</button>
<view class="flex ai-c jc-c">
<view class="flex ai-c jc-c mt10">
<view class="text-center wp33">
<view>99</view>
<view>{{doNotNum}}</view>
<text>未做题</text>
</view>
<view class="text-center wp33">
<view>12</view>
<view class="text-center wp33" @tap="toQuestionBank">
<view>{{wrongList.length}}</view>
<text>看错题</text>
</view>
<view class="text-center wp33 flex jc-c ai-c" style="flex-direction: column;">
<view class="text-center wp33 flex jc-c ai-c" style="flex-direction: column;" @tap="toExams">
<u-icon name="edit-pen" size="28"></u-icon>
<text>重新考试</text>
</view>
@@ -39,18 +40,31 @@
<text style="color: #00B74F;position: absolute;right:33px;top:-13px">及格线</text>
</view>
</view>
<view class="wp100 text-center bc-fff pb10">
<text>近五次模考成绩</text>
</view>
</view>
</view>
</template>
<script>
import GradesChart from "./components/GradesChart.vue"
import storage from '@/jtools/storage';
import {
testTotal
} from '@/jtools/api/question';
export default {
components: {
GradesChart
},
data() {
return {
navTitle:"模拟考试",
subject:1,
doNotNum:0,
wrongList:undefined,
score:0,
scorePrecent:0,
chartData: {},
//您可以通过修改 config-ucharts.js 文件中下标为 ['line'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
opts: {
@@ -84,26 +98,64 @@
}
};
},
onLoad(op){
if(op.doNotNum){
this.doNotNum=op.doNotNum
}
if(op.wrongList){
this.wrongList=JSON.parse(op.wrongList) || []
}
if(op.score){
this.score=op.score
this.scorePrecent=(this.score/100).toFixed(2)
}
if(op.subject){
this.subject=op.subject
}
if(op.navTitle){
this.navTitle=op.navTitle
}
},
onReady() {
this.getServerData();
},
methods: {
getServerData() {
//模拟从服务器获取数据时的延时
setTimeout(() => {
//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
let res = {
categories: ["2018","2019","2020","2021","2022","2023"],
series: [{
name: "",
data: [90]
},
]
};
this.chartData = JSON.parse(JSON.stringify(res));
}, 500);
testTotal({
"carTypeId": storage.get('carType') || '1001',
"subject": this.subject
}).then(resp=>{
if(resp.code==='0000'){
if(resp.data&&resp.data.recentTestList&&resp.data.recentTestList.length){
const scoreList =resp.data.recentTestList.map(item=>{
return item.score
})
let res = {
categories: ["第一次","第二次","第三次","第四次","第五次"],
series: [{
name: "",
data: scoreList
},
]
};
this.chartData = JSON.parse(JSON.stringify(res));
}
}
})
},
}
toQuestionBank(){
const list =JSON.stringify(this.wrongList)
uni.navigateTo({
url:"/pages/questionBank/questionBank?navTitle=错题&subject="+this.subject+"&questionList="+list
})
},
//重新考试
toExams(){
uni.navigateTo({
url:"/pages/questionBank/practiceExams?subject="+this.subject
})
},
},
}
</script>
@@ -118,6 +170,7 @@
width: 349rpx;
height: 76rpx;
background: #DEEFE5;
border:none;
border-radius: 38rpx;
line-height: 76rpx;
text-align: center;

View File

@@ -2,17 +2,16 @@
<view>
<!-- <u-navbar title="模拟考试" @rightClick="rightClick" :autoBack="true">
</u-navbar> -->
<j-navbar>模拟考试</j-navbar>
<Question :tabsList="tabsList" v-model:isSubmit="isSubmit" type="exam" />
<j-navbar :isDefineBack="true" @toBack="toBack">模拟考试</j-navbar>
<Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" type="exam" :subject="subject" navTitle="模拟考试" />
</view>
</template>
<script>
import {
mapState,
mapActions
} from 'pinia' //引入映射函数
import useQuestionStore from '@/jtools/store/question' //引入store
getTestQuestion
} from '@/jtools/api/question';
import storage from '@/jtools/storage';
import Question from './components/Question.vue';
export default {
components: {
@@ -20,6 +19,7 @@
},
data() {
return {
subject:1,
isSubmit:false,
tabsList:[{
label:"模拟考试",
@@ -30,15 +30,24 @@
}]
}
},
onLoad() {
console.log(this.orderQuestionList);
onLoad(op) {
if(op.subject){
this.subject=op.subject
getTestQuestion({
carTypeId: storage.get('carType') || '1001',
subject: this.subject
}).then(resp=>{
if(resp.code==='0000'){
this.$refs.question.getQuestionList(JSON.stringify(resp.data))
}
})
}
},
computed: {
...mapState(useQuestionStore, ["orderQuestionList"]) //映射函数取出tagslist
},
methods: {
rightClick() {
console.log('返回');
toBack(){
this.$refs.question.submitPaper()
}
}
}

View File

@@ -1,18 +1,18 @@
<template>
<view>
<!-- <u-navbar title="本次练题结果" @rightClick="rightClick" :autoBack="true"></u-navbar>-->
<j-navbar>本次练题结果</j-navbar>
<j-navbar backPath="/pages/index/index">本次练题结果</j-navbar>
<view class="p14 wp100">
<GradesChart />
<GradesChart :titleName="rightPencentDesc" :actualValue="Number(rightPencent)" />
<view class="top_box flex jc-c" style="flex-direction: column;">
<view class="wp100 text-center" >
<text>太棒了正确率很高了</text>
<view class="flex ai-c jc-c mt10">
<view class="text-center wp50">
<view>1/3</view>
<view class="text-center wp50" @tap="toQuestionBank">
<view>{{wrongList.length}}/{{allDoNum}}</view>
<text>本次错题</text>
</view>
<view class="text-center wp50 flex jc-c ai-c" style="flex-direction: column;">
<view class="text-center wp50 flex jc-c ai-c" style="flex-direction: column;" @tap="toContiune">
<u-icon name="file-text" size="28"></u-icon>
<text>继续做题</text>
</view>
@@ -27,10 +27,10 @@
<text class="fs18 cor-000 fw600">累计练题</text>
<text class="fs14 cor-666 ml10">33</text>
</view>
<text class="fs14 cor-666">未做题2311</text>
<text class="fs14 cor-666">未做题{{getNotDoNum}}</text>
</view>
<view class="mt10">
<u-line-progress :percentage="20" activeColor="#05C341" height="16"></u-line-progress>
<u-line-progress :percentage="percent" activeColor="#05C341" height="16"></u-line-progress>
</view>
<view class="p14 mt10 flex ai-c jc-sb" style="border-radius: 20rpx;background-color: rgb(253,249,238);">
<view>
@@ -47,6 +47,12 @@
</template>
<script>
import {
mapState,
mapActions
} from 'pinia' //引入映射函数
import storage from '@/jtools/storage';
import useQuestionStore from '@/jtools/store/question' //引入store
import GradesChart from "./components/GradesChart.vue"
export default {
components: {
@@ -54,11 +60,54 @@
},
data() {
return {
rightPencent:0,
rightPencentDesc:'',
allDoNum:0,
wrongList:[],
subject:1,
allRightList:[],
allWrongList:[],
percent:undefined,
navTitle:'顺序练习',
}
},
onLoad(op){
if(op.allDoNum){
this.allDoNum=op.allDoNum
}
if(op.navTitle){
this.navTitle=op.navTitle
}
if(op.wrongList){
this.wrongList=JSON.parse(op.wrongList)
this.rightPencent=((this.allDoNum-this.wrongList.length)/this.allDoNum).toFixed(2)
this.rightPencentDesc=(this.rightPencent*100).toFixed(0)+'%'
}
if(op.subject){
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)
}
},
computed: {
...mapState(useQuestionStore, ["orderQuestion"]), //映射函数取出tagslist
getNotDoNum(){
return this.orderQuestion.length-(this.allRightList.length+this.allWrongList.length)
}
},
methods: {
toQuestionBank(){
const list =JSON.stringify(this.wrongList)
uni.navigateTo({
url:"/pages/questionBank/questionBank?navTitle=错题&subject="+this.subject+"&questionList="+list
})
},
toContiune(){
uni.navigateTo({
url:"/pages/questionBank/questionBank?navTitle="+this.navTitle+"&subject="+this.subject
})
}
}
}
</script>

View File

@@ -3,7 +3,7 @@
<!-- <u-navbar :title="navTitle" @rightClick="rightClick" :autoBack="true">
</u-navbar> -->
<j-navbar>{{navTitle}}</j-navbar>
<Question :tabsList="tabsList" :isShowAll="true" />
<Question ref="question" :tabsList="tabsList" :isShowAll="isShowAll" :subject="subject" :navTitle="navTitle"></Question>
</view>
</template>
@@ -13,13 +13,21 @@
mapActions
} from 'pinia' //引入映射函数
import useQuestionStore from '@/jtools/store/question' //引入store
import useUserStore from '@/jtools/store/user'
import Question from './components/Question.vue';
import {
queryQuestion
} from '@/jtools/api/question';
import storage from '@/jtools/storage';
export default {
components: {
Question
},
data() {
return {
isShowAll:true,
needVip:false,
subject:1,
navTitle:'',
tabsList:[{
label:"答题",
@@ -27,18 +35,64 @@
},{
label:"背题",
value:1
}]
}],
questionArr:[]
}
},
onLoad(op) {
async onLoad(op) {
if(op.needVip){
this.needVip=op.needVip
}
if(op&&op.navTitle){
this.navTitle=op.navTitle
const param={}
if(this.navTitle==='顺序答题'||this.navTitle==='精简500题'){
this.questionArr=[...this.orderQuestion]
if(this.needVip==='true'){
if(this.token){
await this.searchUserVip()
const res=this.vipOnList.some(item=>item.subject==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==='错题本'){
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
}
queryQuestion(param).then(res => {
if (res.code == '0000') {
this.questionArr = res.data
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
}
})
}
}
if(op.subject){
this.subject=op.subject
}
},
computed: {
...mapState(useQuestionStore, ["orderQuestionList"]) //映射函数取出tagslist
...mapState(useQuestionStore, ["orderQuestion"]) ,//映射函数取出tagslist
...mapState(useUserStore, ["vipOnList","token"])
},
methods: {
...mapActions(useUserStore,['searchUserVip']),
rightClick() {
console.log('返回');
},

View File

@@ -2,12 +2,18 @@
<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" @timeupdate="timeupdate" />
<view class="p14 bc-fff">
<u-scroll-list :indicator="false" v-if="videoType=='test'">
<view class="flex ai-c jc-sb mt15">
<view class="tab_iem mr15" :class="videoIndex===item.value?'checked_tab':''" v-for="(item,index) of testList" :key="index" @tap="checkTest(item.value)">{{item.label}}</view>
</view>
</u-scroll-list>
<view class="flex ai-c jc-sb mt10 wp100">
<text class="fs18 fw600 cor-000">C1捷达-基础操作视频讲解</text>
<view class="flex" @tap="popupShow=true">
<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>
</view>
<view v-else class="fs14 cor-666">共9条路线</view>
</view>
<view>
</view>
@@ -53,6 +59,30 @@
export default{
data(){
return{
videoIndex:0,
testList:[{
label:"八一考场",
value:0,
},{
label:"富凯考场",
value:1
},{
label:"新亚考场",
value:2
},{
label:"庐江考场",
value:3
},{
label:"富凯考场",
value:4
},{
label:"新亚考场",
value:5
},{
label:"庐江考场",
value:6
}],
videoType:'',
popupShow:false,
nowVideo:0,
videoList:[{
@@ -82,7 +112,15 @@
}]
}
},
onLoad(op){
if(op.type){
this.videoType=op.type
}
},
methods:{
checkTest(val){
this.videoIndex=val
},
checkVideo(val){
this.nowVideo=val
}
@@ -130,4 +168,17 @@
background: #00B74F;
border-radius: 8rpx;
}
.tab_iem{
width: 145rpx;
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
}
</style>

View File

@@ -17,7 +17,7 @@
<view class="total_box mt10">
<view class="flex ai-c jc-sb">
<view class="text-center">
<view style="width: 111rpx;" class="fs30 cor-000">4</view>
<view style="width: 111rpx;" class="fs30 cor-000">{{tIndex==0?wrongList.length:collectList.length}}</view>
</view>
<view style="text-align: right;flex-direction: column;justify-content: right" class="flex ai-c" @tap="toPractice">
<u-icon name="arrow-right" size="18"></u-icon>
@@ -28,19 +28,19 @@
<text class="fs14 cor-666">全部{{tIndex==0?'错题':'收藏'}}</text>
</view>
<view style="text-align: right;flex-direction: column;justify-content: right" class="flex ai-c">
<text v-if="tIndex==0" class="fs14 cor-666">4/已做100</text>
<text v-if="tIndex==0" class="fs14 cor-666">{{wrongList.length}}/已做{{wrongList.length+rightList.length}}</text>
</view>
</view>
</view>
<view class="yellow_box" v-if="tIndex==0">
<view class="yellow_box" v-if="tIndex==0&&getPercent>10">
<view class="flex jc-sb ai-c">
<view>
<text class="fs24 fw600" style="color: #FF6E02;">32%</text><text class="fs18 cor-000 fw600">错题率</text>
<text class="fs24 fw600" style="color: #FF6E02;">{{getPercent}}%</text><text class="fs18 cor-000 fw600">错题率</text>
<view class="fs14 cor-000">错题率有点高快去提升吧</view>
</view>
<view style="width: 156rpx;">
<!-- <view style="width: 156rpx;">
<button class="riseBtn">马上提升</button>
</view>
</view> -->
</view>
</view>
<view class="flex jc-sb ai-c mt10" v-if="tIndex==0">
@@ -51,7 +51,7 @@
<view style="margin-top: 30rpx;" v-if="tIndex==0">
<view class="video-box">
<view class="flex jc-sb ai-c wp100">
<text style="color: #05C341;font-size: 36rpx;">精品视频课</text>
<text style="color: #05C341;font-size: 36rpx;">{{subject==1?'一':'四'}}精品视频课</text>
<text class="cor-666 fs12">全部10节课 ></text>
</view>
<view class="flex ai-c mt20">
@@ -60,7 +60,7 @@
<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">易错试题</view>
<view class="cor-333 fs15 fw600 mt10">{{subject==1?'一':'四'}}易错试题</view>
</view>
</view>
@@ -75,8 +75,8 @@
</view>
<view class="flex ai-c jc-sb" style="flex-wrap: wrap;">
<view v-for="(item,index) of typeList" :key="index" class="category_item p14 flex jc-sb ai-c mb10">
<text class="cor-000">{{item.typeName}}</text>
<text class="cor-666">{{item.typeNum}}</text>
<text class="cor-000">{{item.categoryName}}</text>
<text class="cor-666">{{item.num}}</text>
</view>
</view>
</view>
@@ -85,44 +85,60 @@
</template>
<script>
import storage from '@/jtools/storage';
import {
questionCategory
} from '@/jtools/api/question';
export default{
data(){
return{
collectList:[],
rightList:storage.get(`rightList_subject${this.subject}`) || [],
wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
subject:0,
tIndex:0,
isMoveWrong:true,
title:'重要提示:所有错题做对,再去考试!',
categoryList:[{
name:'错题本'
},{name:'收藏夹'}],
typeList:[{
typeName:'驾驶证审验注销',
typeNum:1
},{
typeName:'机动车强制报废',
typeNum:2
},{
typeName:'驾驶证审验注销',
typeNum:1
},{
typeName:'机动车强制报废',
typeNum:2
},{
typeName:'驾驶证审验注销',
typeNum:1
},{
typeName:'机动车强制报废',
typeNum:2
}]
typeList:[]
}
},
onLoad(op){
if(op.subject){
this.subject=op.subject
this.rightList=storage.get(`rightList_subject${this.subject}`) || []
this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
this.collectList=storage.get(`collectList_subject${this.subject}`) || []
this.getQuestionCategory()
}
},
computed:{
getPercent(){
return ((this.wrongList.length/(this.wrongList.length+this.rightList.length))*100).toFixed(0)
}
},
methods:{
getQuestionCategory(){
const param={}
if(this.tIndex==0){
param.questionIdList=this.wrongList
}else{
param.questionIdList=this.collectList
}
questionCategory(param).then(resp=>{
this.typeList=resp.data
})
},
tabChange(val){
this.tIndex=val.index
this.getQuestionCategory()
},
toPractice(){
const navTitle=this.tIndex==0?'错题本':'收藏夹'
uni.navigateTo({
url:"/pages/questionBank/questionBank?navTitle="+navTitle
url:"/pages/questionBank/questionBank?navTitle="+navTitle+"&subject="+this.subject
})
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB