lljun

首先在app.json下“window”中进行如下设置:

"backgroundTextStyle": "dark",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
在需要进行下拉刷新的页面进行js设置:
onPullDownRefresh: function () {
  wx.showNavigationBarLoading(); //在标题栏中显示加载图标
  wx.request({
    url: \'www.XXXX.com\',
    method: \'POST\',
    data: {},
    success: function (res) {
      console.log(res)//完成调用后执行的函数
    },
    fail: function (res) {
      console.log(res)//调用失败后执行的函数
    },
    complete: function (res) {//调用失败或结束都会执行的函数
      wx.hideNavigationBarLoading(); //完成停止加载图标
      wx.stopPullDownRefresh();
    }
  })
}
注:header为默认设置

分类:

技术点:

相关文章:

  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2021-12-10
猜你喜欢
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2021-07-31
  • 2022-01-07
相关资源
相似解决方案