Tencent / wepy

小程序组件化开发框架
https://wepyjs.gitee.io/wepy-docs/
Other
22.51k stars 3.05k forks source link

下拉刷新回调中使用wepy.request问题 #1717

Closed DarrenHou1993 closed 5 years ago

DarrenHou1993 commented 6 years ago

Description

使用小程序的下拉刷新功能时,onPullDownRefresh回调写成官方形式的没问题。如下:

onPullDownRefresh() {
    wx.request({
      url: 'http://www.baidu.com',
      method: 'GET',
      success: function () {
        console.log('success')
        wx.stopPullDownRefresh();
      }
    })
  }

但是如果写成wepy.request,则下拉刷新的时候,屏幕回弹异常。正常情况下是下拉后会回滚到屏幕最上方,显示 三个点 在顶部。异常情况是 三个点被顶出屏幕之上。 下拉距离越多,被顶出去的越多。 代码如下

onPullDownRefresh() {
    wepy.request({
      url: 'http://www.baidu.com',
      method: 'GET'
    }).then(() => {
      console.log('success')
      wepy.stopPullDownRefresh();
    }, err => { })
  }

[Description of the issue]

Environment

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. 因为这个 Issue 最近没有任何有效回复,所以被自动标记为了stale。 如果在未来7天依旧没有任何激活操作,那么该 Issue 将会被自动关闭。 感谢您的提问。