1. 微信小程序页面跳转方法总结
2. navigateTo堆栈到十层不跳转问题
// 封装navigateTo 避免wx.navigateTo堆栈到十层不跳转问题
function navigateTo(url) {
console.log("当前页面栈个数================>", getCurrentPages().length)
if (getCurrentPages().length >= 10) {
wx.redirectTo({
url: url,
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
} else {
wx.navigateTo({
url: url,
})
}
}