This commit is contained in:
2023-08-21 09:10:50 +08:00
parent a90c28f6fd
commit 7c54101dd6
12 changed files with 272 additions and 101 deletions

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
})
}
}