From 0 to 100: Driving school appointment and driving learning applet developed based on WeChat cloud

background

As motor vehicles gradually enter the homes of ordinary people, learning to drive has also been put on people's agenda, which has led to the rapid development of the automobile driving training industry. The widespread application of mobile Internet technology has made it possible to book rides on mobile phones. How to rationally allocate existing resources, improve resource utilization, and enhance driving school service levels has become an increasingly urgent need for driving schools. The driving school reservation app allows bookers to book a ride online just by picking up their mobile phones, allowing them to "select a coach without leaving home". This can effectively reduce the waiting time of learners and provide them with better quality services. Serve. This system consists of three parties: student end, coach end, and management end. It is not complete with front and back ends, including announcements, driving school instructor reservations, subject training reservations, backend management, user management, reservation list management, reservation record management and export, my reservations, and history. Browsing, My Collection and other modules use the mini program cloud development solution provided by Tencent, without the need for a server or domain name.

Outline design

This project is divided into three components: student end, driving school instructor end, and backend end:

  • Backend: You can add and set the coach’s basic information, account number, login password, etc.
  • Driving school instructor terminal: You can edit your own personal information (avatar, profile, star rating, etc.), set the reservation time slot (reservable time slots, limited number of people in each time period), and verify the user's reservation code on site.
  • Student side: Select the coach and time period you need, place an order and make a reservation. After the reservation is successful, go to the gym and show the reservation code to the coach or staff for verification.

Database Design

MeetModel.DB_STRUCTURE = {
	_pid: 'string|true',
	MEET_ID: 'string|true',
	MEET_ADMIN_ID: 'string|true|comment=添加的管理员',
	MEET_TITLE: 'string|true|comment=标题',
 
	MEET_JOIN_FORMS: 'array|true|default=[]|comment=表单字段设置',
	MEET_DAYS: 'array|true|default=[]|comment=最近一次修改保存的可用日期',

	MEET_CATE_ID: 'string|true|comment=分类编号',
	MEET_CATE_NAME: 'string|true|comment=分类冗余', 

	MEET_FORMS: 'array|true|default=[]',
	MEET_OBJ: 'object|true|default={}',  

	MEET_CANCEL_SET: 'int|true|default=1|comment=取消设置 0=不允,1=允许,2=仅开始前可取消',

	MEET_STATUS: 'int|true|default=1|comment=状态 0=未启用,1=使用中,9=停止预约,10=已关闭',
	MEET_ORDER: 'int|true|default=9999',
	MEET_VOUCH: 'int|true|default=0',

	MEET_QR: 'string|false',

	MEET_PHONE: 'string|false|comment=登录手机',
	MEET_PASSWORD: 'string|false|comment=登录密码',
	MEET_TOKEN: 'string|false|comment=当前登录token',
	MEET_TOKEN_TIME: 'int|true|default=0|comment=当前登录token time',
	MEET_MINI_OPENID: 'string|false|comment=小程序openid',
	MEET_LOGIN_CNT: 'int|true|default=0|comment=登陆次数',
	MEET_LOGIN_TIME: 'int|false|comment=最近登录时间',


	MEET_ADD_TIME: 'int|true',
	MEET_EDIT_TIME: 'int|true',
	MEET_ADD_IP: 'string|false',
	MEET_EDIT_IP: 'string|false',
};

Technology application

  • This project is developed using the WeChat mini program platform.
  • Using Tencent's specialized small program cloud development technology, cloud resources include cloud functions, databases, bandwidth, storage space, timers, etc. Resource quotas are low-priced and can be built without domain names and servers.
  • The mini program itself is ready to use, suitable for use scenarios of gadgets, and also suitable for rapid development and iteration.
  • Cloud development technology uses Tencent's internal links, so there is no risk of being attacked by hackers, no DDOS attacks, saving firewall costs, high security and maintenance-free.
  • Resource carrying capacity can be flexibly expanded at any time according to business development needs.

Difficult to achieve

/** 获取日期设置 */
	async getDaysSet(meetId, startDay, endDay = null) {
		let where = {
			DAY_MEET_ID: meetId
		}
		if (startDay && endDay && endDay == startDay)
			where.day = startDay;
		else if (startDay && endDay)
			where.day = ['between', startDay, endDay];
		else if (!startDay && endDay)
			where.day = ['<=', endDay];
		else if (startDay && !endDay)
			where.day = ['>=', startDay];

		let orderBy = {
			'day': 'asc'
		}
		let list = await DayModel.getAllBig(where, 'day,dayDesc,times', orderBy, 1000);

		for (let k = 0; k < list.length; k++) {
			delete list[k]._id;
		}

		return list;
	}

	// 按时段统计某时段报名情况
	async statJoinCnt(meetId, timeMark) {
		let whereDay = {
			DAY_MEET_ID: meetId,
			day: this.getDayByTimeMark(timeMark)
		};
		let day = await DayModel.getOne(whereDay, 'times');
		if (!day) return;

		let whereJoin = {
			JOIN_MEET_TIME_MARK: timeMark,
			JOIN_MEET_ID: meetId
		};
		let ret = await JoinModel.groupCount(whereJoin, 'JOIN_STATUS');

		let stat = { //统计数据
			succCnt: ret['JOIN_STATUS_1'] || 0, //1=预约成功,
			cancelCnt: ret['JOIN_STATUS_10'] || 0, //10=已取消, 
			adminCancelCnt: ret['JOIN_STATUS_99'] || 0, //99=后台取消
		};

		let times = day.times;
		for (let j in times) {
			if (times[j].mark === timeMark) {
				let data = {
					['times.' + j + '.stat']: stat
				}
				await DayModel.edit(whereDay, data);
				return;
			}
		}

	}

Student terminal UI design

Coach terminal UI design

Backend management UI design

code

git code

Linus took it upon himself to prevent kernel developers from replacing tabs with spaces. His father is one of the few leaders who can write code, his second son is the director of the open source technology department, and his youngest son is an open source core contributor. Robin Li: Natural language will become a new universal programming language. The open source model will fall further and further behind Huawei: It will take 1 year to fully migrate 5,000 commonly used mobile applications to Hongmeng. Java is the language most prone to third-party vulnerabilities. Rich text editor Quill 2.0 has been released with features, reliability and developers. The experience has been greatly improved. Ma Huateng and Zhou Hongyi shook hands to "eliminate grudges." Meta Llama 3 is officially released. Although the open source of Laoxiangji is not the code, the reasons behind it are very heart-warming. Google announced a large-scale restructuring
{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/3808186/blog/7469740