|
|
@ -1,8 +1,11 @@ |
|
|
<template> |
|
|
<template> |
|
|
<el-container class="r-chat-box"> |
|
|
<el-container class="r-chat-box"> |
|
|
<el-header height="60px"> |
|
|
<el-header height="60px"> |
|
|
{{title}} |
|
|
<span>{{title}}</span> |
|
|
|
|
|
<span class="btn-side el-icon-more" @click="showSide=!showSide"></span> |
|
|
</el-header> |
|
|
</el-header> |
|
|
|
|
|
<el-container> |
|
|
|
|
|
<el-container class="content-box"> |
|
|
<el-main class="im-chat-main" id="chatScrollBox"> |
|
|
<el-main class="im-chat-main" id="chatScrollBox"> |
|
|
<div class="im-chat-box"> |
|
|
<div class="im-chat-box"> |
|
|
<ul> |
|
|
<ul> |
|
|
@ -37,9 +40,15 @@ |
|
|
</div> |
|
|
</div> |
|
|
</el-footer> |
|
|
</el-footer> |
|
|
</el-container> |
|
|
</el-container> |
|
|
|
|
|
<el-aside class="chat-group-side-box" width="20%" v-show="showSide"> |
|
|
|
|
|
<chat-group-side :group="group" :groupMembers="groupMembers" @reload="loadGroup(group.id)"></chat-group-side> |
|
|
|
|
|
</el-aside> |
|
|
|
|
|
</el-container> |
|
|
|
|
|
</el-container> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import ChatGroupSide from "./ChatGroupSide.vue"; |
|
|
import MessageItem from "./MessageItem.vue"; |
|
|
import MessageItem from "./MessageItem.vue"; |
|
|
import FileUpload from "../common/FileUpload.vue"; |
|
|
import FileUpload from "../common/FileUpload.vue"; |
|
|
|
|
|
|
|
|
@ -47,7 +56,8 @@ |
|
|
name: "chatPrivate", |
|
|
name: "chatPrivate", |
|
|
components: { |
|
|
components: { |
|
|
MessageItem, |
|
|
MessageItem, |
|
|
FileUpload |
|
|
FileUpload, |
|
|
|
|
|
ChatGroupSide |
|
|
}, |
|
|
}, |
|
|
props: { |
|
|
props: { |
|
|
chat: { |
|
|
chat: { |
|
|
@ -57,6 +67,7 @@ |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
sendText: "", |
|
|
sendText: "", |
|
|
|
|
|
showSide: false, |
|
|
group: {}, |
|
|
group: {}, |
|
|
groupMembers: [] |
|
|
groupMembers: [] |
|
|
} |
|
|
} |
|
|
@ -174,6 +185,9 @@ |
|
|
// 借助file对象保存对方id |
|
|
// 借助file对象保存对方id |
|
|
file.targetId = this.chat.targetId; |
|
|
file.targetId = this.chat.targetId; |
|
|
}, |
|
|
}, |
|
|
|
|
|
handleCloseSide() { |
|
|
|
|
|
this.showSide = false; |
|
|
|
|
|
}, |
|
|
sendTextMessage() { |
|
|
sendTextMessage() { |
|
|
|
|
|
|
|
|
if (!this.sendText.trim()) { |
|
|
if (!this.sendText.trim()) { |
|
|
@ -214,7 +228,7 @@ |
|
|
method: 'get' |
|
|
method: 'get' |
|
|
}).then((group) => { |
|
|
}).then((group) => { |
|
|
this.group = group; |
|
|
this.group = group; |
|
|
this.$store.commit("updateChatFromGroup",group); |
|
|
this.$store.commit("updateChatFromGroup", group); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
this.$http({ |
|
|
this.$http({ |
|
|
@ -244,8 +258,8 @@ |
|
|
mine() { |
|
|
mine() { |
|
|
return this.$store.state.userStore.userInfo; |
|
|
return this.$store.state.userStore.userInfo; |
|
|
}, |
|
|
}, |
|
|
title(){ |
|
|
title() { |
|
|
let size = this.groupMembers.filter(m=>!m.quit).length; |
|
|
let size = this.groupMembers.filter(m => !m.quit).length; |
|
|
return `${this.chat.showName}(${size})`; |
|
|
return `${this.chat.showName}(${size})`; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -259,4 +273,15 @@ |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|
|
|
|
.btn-side { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
right: 20px; |
|
|
|
|
|
line-height: 60px; |
|
|
|
|
|
font-size: 22px; |
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
|
|
|
|
&:hover { |
|
|
|
|
|
font-size: 30px; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
|