项目进度-01
项目进度-01(2020.11.01~11.08)
项目整体进度:
1.利用微信开发者工具中的云开发控制平台,将小程序项目搭载了数据库,用以实现后续的各项功能,本周主要利用数据库实现了用户的注册与登录功能,图示是项目成员全部完成注册,注册信息被保存在了云数据库中。云数据库的搭载,只需要注册appid即可。图中的cloudfunctions即为云函数库。
2.实现用户注册的功能,能够动态的管理接入的用户。在用户注册的过程中还拥有一定的容错能力,包括密码长度限制,是否重复注册等等。
注册界面信息栏左侧的小图标直接上传到了云开发控制平台的存储区中,可以直接在注册页面的wxml文件中通过url地址显示该图标。控制字段:
注册时容错功能
(密码长度不能小于六位)
通过对象的length属性判断用户输入的密码长度,若小于六位,则出现错误提示窗口。
控制字段:
else if (this.data.password1.length < 6) {
wx.showToast({
title: ‘密码长度过短’,
icon: ‘none’,
})
}
3.登录功能的实现是通过将用户输入的学号和密码与数据库中的对象信息进行比对,若成功查找到,则予以登录成功,反之则无法登录。
if(res.data.length===1){
wx.showToast({
title: ‘登录成功’,
});
即若查找后的结果对象数组中存在元素,即数组长度为1(data时用来存放结果而存在的对象数组)则证明是注册过的合法用户,予以登录。
项目成员分工:
王湛:
data: {
username:"",
password1:"",
password2:"",
name:""
},
else if (this.data.password1!this.data.password2) {
wx.showToast({
title: ‘两次输入密码不一致’,
icon: ‘none’,
})
}
else{
db.collection(“users”).where({
username:this.data.username,
})
.get({
success:res=>{
if(res.data.length=1){
wx.showToast({
title: ‘该学号已被注册’,
icon:“none”,
});
}
else{
db.collection(“users”).add({
data:{
password:this.data.password2,
name:this.data.name,
username:this.data.username
},
success: result=> {
wx.showToast({
title: ‘注册成功’
});
setTimeout(function(){
wx.navigateTo({
url: ‘…/login/login’,
})
},500)
}
})
}
}
})
}
徐鹏:
userRegister(){
if (this.data.username.length == 0) {
wx.showToast({
title: ‘学号不能为空’,
icon: ‘none’,
})
}
else if (this.data.username.length != 11) {
wx.showToast({
title: ‘请输入正确的学号’,
icon: ‘none’,
})
}
王琪:
else if (this.data.name.length == 0) {
wx.showToast({
title: ‘用户名不能为空’,
icon: ‘none’,
})
}
else if (this.data.password1.length == 0) {
wx.showToast({
title: ‘密码不能为空’,
icon: ‘none’,
})
}
晏梓昂:
userSubmit(){
if(this.data.username.length=0){
wx.showToast({
icon:‘none’,
title: ‘学号不能为空’,
})
}
else if(this.data.password.length=0){
wx.showToast({
icon:‘none’,
title: ‘密码不能为空’,
})
}
许振宁:
else{
db.collection(“users”).where({
username:this.data.username,
password:this.data.password
})
.get({
success:res=>{
if(res.data.length===1){
wx.showToast({
title: ‘登录成功’,
});
app.userInfo=res.data;
setTimeout(function(){
wx.reLaunch({
url: ‘…/index/index’,
})
},500)
}
else{
wx.showToast({
icon:‘none’,
title: ‘学号或密码错误’,
项目燃尽图:
下阶段预计进度:
开发首页的商品展示、分类搜索、以及商品发布功能。
附会议记录照片: