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

77 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

2026-04-17 16:26:28 +08:00
// pages/exam/online/online.js
import Dialog from '@vant/weapp/dialog/dialog';
import Toast from '@vant/weapp/toast/toast';
import {
getExamListTaskByUser
} from "../../../api/index";
Page({
/**
* 页面的初始数据
*/
data: {
showCount: 10,
timesOfexamination: 0,
currentPage: 1,
totalPage: 0,
varList: [],
},
goExam(item) {
let dataInfo = item.currentTarget.dataset.item
wx.navigateTo({
url: '/pages/exam/examination/examination' +
'?STAGEEXAMPAPERINPUT_ID=' + dataInfo.PAPER_ID +
'&CLASS_ID=' + dataInfo.CLASS_ID +
'&EXAMNAME=' + dataInfo.EXAMNAME +
'&STUDENT_ID=' + dataInfo.STUDENT_ID +
'&PASSSCORE=' + dataInfo.PASSSCORE +
'&EXAMSCORE=' + dataInfo.EXAMSCORE +
'&NUMBEROFEXAMS=' + this.data.timesOfexamination +
'&SIMULATION=1' +
'&ANSWERSHEETTIME=' + dataInfo.ANSWERSHEETTIME+
'&type=practice'
})
},
async getData() {
let resData = await getExamListTaskByUser({
showCount: this.data.showCount,
currentPage: this.data.currentPage,
simulation: 1
})
this.setData({
varList: [...this.data.varList, ...resData.varList],
totalPage: resData.page.totalPage
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
showCount: 10,
currentPage: 1,
totalPage: 0,
varList: [],
})
this.getData()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
this.setData({
currentPage: ++this.data.currentPage
})
if (this.data.totalPage >= this.data.currentPage) {
this.getData()
}
},
})