- wx.hideNavigationBarLoading()在非首个tab下失效
[代码]var app = getApp();[代码][代码]Page({[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]//id: 121,[代码][代码] [代码][代码]logo: getApp().globalData.logo,[代码][代码] [代码][代码]title: getApp().globalData.title,[代码][代码] [代码][代码]post_title:"",[代码][代码] [代码][代码]hasContent: "",[代码][代码] [代码][代码]content:""[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onLoad: function(options){[代码][代码] [代码][代码]var that = this;[代码][代码] [代码][代码]wx.showNavigationBarLoading();[代码][代码] [代码][代码]var id = options.id[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: getApp().globalData.url+'wp-json/wp/v2/pages/'+ id,[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]items: 'id,title,date,content'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]header: {[代码][代码] [代码][代码]'content-type': 'application/json'[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: function(res) {[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]load:true,[代码][代码] [代码][代码]post_title: res.data.title.rendered,[代码][代码] [代码][代码]content: res.data.content.rendered[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]complete: function() {[代码][代码] [代码][代码]wx.hideNavigationBarLoading();[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]onPullDownRefresh: function(options) {[代码][代码] [代码][代码]var that = this;[代码][代码] [代码][代码]this.onLoad();[代码][代码] [代码][代码]wx.stopPullDownRefresh();[代码][代码] [代码][代码]},[代码][代码]})[代码]代码如上,如果是设成第一个入口,就能正常隐藏loadingBar,但通过tabBar进入后,该功能失效
2017-04-18 - 请问如何在onPullDownRefresh中获取链接中的参数
请问如何在onPullDownRefresh中获取链接中的参数,执行后需要刷新页面(this.onLoad),但这个时候onLoad的参数就丢失了
2017-04-15