收藏
回答

wx.hideNavigationBarLoading()在非首个tab下失效

问题模块
API和组件
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  (未经腾讯允许,不得转载)
邀请回答
复制链接收藏关注问题回答

1 个回答

  • 2017-04-25

    PS:开发者工具下正常,ios真机下才有这个问题

    2017-04-25
    赞同
    回复