diff --git a/im-uniapp/common/publicFc.js b/im-uniapp/common/publicFc.js index ea67fac..6008e2a 100644 --- a/im-uniapp/common/publicFc.js +++ b/im-uniapp/common/publicFc.js @@ -600,6 +600,7 @@ export default { var msgOnlie = {} //聊天记录 var msgList = {} + debugger var url = '' if (windowType == 'SINGLE') { msgOnlie = { @@ -665,7 +666,7 @@ export default { type: 3 }; var msgSendType = 'wating'; - + debugger //开始发送消息 store.dispatch('sendMsg', { userId: userId, diff --git a/im-uniapp/common/socketTask.js b/im-uniapp/common/socketTask.js index 8ba073f..23dd7c8 100644 --- a/im-uniapp/common/socketTask.js +++ b/im-uniapp/common/socketTask.js @@ -36,9 +36,10 @@ export default { console.log("onP2PMessage :" + e); e = JSON.parse(e) e.data.pushType="MSG" + const _data=JSON.parse(e.data.messageBody) e.data.msgContent={ msgType:"TEXT", - content:e.data.messageBody, + content:_data.content, disturb:false, top:false, } diff --git a/im-uniapp/store/index.js b/im-uniapp/store/index.js index 90b6808..109b243 100644 --- a/im-uniapp/store/index.js +++ b/im-uniapp/store/index.js @@ -66,6 +66,7 @@ import { createStore } from 'vuex' console.log("========================") console.log("========================") console.error(data) + debugger _im.sendP2PMessage(_im.createP2PTextMessage(data.userId,data.data.content)) }, updateChatDataState(context,data){ @@ -165,10 +166,6 @@ import { createStore } from 'vuex' // }) _im.getSingleUserInfo(userId).then((res)=>{ - console.log(res.data) - console.log(res.data) - console.log(res.data) - console.log(res.data) if (res.code == 200) { var detail=res.data data1[userId]={ diff --git a/im-uniapp/wx/chatWindow/index.vue b/im-uniapp/wx/chatWindow/index.vue index bceaadc..8312085 100644 --- a/im-uniapp/wx/chatWindow/index.vue +++ b/im-uniapp/wx/chatWindow/index.vue @@ -177,6 +177,7 @@ // uni.$on('onP2PMessage', this.onMessage) this.talkTo = e; + console.log(this.talkTo) // 根据Id this.$store .dispatch('createChatObj', { @@ -185,6 +186,9 @@ }) .then(res => { this.localData = res.data; + + console.log(res.data) + if (e.windowType == 'SINGLE') { uni.setNavigationBarTitle({ title: this.localData.fromInfo.nickName