bug修改

This commit is contained in:
binbin_pan 2024-08-30 19:04:00 +08:00
parent 47572ed703
commit 9e522c6eb3
5 changed files with 103 additions and 80 deletions

View File

@ -113,7 +113,8 @@
{ {
"path": "pages/YNEduApp/exam/exam", "path": "pages/YNEduApp/exam/exam",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
{ {

View File

@ -67,7 +67,14 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
async getList() { onPullDownRefresh() {
this.getList()
setTimeout(() => {
//800
uni.stopPullDownRefresh()
}, 800)
},
getList() {
const params = { const params = {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
source: 1 source: 1
@ -145,7 +152,7 @@ export default {
examCount: item.examCount, // examCount: item.examCount, //
examCustom: item.examCustom, // examCustom: item.examCustom, //
score: item.score, // score: item.score, //
passScore: item.passScore, // passScore: item.passScore //
} }
uni.navigateTo({ uni.navigateTo({
url: `/pages/YNEduApp/exam/beforeExam?params=${JSON.stringify(params)}` url: `/pages/YNEduApp/exam/beforeExam?params=${JSON.stringify(params)}`

View File

@ -474,7 +474,7 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
async getList() { getList() {
const params = { const params = {
examId: this.examId, examId: this.examId,
recordId: this.recordId recordId: this.recordId
@ -491,82 +491,93 @@ export default {
}, },
success: res => { success: res => {
res = res.data 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.questionList = res.data.examPaperData
} this.list = this.questionList
}) this.list.forEach((item, index) => {
this.list = this.questionList if (index < 7) {
this.list.forEach((item, index) => { item.isShow = true
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
})
} else { } else {
this.wrongCount++ item.isShow = false
// }
item.isWrong = true })
item.listOption.forEach(option => { console.log('🚀 ~ getList ~ res:', res)
option.isError = option.optionIdent === item.selectAnswer this.questionList.forEach((item, index) => {
if (option.optionIdent === item.correctGrade) { if (item.examType === 1 || item.examType === 3) {
option.isRight = true 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 { } else {
this.wrongCount++ if (!item.selectAnswer) {
// this.unAnsweredCount++
item.isWrong = true 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)) { this.rightList = this.questionList.filter(item => item.isRight)
option.isRight = true this.wrongList = this.questionList.filter(item => item.isWrong)
} this.unAnsweredList = this.questionList.filter(item => item.isUnAnswered)
if (item.selectAnswer.includes(option.optionIdent)) { },
option.isError = true fail: err => {
} console.log(err)
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)
}, },
handleTab(index) { handleTab(index) {
console.log('🚀 ~ handleTab ~ index:', index) console.log('🚀 ~ handleTab ~ index:', index)

View File

@ -115,7 +115,11 @@
<div class="note">{{ content.studyName }}</div> <div class="note">{{ content.studyName }}</div>
</div> </div>
<div class="right-content"> <div class="right-content">
{{ content.practiceMsg && content.practiceMsg.recordId != null ? '未开始' : '已练习' }} {{
content.practiceMsg && content.practiceMsg.alreadyNum == 0
? '未开始'
: '已练习'
}}
</div> </div>
</div> </div>
</uni-list> </uni-list>

View File

@ -670,14 +670,14 @@ export default {
} }
}) })
uni.reLaunch({ 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 this.showModal = false
// uni.navigateBack()
uni.reLaunch({
url: '/pages/YNEduApp/prac/prac'
})
}, },
// //
async openSelect() { async openSelect() {
@ -835,7 +835,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
text-align: left; text-align: left;
} }
} }
.active { .active {