参考:https://blog.csdn.net/qq_38290251/article/details/82911840
当前页面
var pages = getCurrentPages(); //当前页面 var prevPage = pages[pages.length - 2]; //上一页面 prevPage.setData({ //直接给上一个页面赋值 addresschose: that.data.address[index], }); wx.navigateBack({ //返回 delta: 1 })
要跳的上一级页面
onShow: function () { let pages = getCurrentPages(); let currPage = pages[pages.length - 1]; if (currPage.data.addresschose) { this.setData({ //将携带的参数赋值 address: currPage.data.addresschose, addressBack: true }); console.log(this.data.address, '地址') } }