获取页面 url 传递过来的参数。 url中传递的参数只能在 onLoad() 事件中接收,在 onShow() 事件中不能接收 。在特定的情况下有必须在 onShow() 事件中接收,这时候就要用到 getCurrentPages() 。onShow() { let pages = getCurrentPages(); // 获取小程序的页面栈 let currentPage = pages[pages.length-