- 小程序云开发数据库,下拉刷新后,上拉触底事件不加载数据?
https://ke.qq.com/course/365835?taid=2931345244656907 按照这个教程写的云开发 数据库实战 没有下拉刷新前可以正常加载,刷新后触底加载的数据就成0了,只显示20条数据 [图片] [代码]/**[代码][代码] [代码][代码]* 页面相关事件处理函数--监听用户下拉动作[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onPullDownRefresh: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]indexCollection.get().then(res => {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]index: res.data[代码][代码] [代码][代码]},res => {[代码][代码] [代码][代码]wx.stopPullDownRefresh()[代码][代码] [代码][代码]wx.showToast({[代码][代码] [代码][代码]title: [代码][代码]'刷新成功'[代码][代码],[代码][代码] [代码][代码]icon: [代码][代码]"none"[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}, 200)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面上拉触底事件的处理函数[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onReachBottom: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]console.log([代码][代码]"触底啦"[代码][代码])[代码][代码] [代码][代码]let page = [代码][代码]this[代码][代码].data.page + 20;[代码][代码] [代码][代码]console.log(page)[代码][代码] [代码][代码]indexCollection.skip(page).get().then(res => {[代码][代码] [代码][代码]let new_data = res.data[代码][代码] [代码][代码]let old_data = [代码][代码]this[代码][代码].data.index[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]index: old_data.concat(new_data),[代码][代码] [代码][代码]page: page[代码][代码] [代码][代码]}, res => {[代码][代码] [代码][代码]console.log(res);[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码] [代码] [代码][代码]},[代码]
2019-09-01 - 添加插屏广告后报错Uncaught (in promise)
小白一个,不懂代码。使用的是WordPress开源版小程序 在添加插屏广告后,在文章页 点击返回按钮后 开发者工具会报错 Uncaught (in promise) {errMsg: "updateTextView:fail 32768 not found"} ,然后点击任何文章都会报这个错误。 真机调试中又没有这个报错,一切都正常,广告也正常显示 [图片]
2019-07-29