提交
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,4 +7,28 @@ export function queryQuestion(data) {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function questionCategory(data) {
|
||||
return request({
|
||||
url: 'driver-api/tdQuestion/questionCategory',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function getTestQuestion(data) {
|
||||
return request({
|
||||
url: 'driver-api/tdQuestion/getTestQuestion',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function submitTest(data) {
|
||||
return request({
|
||||
url: 'driver-api/tdQuestionTest/testSubmit',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
@@ -12,6 +12,8 @@ const question = defineStore({
|
||||
state: () => ({
|
||||
currentCartype: storage.get('carType') || '1001',
|
||||
orderQuestion: [], //顺序做题
|
||||
currentIndex_subject1:0,//科目一索引 顺序做题
|
||||
currentIndex_subject4:0,//科目四索引 顺序做题
|
||||
}),
|
||||
|
||||
actions: {
|
||||
@@ -26,6 +28,10 @@ const question = defineStore({
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取索引
|
||||
getCurrentIndex(index,val){
|
||||
this[`currentIndex_subject${val}`]=index
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -77,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;">科{{type==1?'一':'四'}}精品视频课</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">
|
||||
@@ -86,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">科{{type==1?'一':'四'}}易错试题</view>
|
||||
<view class="cor-333 fs15 fw600 mt10">科{{subject==1?'一':'四'}}易错试题</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -101,14 +101,14 @@
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
export default {
|
||||
props:{
|
||||
type:{
|
||||
subject:{
|
||||
type:[String,Number],
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rightList:storage.get('rightList'),
|
||||
wrongList:storage.get('wrongList'),
|
||||
rightList:storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
allQuestionNum:0,
|
||||
}
|
||||
},
|
||||
@@ -136,12 +136,12 @@
|
||||
},
|
||||
toAnswer(title) {
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&subject="+this.subject
|
||||
})
|
||||
},
|
||||
toExams(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/practiceExams"
|
||||
url:"/pages/questionBank/practiceExams?subject="+this.subject
|
||||
})
|
||||
},
|
||||
toExclusive(){
|
||||
@@ -151,7 +151,7 @@
|
||||
},
|
||||
toWrongList(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/wrongQuestion"
|
||||
url:"/pages/questionBank/wrongQuestion?subject="+this.subject
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</u-sticky>
|
||||
<view style="height: 100vh;background-color: rgb(245, 245, 245);">
|
||||
<template v-if="tIndex===0 || tIndex===3">
|
||||
<Subject1 :type="tIndex+1" />
|
||||
<Subject1 :subject="tIndex+1" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<subject2 />
|
||||
|
||||
@@ -15,18 +15,20 @@
|
||||
</view>
|
||||
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList"
|
||||
:key="item.op" @tap="answerQues(item.opValue,index)">
|
||||
<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 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.trueAnswer.includes(quesItem.clickAnswer) || tCurrent===1">
|
||||
@@ -43,7 +45,7 @@
|
||||
<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>
|
||||
@@ -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,19 +235,34 @@ export default {
|
||||
qIndex:0,
|
||||
rightList:[],
|
||||
wrongList:[],
|
||||
collectList:storage.get('collectList') || [],
|
||||
collectList:storage.get(`collectList_subject${this.subject}`) || [],
|
||||
questionList: [{isCollect:true}],//数据源
|
||||
swiperList: [], // 轮播图数据列表
|
||||
swiperIndex: 0, // 轮播图当前位置
|
||||
isChange: false, // 是否切换
|
||||
topicIndex: 0, // 题目位置
|
||||
duration: 200, // 动画过渡时长
|
||||
time:0,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
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=''
|
||||
@@ -278,8 +310,20 @@ 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,
|
||||
}).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
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//查看考试结果
|
||||
@@ -307,7 +351,7 @@ export default {
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
storage.set('collectList',this.collectList)
|
||||
storage.set(`collectList_subject${this.subject}`,this.collectList)
|
||||
},
|
||||
cancel(){
|
||||
this.tipShow=false
|
||||
@@ -360,6 +404,7 @@ export default {
|
||||
// 轮播图当前位置小于原来时则表示为上一题
|
||||
this.topicIndex--;
|
||||
}
|
||||
this.getCurrentIndex(this.topicIndex,this.subject)
|
||||
// 更新轮播图位置数值,为更新时让 Vue 能监听到数据有改变
|
||||
this.swiperIndex = e.detail.current;
|
||||
},
|
||||
@@ -385,6 +430,7 @@ export default {
|
||||
// 选择题目
|
||||
pickerTopic(index) {
|
||||
this.topicIndex = index;
|
||||
this.getCurrentIndex(this.topicIndex,this.subject)
|
||||
this.renderSwiper(index);
|
||||
},
|
||||
isArrEqual(arr1, arr2){
|
||||
@@ -392,8 +438,8 @@ export default {
|
||||
},
|
||||
//答题
|
||||
answerQues(op, index) {
|
||||
const falseList =storage.get('wrongList') || []
|
||||
const trueList =storage.get('rightList') || []
|
||||
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}`
|
||||
@@ -402,12 +448,14 @@ export default {
|
||||
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)
|
||||
}
|
||||
if(!trueList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
trueList.push(this.questionList[this.topicIndex].questionId)
|
||||
storage.set('rightList',trueList)
|
||||
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)
|
||||
@@ -416,8 +464,9 @@ export default {
|
||||
if(falseList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
const wIndex=falseList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||
falseList.splice(wIndex,1)
|
||||
storage.set('wrongList',falseList)
|
||||
storage.set(`wrongList_subject${this.subject}`,falseList)
|
||||
}
|
||||
//答对题目 如果不是最后一题,跳下一题
|
||||
if(this.topicIndex<this.questionList.length-1){
|
||||
this.topicIndex ++;
|
||||
this.qIndex=this.topicIndex
|
||||
@@ -443,12 +492,12 @@ export default {
|
||||
}
|
||||
if(!falseList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
falseList.push(this.questionList[this.topicIndex].questionId)
|
||||
storage.set('wrongList',falseList)
|
||||
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('wrongList',trueList)
|
||||
storage.set(`rightList_subject${this.subject}`,trueList)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -459,17 +508,23 @@ export default {
|
||||
this.renderSwiper(0)
|
||||
},
|
||||
getQuestionList(val) {
|
||||
console.log(val);
|
||||
this.questionList=val.map(item=>{
|
||||
const arr = JSON.parse(val)
|
||||
this.questionList=[]
|
||||
arr.forEach(item=>{
|
||||
let isCollect=false
|
||||
if(this.collectList.includes(item.questionId)){
|
||||
isCollect=true
|
||||
}
|
||||
return {
|
||||
this.questionList.push({
|
||||
isCollect:isCollect,
|
||||
...item
|
||||
}
|
||||
})
|
||||
})
|
||||
if(this.navTitle==='顺序答题'){
|
||||
this.pickerTopic(this[`currentIndex_subject${this.subject}`])
|
||||
}else{
|
||||
this.renderSwiper(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
<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;">
|
||||
@@ -51,6 +52,11 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
subject:1,
|
||||
doNotNum:0,
|
||||
wrongList:undefined,
|
||||
score:0,
|
||||
scorePrecent:0,
|
||||
chartData: {},
|
||||
//您可以通过修改 config-ucharts.js 文件中下标为 ['line'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
|
||||
opts: {
|
||||
@@ -84,6 +90,21 @@
|
||||
}
|
||||
};
|
||||
},
|
||||
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
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.getServerData();
|
||||
},
|
||||
@@ -96,14 +117,21 @@
|
||||
categories: ["2018","2019","2020","2021","2022","2023"],
|
||||
series: [{
|
||||
name: "",
|
||||
data: [90]
|
||||
data: [this.score]
|
||||
},
|
||||
]
|
||||
};
|
||||
this.chartData = JSON.parse(JSON.stringify(res));
|
||||
}, 500);
|
||||
},
|
||||
}
|
||||
toQuestionBank(){
|
||||
console.log('result');
|
||||
const list =JSON.stringify(this.wrongList)
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle=错题&subject="+this.subject+"&questionList="+list
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -118,6 +146,7 @@
|
||||
width: 349rpx;
|
||||
height: 76rpx;
|
||||
background: #DEEFE5;
|
||||
border:none;
|
||||
border-radius: 38rpx;
|
||||
line-height: 76rpx;
|
||||
text-align: center;
|
||||
|
||||
@@ -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" />
|
||||
</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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<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 />
|
||||
<view class="top_box flex jc-c" style="flex-direction: column;">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- <u-navbar :title="navTitle" @rightClick="rightClick" :autoBack="true">
|
||||
</u-navbar> -->
|
||||
<j-navbar>{{navTitle}}</j-navbar>
|
||||
<Question ref="question" :tabsList="tabsList" :isShowAll="true"></Question>
|
||||
<Question ref="question" :tabsList="tabsList" :isShowAll="true" :subject="subject" :navTitle="navTitle"></Question>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -14,12 +14,17 @@
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import Question from './components/Question.vue';
|
||||
import {
|
||||
queryQuestion
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
components: {
|
||||
Question
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
subject:1,
|
||||
navTitle:'',
|
||||
tabsList:[{
|
||||
label:"答题",
|
||||
@@ -34,10 +39,27 @@
|
||||
onLoad(op) {
|
||||
if(op&&op.navTitle){
|
||||
this.navTitle=op.navTitle
|
||||
const param={}
|
||||
if(this.navTitle==='顺序答题'){
|
||||
this.questionArr=[...this.orderQuestion]
|
||||
this.$refs.question.getQuestionList(this.questionArr)
|
||||
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.questionList=JSON.parse(op.questionList)
|
||||
}
|
||||
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: {
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user