收藏
回答

stopPullDownRefresh无法回弹

框架类型 问题类型 API/组件名称 终端类型 操作系统 微信版本 基础库版本
小程序 Bug stopPullDownRefresh 客户端 Android 6.7.0 1.0.0

大神们:


我看到有人提这样的问题,有人提出和setTimeout和关闭wx.showLoading({

无法解决, 既然我已经把 wx.stopPullDownRefresh放入

success: function (res) {

//停止PullDown


}中间 ;

就表示调用成功后才stopPullDownRefresh,

比如说在Jquery中我在成功执行请求后应该没有问题,为什么还要延时执行。

jquery在获取data后执行,完全是没问题。


$.post( "InsertDefcode" ,$( "form#DefForm" ).serialize(), function (data) { 
        
                      if (data== "ok" ){
          
                 toastr.success( "缺陷添加成功!" "Hi" )
          
                              
                      else if (data== "ex" ){
                         location.href = "login.html" ;
                       
                      else {
                         toastr.warning( "缺陷/方案添加失败!" "Hi" )
                      
         Showlist();                 
              
             }, "text" ).error( function () {toastr.warning( "添加失败!" "Hi" ) });   


下面小程序代码

onPullDownRefresh: function () {
    wx.showNavigationBarLoading()
   wx.showLoading({ 
      title: '加载中' ,
    })
    var that = this
    var that1 = this
    wx.request({
      url: 'https://xxxxxxxxxxxxxx' , //仅为示例,并非真实的接口地址
      data: {
        loc: 'room2'
      },
      header: {
        'content-type' 'application/json' // 默认值
      },
      success: function (res) {
      
        console.log(res.data[0].update)
        wx.hideLoading();
        that.setData({
          msg: res.data[0].update
        });
        that.ecComponent = that.selectComponent( '#mychart-dom-bar' );
        that.ecComponent.init((canvas, width, height) => {
          // 获取组件的 canvas、width、height 后的回调函数
          // 在这里初始化图表
          const chart = echarts.init(canvas, null , {
            width: width,
            height: height
          });
          setOption(chart, res.data[0].tem, '温度' '°C' );
 
          // 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问
          that.chart = chart;
 
          // 注意这里一定要返回 chart 实例,否则会影响事件处理等
          return chart;
        });
 
        // 获取组件
        that1.ecComponent = that1.selectComponent( '#mychart-dom-bar1' );
        that1.ecComponent.init((canvas, width, height) => {
          // 获取组件的 canvas、width、height 后的回调函数
          // 在这里初始化图表
          const chart1 = echarts.init(canvas, null , {
            width: width,
            height: height
          });
          setOption(chart1, res.data[0].hum, '湿度' '%' );
 
          // 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问
          that1.chart1 = chart1;
 
          // 注意这里一定要返回 chart 实例,否则会影响事件处理等
          return chart1;
 
        });
      //  setTimeout(()=>{
       //   wx.stopPullDownRefresh;
        //  wx.hideNavigationBarLoading()
 
     //   },500)
         wx.stopPullDownRefresh;
        wx.hideNavigationBarLoading()
 
      }
    })
 
 
    console.log( "n11111111111111g" );
 
 
  }


无法回弹,我的手机是OPPO  R11+   ,但是可以在点一下页面后马上回弹。


回答关注问题邀请回答
收藏

4 个回答

  • 2018-08-30

    这样写了之后 还是无法回弹啊

    2018-08-30
    有用 1
    回复
  • 李良山
    李良山
    2018-07-29

    wx.stopPullDownRefresh 放在最前面,

    onPullDownRefresh: function () {

    wx.stopPullDownRefresh();、

    XXXXXXXXXXXXX其他代码

    }

    2018-07-29
    有用 1
    回复 1
    • 2018-08-10

      按你的方法确实有效

      2018-08-10
      回复
  • 19天
    19天
    2018-10-11

    iponex 也有这个问题,无法回弹。头疼死了。跟你的代码逻辑基本都差不多。

    2018-10-11
    有用
    回复
  • Harvey
    Harvey
    2018-07-29

    还是无法弹回,要再点一下后才能弹回。

    2018-07-29
    有用
    回复
登录 后发表内容