import Api from "../../model/api"; import {getEventParam} from "../../utils/utils"; import {scoreLogics} from "../../model/enum"; const app = getApp(); app.Base({ educationStuId: '', data: { typeArr: [], typeData: [], typeIndex: 0, educationStuId: '', scoreLogicsEnum: scoreLogics, }, async onLoad(options) { const data = await Api.getScoreInfo(true); let typeArr = data.data.map(item => { return `${item.itemName}(${item.teamName})`; }) typeArr.unshift("全部") this.setData({ typeArr, typeData: data.data, }) }, async bindTypeChange(e) { this.setData({ typeIndex: getEventParam(e, "value"), educationStuId: this.data.typeData[getEventParam(e, "value") - 1] ? this.data.typeData[getEventParam(e, "value") - 1].stuId : '' }) this.educationStuId = this.data.typeData[getEventParam(e, "value") - 1] ? this.data.typeData[getEventParam(e, "value") - 1].stuId : ''; await this.resetData(this); }, async requestData() { const res = await Api.getScoreDetail({ educationStuId: this.educationStuId, pageNum: this.pageNum, pageSize: this.pageSize }); return res; }, })