From f4ba8edec28eda8e1ed4af34c25ed7957a2fb276 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Tue, 1 Sep 2020 15:55:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/zhibo/index.nvue | 14 ++++++++++++++ static/imservice.js | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/pages/zhibo/index.nvue b/pages/zhibo/index.nvue index cf26a68..2f52833 100644 --- a/pages/zhibo/index.nvue +++ b/pages/zhibo/index.nvue @@ -428,6 +428,7 @@ export default { that.room = that.chatRoomService.room; that.chatRoomService.initialWhenOnlineUserChange(that.newpeople) that.chatRoomService.initialWhenNewMessage(that.whenNewMessage); + that.chatRoomService.jieshuzhibo = this.jieshu; this.$forceUpdate(); console.log(that.room) @@ -440,6 +441,19 @@ export default { this.chatRoomService.quitRoom(); }, methods:{ + jieshu(text){ + console.log(text) + uni.showModal({ + title: '提示', + content: text.content, + showCancel:false, + success: function (res) { + uni.navigateBack({ + delta: 1 + }); + } + }); + }, errors(a){ console.log(a) }, diff --git a/static/imservice.js b/static/imservice.js index 9d85284..0b3f6ec 100644 --- a/static/imservice.js +++ b/static/imservice.js @@ -77,6 +77,8 @@ function IMService() { //群列表发生改变 this.onGroupListChange = function (groups) {}; + //结束直播 + this.jieshuzhibo = function(messages){} this.whenNewMessage = function () { @@ -785,6 +787,11 @@ IMService.prototype.initialWhenOnlineUserChange = function (whenOnlineUserChange IMService.prototype.listenerNewMessage = function () { this.im.on(GoEasyIM.EVENT.GROUP_MESSAGE_RECEIVED, (message) => { + console.log(message) + if(message.senderId == 0){ + this.jieshuzhibo(JSON.parse(message.payload.text)); + return; + } var content = JSON.parse(message.payload.text); this.addNewMessage(message); this.whenNewMessage(content);