业务背景
会议室是一个单位或部门的共用资源,但在使用的时候往往会遇到时间冲突、预约困难、不方便协调等问题。目前大部分公司是统一在公司群聊中预约,每次预约时,都需要翻一下聊天记录,了解是否有人预定以及预定时间等。如果冲突则需要找到相关联系人进行沟通。查找历史预约记录麻烦。而现在员工人人都有微信,基于微信环境下的小程序,不用安装独立APP,访问方便。所以我们可以基于小程序,借助于会议室预约系统改善这种情况,实现会议室资源的最优使用
需求分析

数据库设计
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_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_DAY: 'string|false|comment=预约日期',
ENROLL_JOIN_START: 'string|false|comment=开始时间',
ENROLL_JOIN_END: 'string|false|comment=结束时间',
ENROLL_JOIN_END_POINT: 'string|false|comment=结束时间末尾',
ENROLL_JOIN_USER_ID: 'string|true|comment=用户ID',
ENROLL_JOIN_FORMS: 'array|true|default=[]|comment=表单',
ENROLL_JOIN_OBJ: 'object|true|default={}',
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',
};
UI设计






核心代码
class EnrollService extends BaseProjectService {
// 获取当前登记状态
getJoinStatusDesc(enroll) {
return '进行中';
}
/** 浏览信息 */
async viewEnroll(userId, id) {
let fields = '*';
let where = {
_id: id,
ENROLL_STATUS: EnrollModel.STATUS.COMM
}
let enroll = await EnrollModel.getOne(where, fields);
if (!enroll) return null

本文介绍了如何利用微信小程序开发一个会议室预约系统,解决传统预约中存在的时间冲突和协调难题。系统采用数据库设计,包括EnrollModel和EnrollJoinModel,提供预约、查看、修改、取消等功能,并通过后台服务进行数据管理和操作。核心代码展示了关键操作如获取登记状态、浏览信息、获取预约列表等。此外,还涉及UI设计和后台管理,确保会议室资源的有效利用。
最低0.47元/天 解锁文章
2002

被折叠的 条评论
为什么被折叠?



