修改聊天bug

init
xialiang 4 years ago
parent 8c50fa0e1b
commit da639c5a6e

@ -75,9 +75,6 @@ export default {
},
},
mounted() {
// this.target_name = this.latestMessage.expansion
// ? this.latestMessage.expansion.target_name
// : "";
this.data = this.value;
this.getConversationItem();
console.log(this.value, "会话列表");
@ -90,7 +87,14 @@ export default {
},
methods: {
handelDel() {
alert();
console.log(this.data.type, this.data.targetId, "del");
confirm(this.data.type, this.data.targetId, "del").then(() => {
const conversation = this.RongIMClient.Conversation.get({
targetId: this.data.targetId,
type: this.data.type,
});
conversation.destory().then(() => console.log("删除会话成功"));
});
},
mouseenter(e) {
this.delConversationShow = e;
@ -129,6 +133,7 @@ export default {
//
setConversationIndex() {
//
this.$emit("update:nowIndex", this.ind);
// targetId
this.$emit("update:targetId", this.value.targetId);
@ -138,17 +143,6 @@ export default {
targetId: this.value.targetId,
type: this.value.type,
});
//
const conversation_info = {
person_name: this.name,
avatar: this.avatar,
targetId: this.value.targetId,
type: this.value.type,
};
localStorage.setItem(
"conversation_info",
JSON.stringify(conversation_info)
);
},
//

@ -57,14 +57,15 @@ export default {
},
props: ["getTargetId"],
mounted() {
console.log(this, "this111111");
this.rongyunIMCGetList();
this.$bus.on("rongyunIMCGetList", this.rongyunIMCGetList);
},
watch: {
// targetid
targetId(e) {
this.$bus.emit("getList", e, 1);
},
// targetId(e) {
// this.$bus.emit("getList", e, 1);
// },
nowInfo(e) {
// console.log(e, "nowInfo");

@ -149,12 +149,12 @@ export default {
},
methods: {
// ==> type=
handelSendMessage(type = 0, message = {}) {
handelSendMessage(sendType = 0, message = {}) {
const user_info = JSON.parse(localStorage.getItem("user_info"));
const conversation_info = JSON.parse(
localStorage.getItem("conversation_info")
);
if (type == 0) {
if (sendType == 0) {
message = {
content: { content: this.textdata },
expansion: {
@ -178,7 +178,7 @@ export default {
console.log(message, "message 未发送");
this.rongYunSend(message);
}
console.log(message, type, "handelSendMessage");
console.log(message, sendType, "handelSendMessage");
// push
this.messageResult.push(message);
// console.log(conversation_info, "conversation_info");

Loading…
Cancel
Save