|
@@ -81,7 +81,12 @@
|
|
|
p-id="3078"
|
|
|
width="48"
|
|
|
height="48"
|
|
|
- @click="chatVisible = true"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ chatVisible = true;
|
|
|
+ this.$bus.$emit('scrollToBottom');
|
|
|
+ }
|
|
|
+ "
|
|
|
>
|
|
|
<path
|
|
|
d="M512 796a456.672 456.672 0 0 1-74.768-6.4L262 896V718.976C170.64 654.832 112 556.48 112 446 112 252.704 291.088 96 512 96s400 156.704 400 350S732.912 796 512 796z m0-650c-193.296 0-350 134.32-350 300 0 101.664 59.2 191.344 149.376 245.6l-1.6 115.968 117.68-70.736a404.8 404.8 0 0 0 84.544 9.168c193.296 0 350-134.304 350-300S705.296 146 512 146zM336 400a48 48 0 1 1-48 48 48 48 0 0 1 48-48z m176 0a48 48 0 1 1-48 48 48 48 0 0 1 48-48z m176 0a48 48 0 1 1-48 48 48 48 0 0 1 48-48z"
|
|
@@ -162,7 +167,7 @@
|
|
|
:append-to-body="true"
|
|
|
:visible.sync="chatVisible"
|
|
|
size="910px"
|
|
|
- :class="chatVisible ? '' : 'drawer-container'"
|
|
|
+ :class="loadChatDom ? '' : 'drawer-container'"
|
|
|
custom-class="innerDrawer"
|
|
|
:withHeader="false"
|
|
|
>
|
|
@@ -212,6 +217,7 @@ export default {
|
|
|
allIdList: [],
|
|
|
isShow: false,
|
|
|
activeImg: null,
|
|
|
+ loadChatDom: false,
|
|
|
chatVisible: true,
|
|
|
noReadNum: 0 // 消息未读数
|
|
|
};
|
|
@@ -237,6 +243,9 @@ export default {
|
|
|
async mounted() {
|
|
|
console.log(this.$store.state.user, "userInfo");
|
|
|
this.chatVisible = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loadChatDom = true;
|
|
|
+ }, 1000);
|
|
|
// console.log(this.$ref.chatModel);
|
|
|
this.$bus.$on("showguide", obj => {
|
|
|
this.guideList = [];
|
|
@@ -253,9 +262,12 @@ export default {
|
|
|
} catch (e) {}
|
|
|
|
|
|
this.init();
|
|
|
+
|
|
|
+ this.$bus.$on("getNoReadNum", this.getNoReadMessage);
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
this.$bus.$off("showguide", () => {});
|
|
|
+ this.$bus.$off("getNoReadNum", this.getNoReadMessage);
|
|
|
// core.off(CoreEvent.MESSAGES, this.handleMessages);
|
|
|
const Events = RongIMLib.Events;
|
|
|
RongIMLib.removeEventListener(Events.MESSAGES, this.handleMessages);
|
|
@@ -272,8 +284,11 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- const Events = RongIMLib.Events;
|
|
|
- RongIMLib.addEventListener(Events.MESSAGES, this.handleMessages);
|
|
|
+ // const Events = RongIMLib.Events;
|
|
|
+ // RongIMLib.addEventListener(Events.MESSAGES, this.getNoReadMessage);
|
|
|
+ // RongIMLib.addEventListener(Events.MESSAGE_RECEIPT_RESPONSE, message => {
|
|
|
+ // console.log("121212", message);
|
|
|
+ // });
|
|
|
},
|
|
|
handleMessages(newMessage) {
|
|
|
console.log(newMessage, "newMessage");
|
|
@@ -354,7 +369,7 @@ export default {
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.drawer-container {
|
|
|
- display: none;
|
|
|
+ display: none !important;
|
|
|
}
|
|
|
|
|
|
.previewImg {
|
|
@@ -413,6 +428,7 @@ export default {
|
|
|
position: fixed;
|
|
|
right: 36px;
|
|
|
bottom: 36px;
|
|
|
+ z-index: 99;
|
|
|
|
|
|
::v-deep .el-badge__content {
|
|
|
display: flex;
|
|
@@ -549,4 +565,4 @@ export default {
|
|
|
.el-image-viewer__close {
|
|
|
display: none !important;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|