This commit is contained in:
2023-08-28 02:02:46 +08:00
parent 37c5de0899
commit f762ca430d
11 changed files with 586 additions and 249 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="content">
<view class="flex ai-c jc-c">
<view class="flex type_box jc-sb ai-c">
<view class="flex type_box jc-sb ai-c" v-if="navTitle!=='考前密卷'">
<view class="type_item" v-for="(item,index) of tabsList" :key="index" :class="tCurrent==item.value?'checked':'unchecked'" @tap="sectionChange(item.value)">{{item.label}}</view>
</view>
</view>
@@ -83,7 +83,7 @@
<view class="wp100 flex jc-sb ai-c p14 bc-fff" v-if="isShowAll" style="position: fixed;bottom: 0;left: 0;">
<view style="width: 220rpx;">
<view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view>
<view v-else class="btn" style="text-align: center;" @tap="submitPaper">
<view v-else-if="type=='exam'" class="btn" style="text-align: center;" @tap="submitPaper">
<u-count-down ref="countDown_1" :time=" 1*60*60 * 1000" format="HH:mm:ss" @change="timeChange"></u-count-down>
<text>交卷</text>
</view>
@@ -147,8 +147,14 @@
</view>
<template #confirmButton>
<view class="p10" >
<u-button :customStyle="{width:'45%',marginRight:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#666',border:'1px solid #666',display:'inline-block'}" @click="continueExam">继续考试</u-button>
<u-button :customStyle="{width:'45%',marginLeft:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#fff',backgroundColor:'#05C341',display:'inline-block'}" @click="toSubmit">现在交卷</u-button>
<template v-if="isShowAll">
<u-button :customStyle="{width:'45%',marginRight:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#666',border:'1px solid #666',display:'inline-block'}" @click="continueExam">继续考试</u-button>
<u-button :customStyle="{width:'45%',marginLeft:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#fff',backgroundColor:'#05C341',display:'inline-block'}" @click="toSubmit">现在交卷</u-button>
</template>
<template v-else>
<u-button :customStyle="{width:'45%',marginRight:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#666',border:'1px solid #666',display:'inline-block'}" @click="toLeave">确定离开</u-button>
<u-button :customStyle="{width:'45%',marginLeft:'10px',height:'68rpx',lineHeight:'68rpx',borderRadius:'34rpx',color:'#fff',backgroundColor:'#05C341',display:'inline-block'}" @click="continueExam">继续考试</u-button>
</template>
</view>
</template>
</u-modal>
@@ -157,7 +163,7 @@
<view class="wp100 flex jc-sb p14 bc-fff">
<view style="width: 220rpx;">
<view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view>
<view v-else class="btn" style="text-align: center;" @tap="submitPaper">
<view v-else-if="type=='exam'" class="btn" style="text-align: center;" @tap="submitPaper">
<u-count-down ref="countDown_2" :time="1 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
<text>交卷</text>
</view>
@@ -263,6 +269,7 @@ export default {
},
data() {
return {
originArray:'',
showBestAnswer:false,
nowPrice:68,
showVip:false,
@@ -305,6 +312,11 @@ export default {
},
methods: {
...mapActions(useQuestionStore,['getCurrentIndex']),
toLeave(){
uni.switchTab({
url:'/pages/index/index'
})
},
isShowBest(val){
this.showBestAnswer=val
},
@@ -414,8 +426,10 @@ export default {
})
},
submitPaper(){
this.$refs.countDown_1.pause();
this.$refs.countDown_2.pause();
if(this.isShowAll){
this.$refs.countDown_1.pause();
this.$refs.countDown_2.pause();
}
this.$refs.countDown_3.pause();
this.$emit('update:isSubmit',true)
},
@@ -581,6 +595,7 @@ export default {
this.questionList[this.topicIndex].clickAnswer = this.questionList[this.topicIndex].clickAnswer.replace(reg2,"");
}
}
this.originArray=JSON.stringify(this.questionList)
if(this.tCurrent!==1&&this.questionList[this.topicIndex].type!='3'){
const arr1=this.questionList[this.topicIndex].clickAnswer.split('')
const arr2=this.questionList[this.topicIndex].trueAnswer.split('')
@@ -644,19 +659,24 @@ export default {
this.$emit('changeTab',index)
},
getQuestionList(val) {
const arr = JSON.parse(val)
this.questionList=[]
arr.forEach(item=>{
let isCollect=false
if(this.collectList.includes(item.questionId)){
isCollect=true
}
this.questionList.push({
isChoose:false,
isCollect:isCollect,
...item
if(val&&val.length){
const arr = JSON.parse(val)
this.questionList=[]
arr.forEach(item=>{
let isCollect=false
if(this.collectList.includes(item.questionId)){
isCollect=true
}
this.questionList.push({
isChoose:false,
isCollect:isCollect,
...item
})
})
})
}else{
this.questionList=JSON.parse(this.originArray)
}
if(this.navTitle==='顺序答题'){
this.pickerTopic(this[`currentIndex_subject${this.subject}`])
}else{