wx.navigateTo({
url: '/pages/otherPage/otherPage?myself=1',
})
方法一:onLode() 获取
onLoad: function (options) {
console.log(options);
}
方法二:onShow() 获取
onShow: function () {
// 获取当前小程序的页面栈
let pages = getCurrentPages()
// 数组中索引最大的页面--当前页面
let currentPages = pages[pages.length-1]
console.log(currentPages.options);
}
getCurrentPages():获取当前小程序的页面栈,页面栈即小程序所有页面的实例数组,最大为10