微信小程序云开发(失物招领平台) |
您所在的位置:网站首页 › 失物招领平台简介 › 微信小程序云开发(失物招领平台) |
微信小程序云开发(失物招领平台)P1
前言: 校园失物招领小程序是针对在校大学生丢失物品的信息,分类集中发布,方便大学生学习生活的应用软件。 本团队开发校园失物招领的微信小程序,旨在实现失主与拾得者的快速高效率对接,尽量降低减少遗失物品对大学生生活的干扰和失主在寻找遗失物品上所产生的时间成本与金钱成本的浪费。我们旨在为社会为大学生服务,实现自身公益价值。且力图通过O2O网上失物招领平台的商业运转模式,实现“丢失物品登记——信息发布——物品检索与匹配——找回失物”的服务系统的自运转。 功能: 下面展示 主页代码效果及js部分。 2.主页展示信息 onLoad: function () { let that = this db.collection('swiper').get({ success: function (res) { console.log('轮播图获取成功', res) that.setData({ banner: res.data }) }, fail: function (res) { console.log('轮播图获取失败', res) }, }) db.collection('fenlei').get({ success: function (res) { console.log('分类获取成功', res) that.setData({ fenlei: res.data }) }, fail: function (res) { console.log('分类获取失败', res) }, }) }, onShow: function (e) { let that = this db.collection('product').orderBy('date', 'desc').get({ success: function (res) { console.log('获取成功', res) that.setData({ search: [], product: res.data }) }, fail: function (res) { console.log('获取失败', res) }, }) },3.因云开发一次只能获取最多20条信息,所以需要一个上拉触底获取更多信息 onReachBottom: function () { wx.showLoading({ title: '刷新中!', duration:1000 }) let x = this.data.product_nums + 20 console.log(x) let old_data = this.data.product db.collection('product').orderBy('date', 'desc').skip(x) // 限制返回数量为 20 条 .get() .then(res => { if ( res.data.length==0 ){ wx.showLoading({ title: '我也是有底线的', duration: 1000 }) } this.setData({ product:old_data.concat(res.data), product_nums: x }) console.log(res.data) }) .catch(err => { console.error(err) }) console.log('circle 下一页'); }, |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |