window.activity = { getType: async () => { const {code, data, msg} = await $.get("/platform/activity/common/getType") return data }, getTeam: async () => { const {code, data, msg} = await $.get("/platform/activity/common/getTeam") return data }, getTeamId: async () => { const {code, data, msg} = await $.get("/platform/activity/apply/getTeamId") return data }, getEvents: async () => { const {code, data, msg} = await $.get("/platform/activity/common/getEvents") return data }, getSchoolActivityPlan: async (type) => { const {code, data, msg} = await $.get("/platform/activity/common/getSchoolActivityPlan", {type}) return data }, school: { gameStyle: { 1: '竞赛类', 2: '非竞赛类' }, awardsMode: { 1: '单项', 2: '团体' }, activityLevel: { 1: '校级', 2: '分工会', 3: '社团或协会' }, combinationMethod: { 1: '单项报名人数', 2: '团体报名人数' }, applyWay: { 1: '个人报名', 2: '基层工会报名', 3: '小程序报名' }, getStatus(close, applyStartTime, applyEndTime, startTime, endTime, isSave) { if (close) { return `活动已关闭` } const now = moment().valueOf() const dateNow = moment(moment(moment().format('YYYY-MM-DD')).valueOf()).valueOf() if (!isSave && now < moment(applyStartTime).valueOf()) { return `未开始报名` } else if (!isSave && moment(applyStartTime).valueOf() <= now && now <= moment(applyEndTime).valueOf()) { return `活动报名中` } else if (!isSave && moment(applyEndTime).valueOf() < now && now < moment(startTime).valueOf()) { return `报名已结束` } else if (!isSave && moment(startTime).valueOf() < now && now < moment(endTime).valueOf()) { return `活动进行中` } else if (!isSave && moment(endTime).valueOf() < now) { return `活动已结束` } else { return `活动创建中` } }, canApply(close, applyStartTime, applyEndTime) { if (close) { return false } if (moment(applyStartTime).valueOf() < now < moment(applyEndTime).valueOf()) { return true } return false }, }, }