qa-education-exam-weapp/pages/exam/results/results.js

53 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-04-17 16:22:56 +08:00
import {
getExamRecordByUser
} from "../../../api/index";
Page({
data: {
type: '',
STAGEEXAM_ID: '',
STUDYTASK_ID: '',
CURRICULUM_ID: '',
topic: [],
stageExam: {
EXAMRESULT: '1',
PAPERSCORE: "100",
EXAMSCORE: "60"
}
},
onLoad(options) {
let info = {}
info.EXAMRESULT = options.EXAMRESULT
info.PAPERSCORE = options.PAPER_EXAMSCORE
info.EXAMSCORE = options.EXAMSCORE
// STAGEEXAM_ID
this.setData({
stageExam: info,
STAGEEXAM_ID: options.STAGEEXAM_ID
})
this.getData()
// if (options.type === 'learned') {
// this.getData()
// } else {
// this.setData({
// topic: app.globalData.mockTestResult.topic,
// stageExam: app.globalData.mockTestResult.stageExam,
// })
// }
},
async getData() {
let resData = await getExamRecordByUser({
STAGEEXAM_ID: this.data.STAGEEXAM_ID
})
this.setData({
topic: resData.varList
})
},
onUnload() {
// app.globalData.mockTestResult = {}
// if (this.data.type !== 'learned') {
// wx.switchTab({
// url: '/pages/index/index'
// })
// }
}
})