You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jwl-applet/src/pages/questionBank/practiceResult.vue

123 lines
3.9 KiB

2 years ago
<template>
<view>
2 years ago
<!-- <u-navbar title="本次练题结果" @rightClick="rightClick" :autoBack="true"></u-navbar>-->
2 years ago
<j-navbar backPath="/pages/index/index">本次练题结果</j-navbar>
2 years ago
<view class="p14 wp100">
2 years ago
<GradesChart :titleName="rightPencentDesc" :actualValue="Number(rightPencent)" />
2 years ago
<view class="top_box flex jc-c" style="flex-direction: column;">
2 years ago
<view class="wp100 text-center" style="margin-top: -80px;">
<text v-if="Number(rightPencent)>=90">太棒了正确率很高了</text>
<text v-else>继续努力吧正确率有点低~</text>
2 years ago
<view class="flex ai-c jc-c mt10">
2 years ago
<view class="text-center wp50" @tap="toQuestionBank">
<view>{{wrongList.length}}/{{allDoNum}}</view>
2 years ago
<text>本次错题</text>
</view>
2 years ago
<view class="text-center wp50 flex jc-c ai-c" style="flex-direction: column;" @tap="toContiune">
2 years ago
<u-icon name="file-text" size="28"></u-icon>
<text>继续做题</text>
</view>
</view>
</view>
</view>
</view>
<view class="p14">
<view class="bc-fff p14" style="border-radius: 20rpx;">
<view class="flex ai-c jc-sb">
<view>
<text class="fs18 cor-000 fw600">累计练题</text>
2 years ago
<text class="fs14 cor-666 ml10">{{allRightList.length+allWrongList.length}}</text>
2 years ago
</view>
2 years ago
<text class="fs14 cor-666">未做题{{getNotDoNum}}</text>
2 years ago
</view>
<view class="mt10">
2 years ago
<u-line-progress :percentage="percent" activeColor="#05C341" height="16"></u-line-progress>
2 years ago
</view>
<view class="p14 mt10 flex ai-c jc-sb" style="border-radius: 20rpx;background-color: rgb(253,249,238);">
<view>
<text class="fs16 cor-666">题目太多试试</text>
<text class="fs16 cor-000 fw600">精简500题</text>
</view>
<view style="width: 220rpx;">
2 years ago
<button style="background-color:rgb(246,211,115);height: 80rpx;border-radius: 40rpx;width: 220rpx;color:rgb(102,65,0)">开始答题</button>
2 years ago
</view>
</view>
</view>
</view>
</view>
</template>
<script>
2 years ago
import {
mapState,
mapActions
} from 'pinia' //引入映射函数
import storage from '@/jtools/storage';
import useQuestionStore from '@/jtools/store/question' //引入store
2 years ago
import GradesChart from "./components/GradesChart.vue"
export default {
components: {
GradesChart
},
data() {
return {
2 years ago
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)
2 years ago
this.rightPencent=this.allDoNum>0?((this.allDoNum-this.wrongList.length)/this.allDoNum).toFixed(2):0
2 years ago
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)
2 years ago
}
},
methods: {
2 years ago
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
})
}
2 years ago
}
}
</script>
<style scoped>
.top_box {
padding: 15px;
background-color: #fdfdfd;
border-radius: 20rpx;
}
</style>