//index.js //获取应用实例 const app = getApp() var plugin = requirePlugin("myPlugin"); var chat = plugin.getChatComponent(); Page({ data: { }, onLoad: function () { wx.getSystemInfo({ success: (res) => { let isIOS = res.system.indexOf('iOS') > -1 let navHeight = 0 if (!isIOS) { navHeight = 48 } else { navHeight = 44 } this.setData({ status: res.statusBarHeight, navHeight: navHeight, statusBarHeight: res.statusBarHeight + navHeight }) } }) }, getQueryCallback: function (e) { }, goBackHome: function () { wx.navigateBack({ delta: 1 }) }, back:function(e) { this.goBackHome() }, chatOnFinish:function(e){ var plugin = requirePlugin("myPlugin"); var chat = plugin.getChatComponent(); chat.clearChatRecord(); chat.scrollToBottom(); }, onShareAppMessage:function(e) { console.log(e,'2') } })