问题:
页面 A 打开页面 B ,B 如何将参数通过 EventChannel 传回 A
解决:
A 打开 B 时在 A 中设置好对事件 ee 监听,然后 B 中通过
- A 打开 B 时,设置好 对事件监听
- B 页返回 A 时(或事件发生时使用 this.getOpenerEventChannel().emit(…) 通知 A 页面 )
参考:
https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html
https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.html