#小程序云开发挑战赛#-失全拾美-周易
有时间的朋友帮我点个赞!谢谢谢谢(小声bb,这个小程序我们2个人5天肝完,挺水的hhh)
一、应用场景
校园内,同学们在日常生活中,丢失物品的情况时有发生,如书本、雨伞、校园一卡通甚至手机电脑等贵重物品。目前针对失物处理的办法是上墙(学校官方的表白墙)寻找,但是由于墙发帖的时间不够及时,真正物归原主的失物还是不够多。因此,我们利用微信小程序开发的失物招领平台,提高了失物招领消息的时效性。
二、目标用户
各学校全体师生
三、实现思路
本小程序采用基于云开发的原生开发,用到了云数据库存储数据,使用云函数获取当前用户的openid、读写操作云数据库,云存储保存图片,云调用内容安全接口检查提交信息是否存在违法违规内容。
失物招领包括失物和拾物两个模块,每个模块又分为上传信息和查看信息两个模块以及个人信息查看和修改功能。
四、架构图
五、效果截图
六、功能代码展示
getFoundMessage: function () {
let that = this
db.collection("found").field({
"title": true,
"description": true,
"time": true,
"picture": true,
"status": true
}).get({
success: res => {
console.log(res)
that.setData({
arr: res.data
})
console.log(that.data.arr)
},
fail: res => {
console.log(res)
}
})
},
getLostMessage: function () {
let that = this
db.collection("lost").field({
"title": true,
"description": true,
"time": true,
"picture": true,
"status": true
}).get({
success: res => {
console.log(res)
that.setData({
arr: res.data
})
console.log(that.data.arr)
},
fail: res => {
console.log(res)
}
})
},
onNavBarTap: function (event) {
let navbarTapIndex = event.currentTarget.dataset.navbarIndex
this.setData({
navbarActiveIndex: navbarTapIndex
})
if(navbarTapIndex == 0){
this.getLostMessage()
}else{
this.getFoundMessage()
}
},
onBindAnimationFinish: function ({detail}) {
this.setData({
navbarActiveIndex: detail.current
})
if(this.data.navbarActiveIndex == 0){
this.getLostMessage()
}else{
this.getFoundMessage()
}
},
onLoad:function(options){
this.getLostMessage()
}
这个是个人失拾记录切换的核心代码