共计 3345 个字符,预计需要花费 9 分钟才能阅读完成。
研发背景
- 以幼儿园新学期新学年招生报名为外围,
- 兼顾幼儿园环境图文展现(室内,室外,娱乐,起居等),幼儿园招生政策答疑,最新动静新闻,幼儿园食谱介绍,报名我的项目海报分享等,
- 目标是不便园方不便的统计幼儿注销材料,正当的管制报名人数,幼儿家长能够填写幼儿的根本信息,住址信息,监护人信息等材料(可自定义设置),
- 园方人员依据材料能够做事后审核,并提醒用户批改欠缺材料,并可查看和导出名单 Excel,审核报名记录等,大大减少了现场报名的人力老本,数字化伎俩进步了工作效率,也为家长节俭了工夫。
性能合成
技术使用
- 本我的项目应用微信小程序平台进行开发。
- 小程序自身的即用即走,适宜小工具的应用场景,也适宜疾速开发迭代。
- 云开发技术采纳腾讯外部链路,没有被黑客攻击的危险,安全性高且免保护。
- 资源承载力可依据业务倒退须要随时弹性扩大。
数据字典
报名项目表
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',
};
用户报名表
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',
};
外围逻辑
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
治理后盾
源码分享
gitee 源码
正文完