修改聊天bug

init
xialiang 4 years ago
parent 8c50fa0e1b
commit da639c5a6e

@ -75,9 +75,6 @@ export default {
}, },
}, },
mounted() { mounted() {
// this.target_name = this.latestMessage.expansion
// ? this.latestMessage.expansion.target_name
// : "";
this.data = this.value; this.data = this.value;
this.getConversationItem(); this.getConversationItem();
console.log(this.value, "会话列表"); console.log(this.value, "会话列表");
@ -90,7 +87,14 @@ export default {
}, },
methods: { methods: {
handelDel() { 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) { mouseenter(e) {
this.delConversationShow = e; this.delConversationShow = e;
@ -129,6 +133,7 @@ export default {
// //
setConversationIndex() { setConversationIndex() {
// //
this.$emit("update:nowIndex", this.ind); this.$emit("update:nowIndex", this.ind);
// targetId // targetId
this.$emit("update:targetId", this.value.targetId); this.$emit("update:targetId", this.value.targetId);
@ -138,17 +143,6 @@ export default {
targetId: this.value.targetId, targetId: this.value.targetId,
type: this.value.type, 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"], props: ["getTargetId"],
mounted() { mounted() {
console.log(this, "this111111");
this.rongyunIMCGetList(); this.rongyunIMCGetList();
this.$bus.on("rongyunIMCGetList", this.rongyunIMCGetList); this.$bus.on("rongyunIMCGetList", this.rongyunIMCGetList);
}, },
watch: { watch: {
// targetid // targetid
targetId(e) { // targetId(e) {
this.$bus.emit("getList", e, 1); // this.$bus.emit("getList", e, 1);
}, // },
nowInfo(e) { nowInfo(e) {
// console.log(e, "nowInfo"); // console.log(e, "nowInfo");

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

Loading…
Cancel
Save