Applet drop-down refresh step - complete

First, the following is provided at app.json "window" in which:

"backgroundTextStyle": "dark",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
Js carried out needs to be set up in the drop-down refresh the page:
onPullDownRefresh: function () {
  wx.showNavigationBarLoading (); // load the icon displayed in the title bar
  wx.request({
    url: 'www.XXXX.com',
    method: 'POST',
    data: {},
    success: function (res) {
      console.log (res) // function execution after the call is completed
    },
    fail: function (res) {
      Functions performed after console.log (res) // call fails
    },
    complete: function (res) {// call failed or the end of the function will be executed
      wx.hideNavigationBarLoading (); // complete stop loading icon
      wx.stopPullDownRefresh();
    }
  })
}
Note: header is set to default

Guess you like

Origin www.cnblogs.com/lljun/p/12580925.html