背景
- 以幼儿园新学期新学年招生报名为核心,
- 兼顾幼儿园环境图文展示(室内,室外,文娱,起居等),幼儿园招生政策答疑,最新动态新闻,幼儿园食谱介绍,报名项目海报分享等,
- 目的是方便园方方便的统计幼儿登记资料,合理的控制报名人数,幼儿家长可以填写幼儿的基本信息,住址信息,监护人信息等资料(可自定义设置),
- 园方人员根据资料可以做预先审核,并提示用户修改完善资料,并可查看和导出名单Excel,审核报名记录等,大大减少了现场报名的人力成本,数字化手段提高了工作效率, 也为家长节省了时间。
功能图
技术运用
- 本项目使用微信小程序平台进行开发。
- 使用腾讯专门的小程序云开发技术,云资源包含云函数,数据库,带宽,存储空间,定时器等,资源配额价格低廉,无需域名和服务器即可搭建。
- 小程序本身的即用即走,适合小工具的使用场景,也适合快速开发迭代。
- 云开发技术采用腾讯内部链路,没有被黑客攻击的风险,安全性高且免维护。
- 资源承载力可根据业务发展需要随时弹性扩展。
数据库
EnrollJoinModel.DB_STRUCTURE = {
_pid: 'string|true',
ENROLL_JOIN_ID: 'string|true',
ENROLL_JOIN_ENROLL_ID: 'string|true|comment=报名PK',
ENROLL_JOIN_IS_ADMIN: 'int|true|default=0|comment=是否管理员添加 0/1',
ENROLL_JOIN_USER_ID: 'string|true|comment=用户ID',
ENROLL_JOIN_FORMS: 'array|true|default=[]|comment=表单',
ENROLL_JOIN_STATUS: 'int|true|default=1|comment=状态 0=待审核 1=报名成功, 99=审核未过',
ENROLL_JOIN_REASON: 'string|false|comment=审核拒绝或者取消理由',
ENROLL_JOIN_LAST_TIME: 'int|true|default=0',
ENROLL_JOIN_ADD_TIME: 'int|true',
ENROLL_JOIN_EDIT_TIME: 'int|true',
ENROLL_JOIN_ADD_IP: 'string|false',
ENROLL_JOIN_EDIT_IP: 'string|false',
};
EnrollModel.DB_STRUCTURE = {
_pid: 'string|true',
ENROLL_ID: 'string|true',
ENROLL_TITLE: 'string|true|comment=标题',
ENROLL_STATUS: 'int|true|default=1|comment=状态 0=未启用,1=使用中',
ENROLL_CATE_ID: 'string|true|default=0|comment=分类',
ENROLL_CATE_NAME: 'string|false|comment=分类冗余',
ENROLL_CANCEL_SET: 'int|true|default=1|comment=取消设置 0=不允,1=允许,2=仅截止前可取消,3=审核后不可取消',
ENROLL_EDIT_SET: 'int|true|default=1|comment=修改 0=不允,1=允许,2=仅截止前可,3=审核后不可修改',
ENROLL_CHECK_SET: 'int|true|default=0|comment=审核 0=不需要审核,1=需要审核',
ENROLL_MAX_CNT: 'int|true|default=20|comment=人数上限 0=不限',
ENROLL_START: 'int|false|comment=开始时间',
ENROLL_END: 'int|false|comment=截止时间',
ENROLL_ORDER: 'int|true|default=9999',
ENROLL_VOUCH: 'int|true|default=0',
ENROLL_FORMS: 'array|true|default=[]',
ENROLL_OBJ: 'object|true|default={}',
ENROLL_JOIN_FORMS: 'array|true|default=[]',
ENROLL_QR: 'string|false',
ENROLL_VIEW_CNT: 'int|true|default=0',
ENROLL_JOIN_CNT: 'int|true|default=0',
ENROLL_ADD_TIME: 'int|true',
ENROLL_EDIT_TIME: 'int|true',
ENROLL_ADD_IP: 'string|false',
ENROLL_EDIT_IP: 'string|false',
};
核心逻辑
async enrollJoin(userId, enrollId, forms) {
// 登记是否结束
let whereEnroll = {
_id: enrollId,
ENROLL_STATUS: EnrollModel.STATUS.COMM
}
let enroll = await EnrollModel.getOne(whereEnroll);
if (!enroll)
this.AppError('该' + ENROLL_NAME + '不存在或者已经停止');
// 是否登记开始
if (enroll.ENROLL_START > this._timestamp)
this.AppError('该' + ENROLL_NAME + '尚未开始');
// 是否过了登记截止期
if (enroll.ENROLL_END < this._timestamp)
this.AppError('该' + ENROLL_NAME + '已经截止');
// 人数是否满
if (enroll.ENROLL_MAX_CNT > 0) {
let whereCnt = {
ENROLL_JOIN_ENROLL_ID: enrollId,
ENROLL_JOIN_STATUS: ['in', [EnrollJoinModel.STATUS.WAIT, EnrollJoinModel.STATUS.SUCC]]
}
let cntJoin = await EnrollJoinModel.count(whereCnt);
if (cntJoin >= enroll.ENROLL_MAX_CNT)
this.AppError('该' + ENROLL_NAME + '人数已满');
}
// 自己是否已经有登记
let whereMy = {
ENROLL_JOIN_USER_ID: userId,
ENROLL_JOIN_ENROLL_ID: enrollId,
ENROLL_JOIN_STATUS: ['in', [EnrollJoinModel.STATUS.WAIT, EnrollJoinModel.STATUS.SUCC]]
}
let my = await EnrollJoinModel.getOne(whereMy);
if (my) {
if (my.ENROLL_JOIN_STATUS == EnrollJoinModel.STATUS.WAIT)
this.AppError('您已经填报,正在等待审核,无须重复填报');
else
this.AppError('您已经填报成功,无须重复填报');
}
// 入库
let data = {
ENROLL_JOIN_USER_ID: userId,
ENROLL_JOIN_ENROLL_ID: enrollId,
ENROLL_JOIN_STATUS: (enroll.ENROLL_CHECK_SET == 0) ? EnrollJoinModel.STATUS.SUCC : EnrollJoinModel.STATUS.WAIT,
ENROLL_JOIN_FORMS: forms
}
let enrollJoinId = await EnrollJoinModel.insert(data);
// 统计数量
this.statEnrollJoin(enrollId);
let check = enroll.ENROLL_CHECK_SET;
return { enrollJoinId, check }
}
UI设计
后台
https://gitee.com/leerechard/KidEnroll