bug修复

This commit is contained in:
binbin_pan 2024-09-04 19:20:45 +08:00
parent e7a1274dbf
commit 7bf27993b3
4 changed files with 68 additions and 4 deletions

View File

@ -139,6 +139,7 @@ import config from '@/config'
export default {
data() {
return {
isLoading: false,
// id
examId: '',
// id
@ -369,6 +370,15 @@ export default {
},
//
handleConfirmSubmit() {
console.log('🚀 ~ 提交-->', this.isLoading)
if (this.isLoading) {
uni.showToast({
title: '正在提交中, 请稍后',
icon: 'none'
})
return
}
this.isLoading = true
//
this.$refs.countDown.pause()
const params = {
@ -390,7 +400,6 @@ export default {
success: res => {
console.log('🚀 ~ handleConfirmSubmit ~ res:', res)
res = res.data
this.showConfirmModal = false
const params2 = {
examId: this.examId,
examGrade: res.examGrade,
@ -411,6 +420,10 @@ export default {
uni.navigateTo({
url: `/pages/YNEduApp/exam/examinationDetails?params=${JSON.stringify(params2)}`
})
setTimeout(() => {
this.showConfirmModal = false
this.isLoading = false
}, 1000)
}
})
if (this.studyId) {

View File

@ -40,6 +40,7 @@ export default {
},
data() {
return {
isLoading: false,
studyId: '', // id
stageId: '', // id
stageContentId: '', // id
@ -103,6 +104,14 @@ export default {
},
//
handleEnd() {
if (this.isLoading) {
uni.showToast({
title: '正在提交中, 请稍后',
icon: 'none'
})
return
}
this.isLoading = true
if (this.isEnd) {
uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId
@ -149,10 +158,13 @@ export default {
},
success: res => {
console.log('🚀 ~ handleEnd ~ res:', res)
this.showModal = false
uni.reLaunch({
url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId
})
setTimeout(() => {
this.isLoading = false
this.showModal = false
}, 1000)
},
fail: err => {
console.log('🚀 ~ handleEnd ~ err:', err)

View File

@ -317,6 +317,18 @@ export default {
//
toggleTheoryExam(item) {
console.log('🚀 ~ toggleTheoryExam ~ item:', item, item.examMsg.examEquipment)
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const today = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`
if (today < item.examMsg.validityDate.split('~')[0] || today > item.examMsg.validityDate.split('~')[1]) {
uni.showToast({
title: '当前时间不在考试时间范围内',
icon: 'none'
})
return
}
if (item.examMsg.examEquipment == 2) {
uni.showToast({
title: '请在电脑端进行考试',
@ -324,6 +336,20 @@ export default {
})
return
}
// examCount 1: 2: 3:
if (item.examMsg.examCount == 2 && item.examMsg.results == 1) {
uni.showToast({
title: '此考试及格终止, 考试以及格, 无需再次考试',
icon: 'none'
})
return
} else if (item.examMsg.examCount == 3 && item.examMsg.examNum >= item.examMsg.examCustom) {
uni.showToast({
title: '此考试有次数限制, 考试次数已达上限, 无法再考试了',
icon: 'none'
})
return
}
const params = {
id: item.examMsg.id, // id
cutNum: item.examMsg.isCut, //

View File

@ -218,6 +218,7 @@ import config from '@/config'
export default {
data() {
return {
isLoading: false,
practiceId: '', // id
recordId: '', // id
isNew: 1, //
@ -606,7 +607,8 @@ export default {
recordId: this.recordId,
questionId: this.questionList[0].questionId,
selectAnswer: select.join(''),
isTrue: isCorrect ? 1 : 0
isTrue: isCorrect ? 1 : 0,
isMiss: this.isError ? '1' : ''
}
console.log('🚀 ~ handleOk ~ params-多选:', params)
// insertPracticeAnswerById(params)
@ -662,6 +664,14 @@ export default {
},
//
handleClose() {
if (this.isLoading) {
uni.showToast({
title: '正在提交中, 请稍后',
icon: 'none'
})
return
}
this.isLoading = true
this.isEnd = true
//
clearInterval(this.intervalId)
@ -734,7 +744,10 @@ export default {
url: '/pages/YNEduApp/prac/prac'
})
}
setTimeout(() => {
this.isLoading = false
this.showModal = false
}, 500)
},
//
async openSelect() {