import Api from "../../model/api"; import {getDataSet, getEventParam} from "../../utils/utils"; import {logicStatus} from "../../model/enum"; import Route from "../../model/route"; const app = getApp(); app.Base({ data: { tabsList: [ "推荐项目", "已报名" ], rows: [], isComplete: false, active: 0, }, onChange(e) { this.setData({ active: getEventParam(e, "index"), isComplete: "已报名" == getEventParam(e, "title") }, () => { this.changeResetData(this); }) }, toNewsDetail(e) { let id = getDataSet(e, "id"); let isComplete = this.data.isComplete ? logicStatus.YES : logicStatus.NO; Route.toRocommandDetail(id, isComplete, { sign: () => { this.resetData(this); } }) }, async requestData() { let type = this.data.isComplete ? logicStatus.YES : logicStatus.NO let res = await Api.getRecommend({ type, pageNum: this.pageNum, pageSize: this.pageSize }); return res; } })