From 9e522c6eb3e4c7a338b8d32e058cecadc54097fb Mon Sep 17 00:00:00 2001 From: binbin_pan Date: Fri, 30 Aug 2024 19:04:00 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 3 +- pages/YNEduApp/exam/exam.vue | 11 +- .../exam/examinationResultDetails.vue | 151 ++++++++++-------- pages/YNEduApp/learnProj/learnProjDetail.vue | 6 +- pages/YNEduApp/prac/exercises.vue | 12 +- 5 files changed, 103 insertions(+), 80 deletions(-) diff --git a/pages.json b/pages.json index 99e2827..0c4c1fb 100644 --- a/pages.json +++ b/pages.json @@ -113,7 +113,8 @@ { "path": "pages/YNEduApp/exam/exam", "style": { - "navigationStyle": "custom" + "navigationStyle": "custom", + "enablePullDownRefresh": true } }, { diff --git a/pages/YNEduApp/exam/exam.vue b/pages/YNEduApp/exam/exam.vue index d8d234a..1e1a987 100644 --- a/pages/YNEduApp/exam/exam.vue +++ b/pages/YNEduApp/exam/exam.vue @@ -67,7 +67,14 @@ export default { this.getList() }, methods: { - async getList() { + onPullDownRefresh() { + this.getList() + setTimeout(() => { + //800毫秒后关闭刷新 + uni.stopPullDownRefresh() + }, 800) + }, + getList() { const params = { userId: uni.getStorageSync('userId'), source: 1 @@ -145,7 +152,7 @@ export default { examCount: item.examCount, // 考试次数类型 examCustom: item.examCustom, // 自定义考试次数 score: item.score, // 总分 - passScore: item.passScore, // 及格分数 + passScore: item.passScore // 及格分数 } uni.navigateTo({ url: `/pages/YNEduApp/exam/beforeExam?params=${JSON.stringify(params)}` diff --git a/pages/YNEduApp/exam/examinationResultDetails.vue b/pages/YNEduApp/exam/examinationResultDetails.vue index 219646b..41b1a4a 100644 --- a/pages/YNEduApp/exam/examinationResultDetails.vue +++ b/pages/YNEduApp/exam/examinationResultDetails.vue @@ -474,7 +474,7 @@ export default { this.getList() }, methods: { - async getList() { + getList() { const params = { examId: this.examId, recordId: this.recordId @@ -491,82 +491,93 @@ export default { }, success: res => { res = res.data + console.log('🚀 ~ getList ~ res:', res.data.examPaperData) + if (res.code != 200) { + uni.showToast({ + title: res.msg, + icon: 'none' + }) + return + } this.questionList = res.data.examPaperData - } - }) - this.list = this.questionList - this.list.forEach((item, index) => { - if (index < 7) { - item.isShow = true - } else { - item.isShow = false - } - }) - console.log('🚀 ~ getList ~ res:', res) - this.questionList.forEach((item, index) => { - if (item.examType === 1 || item.examType === 3) { - if (!item.selectAnswer) { - this.unAnsweredCount++ - item.isUnAnswered = true - // 添加正确背景色 - item.listOption.forEach(option => { - option.isRight = option.optionIdent === item.correctGrade - }) - } else { - if (item.correctGrade === item.selectAnswer) { - this.rightCount++ - // 添加正确背景色 - item.isRight = true - item.listOption.forEach(option => { - option.isRight = option.optionIdent === item.correctGrade - }) + this.list = this.questionList + this.list.forEach((item, index) => { + if (index < 7) { + item.isShow = true } else { - this.wrongCount++ - // 添加错误背景色 - item.isWrong = true - item.listOption.forEach(option => { - option.isError = option.optionIdent === item.selectAnswer - if (option.optionIdent === item.correctGrade) { - option.isRight = true + item.isShow = false + } + }) + console.log('🚀 ~ getList ~ res:', res) + this.questionList.forEach((item, index) => { + if (item.examType === 1 || item.examType === 3) { + if (!item.selectAnswer) { + this.unAnsweredCount++ + item.isUnAnswered = true + // 添加正确背景色 + item.listOption.forEach(option => { + option.isRight = option.optionIdent === item.correctGrade + }) + } else { + if (item.correctGrade === item.selectAnswer) { + this.rightCount++ + // 添加正确背景色 + item.isRight = true + item.listOption.forEach(option => { + option.isRight = option.optionIdent === item.correctGrade + }) + } else { + this.wrongCount++ + // 添加错误背景色 + item.isWrong = true + item.listOption.forEach(option => { + option.isError = option.optionIdent === item.selectAnswer + if (option.optionIdent === item.correctGrade) { + option.isRight = true + } + }) } - }) - } - } - } else { - if (!item.selectAnswer) { - this.unAnsweredCount++ - item.isUnAnswered = true - // 添加正确背景色 - item.listOption.forEach(option => { - option.isRight = item.correctGrade.includes(option.optionIdent) - }) - } else { - if (item.correctGrade.toString() === item.selectAnswer.toString()) { - this.rightCount++ - // 添加正确背景色 - item.isRight = true + } } else { - this.wrongCount++ - // 添加错误背景色 - item.isWrong = true + if (!item.selectAnswer) { + this.unAnsweredCount++ + item.isUnAnswered = true + // 添加正确背景色 + item.listOption.forEach(option => { + option.isRight = item.correctGrade.includes(option.optionIdent) + }) + } else { + if (item.correctGrade.toString() === item.selectAnswer.toString()) { + this.rightCount++ + // 添加正确背景色 + item.isRight = true + } else { + this.wrongCount++ + // 添加错误背景色 + item.isWrong = true + } + item.listOption.forEach(option => { + if (item.correctGrade.includes(option.optionIdent)) { + option.isRight = true + } + if (item.selectAnswer.includes(option.optionIdent)) { + option.isError = true + } + if (option.isRight && option.isError) { + option.isError = false + } + }) + } } - item.listOption.forEach(option => { - if (item.correctGrade.includes(option.optionIdent)) { - option.isRight = true - } - if (item.selectAnswer.includes(option.optionIdent)) { - option.isError = true - } - if (option.isRight && option.isError) { - option.isError = false - } - }) - } + }) + this.rightList = this.questionList.filter(item => item.isRight) + this.wrongList = this.questionList.filter(item => item.isWrong) + this.unAnsweredList = this.questionList.filter(item => item.isUnAnswered) + }, + fail: err => { + console.log(err) } }) - this.rightList = this.questionList.filter(item => item.isRight) - this.wrongList = this.questionList.filter(item => item.isWrong) - this.unAnsweredList = this.questionList.filter(item => item.isUnAnswered) }, handleTab(index) { console.log('🚀 ~ handleTab ~ index:', index) diff --git a/pages/YNEduApp/learnProj/learnProjDetail.vue b/pages/YNEduApp/learnProj/learnProjDetail.vue index 2e519dd..9cffbec 100644 --- a/pages/YNEduApp/learnProj/learnProjDetail.vue +++ b/pages/YNEduApp/learnProj/learnProjDetail.vue @@ -115,7 +115,11 @@
{{ content.studyName }}
- {{ content.practiceMsg && content.practiceMsg.recordId != null ? '未开始' : '已练习' }} + {{ + content.practiceMsg && content.practiceMsg.alreadyNum == 0 + ? '未开始' + : '已练习' + }}
diff --git a/pages/YNEduApp/prac/exercises.vue b/pages/YNEduApp/prac/exercises.vue index 6c87f25..039e608 100644 --- a/pages/YNEduApp/prac/exercises.vue +++ b/pages/YNEduApp/prac/exercises.vue @@ -670,14 +670,14 @@ export default { } }) uni.reLaunch({ - url: '/pages/YNEduApp/learnProj/learnProjDetail?studyId=' + this.studyId + url: '/pages/YNEduApp/learnProj/learnProjDetail?id=' + this.studyId + }) + } else { + uni.reLaunch({ + url: '/pages/YNEduApp/prac/prac' }) } this.showModal = false - // uni.navigateBack() - uni.reLaunch({ - url: '/pages/YNEduApp/prac/prac' - }) }, // 打开题目选择弹框 async openSelect() { @@ -835,7 +835,7 @@ export default { display: flex; align-items: center; justify-content: flex-start; - text-align: left; + text-align: left; } } .active {