解决微信小程序使用switchTab跳转后页面不刷新的问题

wx.switchTab({
url: '/pages/cart/index',
success:function () {
var page = getCurrentPages().pop();
if (page == undefined || page == null) return;
page.onLoad(); //重新刷新页面
}
})