1.在json页面配置:
{
"enablePullDownRefresh": true
}
2.调用刷新函数
onPullDownRefresh: function() {
this.updateBlogs()
},
updateBlogs: function () {
var that = this
wx.request({
url: common.baseUrl + 'blog_rss.php',
data: {
},
header: {
'Content-Type': 'application/json'
},
success: function (res) {
var feeds = feed.getBlogs(res.data);
wx.setStorage({
key: "blog_feeds",
data: feeds
})
that.setData({
feeds: feeds
})
}
})
},
网友评论