app.vue
//监听点击通知栏
plus.push.addEventListener('click', function(message) {
uni.$emit('toChat',{
currentUserId:message.payload.fromId,
username:message.payload.username
})
});
index.vue
toChat(currentUserId,username){
this.currentUserId = currentUserId
uni.navigateTo({
url:'/pages/chat/chat?currentUserId='+currentUserId+"&mineId="+this.mineId+"&username="+username
})
},
<user v-if="mineId!=item._id"
:item="item"
@click.native="toChat(item._id,item.username)"
></user>
chat.vue
async onLoad({currentUserId,mineId,username}) {
this.currentUserId = currentUserId
......
}
<text>{{currentUSerId}}</text>
最后
以上就是大气月光最近收集整理的关于unipush接收消息在页面显示的全部内容,更多相关unipush接收消息在页面显示内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复