bug修复

This commit is contained in:
binbin_pan 2024-09-02 13:02:45 +08:00
parent 345c999df7
commit dbbb7c1269
1 changed files with 33 additions and 17 deletions

View File

@ -154,10 +154,13 @@
:show="showModal"
title="本次答题正确率"
showCancelButton
@cancel="handleClose"
@confirm="handleConfirm"
cancelText="结束答题"
confirmText="继续答题"
@cancel="handleConfirm"
@confirm="handleClose"
cancelText="继续答题"
confirmText="结束答题"
:buttonReverse="true"
confirmColor="#606266"
cancelColor="#2979ff"
>
<view class="slot-content">
<div class="correctRate">{{ correctRate }}%</div>
@ -242,7 +245,8 @@ export default {
questionListSelect: [],
studyId: '', // id
fileUrl: config.fileUrl,
intervalId: ''
intervalId: '',
isEnd: false
}
},
onLoad(opt) {
@ -260,6 +264,7 @@ export default {
this.getPracticeQuestion()
},
onUnload() {
if (this.isEnd) return
//
clearInterval(this.intervalId)
this.handleClose()
@ -271,7 +276,7 @@ export default {
practiceId: this.practiceId,
recordId: this.recordId,
isNew: this.isNew || '',
isMiss: this.isError ? 1 : ''
isMiss: this.isError ? '1' : ''
}
// const res = await getPracticeItData(params)
// this.trueNum = res.data.trueNum
@ -308,7 +313,7 @@ export default {
recordId: this.recordId,
isNew: this.isNew || '',
isOutOfOrder: this.isOutOfOrder || '',
isMiss: this.isError ? 1 : ''
isMiss: this.isError ? '1' : ''
}
// const res = await getPracticeQuestion(params)
// this.recordId = res.data.recordId
@ -352,7 +357,7 @@ export default {
practiceId: this.practiceId,
operate: item || '',
sort: this.nowNum,
isMiss: this.isError ? 1 : ''
isMiss: this.isError ? '1' : ''
}
console.log('🚀 ~ handleJump ~ params:', params)
// const res = await changeQuestion(params)
@ -380,8 +385,8 @@ export default {
async getPracticeQuestionList() {
const params = {
recordId: this.recordId,
id: this.practiceId,
isMiss: this.isError ? 1 : ''
practiceId: this.practiceId,
isMiss: this.isError ? '1' : ''
}
// const res = await getPracticeQuestionList(params)
// console.log('🚀 ~ getPracticeQuestionList ~ res:', res)
@ -471,7 +476,8 @@ export default {
recordId: this.recordId,
questionId: this.questionList[0].questionId,
selectAnswer: option.optionIdent,
isTrue: option.optionIdent == this.questionList[0].correctGrade ? 1 : 0
isTrue: option.optionIdent == this.questionList[0].correctGrade ? 1 : 0,
isMiss: this.isError ? '1' : ''
}
console.log('🚀 ~ handleOption ~ params:', params)
//
@ -606,17 +612,25 @@ export default {
},
//
handleClose() {
this.isEnd = true
//
clearInterval()
console.log('结束')
console.log('结束', this.usedTime)
//
// savePracticeDuration({
// id: this.practiceId,
// practiceDuration: Math.ceil(this.usedTime.split(':')[0] * 60 + this.usedTime.split(':')[1] / 60)
// })
// this.usedTime 00:00:00
let time = this.usedTime.split(':').reduce((acc, cur, index) => {
return acc + cur * Math.pow(60, 2 - index)
}, 0)
// ,
time = Math.ceil(time / 60)
console.log('🚀 ~ handleClose ~ time:', time)
const params = {
id: this.practiceId,
practiceDuration: Math.ceil(this.usedTime.split(':')[0] * 60 + this.usedTime.split(':')[1] / 60)
id: this.recordId,
practiceDuration: time
}
console.log('🚀 ~ handleClose ~ params:', params)
uni.request({
@ -669,9 +683,11 @@ export default {
console.log(err)
}
})
uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId
})
setTimeout(() => {
uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId
})
}, 500)
} else {
uni.reLaunch({
url: '/pages/YNEduApp/prac/prac'