Merge pull request '添加活动消息' (#78) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/demingshangjia/pulls/78
This commit is contained in:
luyuan 2020-09-01 16:07:09 +08:00
commit 721087e372
2 changed files with 16 additions and 2 deletions

View File

@ -11,6 +11,10 @@
</view>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="navtos()">
<text>活动消息</text>
<image src="/static/image/user/1.png"></image>
</view>
<view class="nav" @click="toOthersPage('fans')">
<text>我的粉丝</text>
<image src="/static/image/user/1.png"></image>
@ -71,8 +75,14 @@ export default {
this.imService.connectIM()
},
methods: {
loginOut(){
this.imService.disconnect();
navtos(){
console.log(1212)
this.$u.route({
url:"/pages/messages/list"
})
},
loginout(){
this.imService.disconnect()
uni.clearStorage();
this.$refs.uToast.show({
title: "退出登陆成功!",

View File

@ -784,6 +784,10 @@ 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){
return ;
}
var content = JSON.parse(message.payload.text);
this.addNewMessage(message);
this.whenNewMessage(content);