Page({ data: { details: {}, // 用户填写的数据 agentReply: '' // 智能体的回复 }, onLoad(options) { const eventChannel = this.getOpenerEventChannel(); // 监听并接收来自 FlightCrew.js 传递的数据 eventChannel.on('sendData', (data) => { console.log('接收到的数据: ', data); // 打印接收到的数据,便于调试 this.setData({ details: data.details, // 用户的详细数据 agentReply: data.agentReply // 智能体的回复 }); }); }, // 回到首页的函数 goToHome() { wx.switchTab({ url: '/pages/home/home', // 'home' Tab 页的路径 }); } });