diff --git a/pages/index/index.js b/pages/index/index.js index de68c92..55089f5 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -197,6 +197,14 @@ Page({ app.globalData.openId = res.data.openId; // 初始化websocket app.initSocket(); + // 回调发送给自己的消息 + app.globalData.socketReceiver = function(e) { + let msgList = that.data.msgList + msgList.push(e) + that.setData({ + msgList: msgList + }) + } Http.setToken(res.data.token); if (options&&(options.couponChannelId || options.orderId)){ that.checkuerstatus(options);