小程序点击tabar刷新此页面的方法:
调用onShow函数实现。
onShow: function(){var that =this;
wx.request({
url: app.globalData.web_url+'yourApi?open_id='+ wx.getStorageSync('open_id'),
success: function(res){
that.setData({
cartList: res.data.cartList,
cartSize: res.data.cartSize,
totalAmount: res.data.totalAmount
})
}
})
},