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

View File

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

View File

@ -317,6 +317,18 @@ export default {
// //
toggleTheoryExam(item) { toggleTheoryExam(item) {
console.log('🚀 ~ toggleTheoryExam ~ item:', item, item.examMsg.examEquipment) 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) { if (item.examMsg.examEquipment == 2) {
uni.showToast({ uni.showToast({
title: '请在电脑端进行考试', title: '请在电脑端进行考试',
@ -324,6 +336,20 @@ export default {
}) })
return 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 = { const params = {
id: item.examMsg.id, // id id: item.examMsg.id, // id
cutNum: item.examMsg.isCut, // cutNum: item.examMsg.isCut, //

View File

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