From 6d2b6d93d03cef263320e8a7cb37ad0d05934f5d Mon Sep 17 00:00:00 2001 From: Shao Huan Qing Date: Thu, 3 Jun 2021 14:11:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=9C=AA=E8=AF=BB=E6=B6=88?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vuepress/theme/components/OnlineChat.vue | 30 ++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.vuepress/theme/components/OnlineChat.vue b/.vuepress/theme/components/OnlineChat.vue index 643673b..4a84715 100644 --- a/.vuepress/theme/components/OnlineChat.vue +++ b/.vuepress/theme/components/OnlineChat.vue @@ -5,7 +5,15 @@ 退出登录 打开单独的聊天窗口 -
+ +
+ + {{msg.content}} + +
+
+
@@ -26,12 +34,16 @@ export default { if (typeof window !== 'undefined') { return { showLogout: false, - isdebugging: true, //window.location.search === '?showLogin=true' + isdebugging: true, //window.location.search === '?showLogin=true', + showUnread: false, + unreadMsgs: [] } } else { return { showLogout: false, - isdebugging: false + isdebugging: false, + showUnread: false, + unreadMsgs: [] } } }, @@ -54,6 +66,12 @@ export default { _MEIQIA('entId', '961dff7f89ddc015ac1f8e193bf774d0'); _MEIQIA('manualInit'); _MEIQIA('withoutBtn'); + _MEIQIA('getUnreadMsg', msgs => { + this.unreadMsgs = msgs + this.showUnread = true + }); + _MEIQIA('fallback', 1); + _MEIQIA('init'); if (this.$route.path.indexOf('/install/v3/') === 0) { setTimeout(_ => { @@ -74,7 +92,7 @@ export default { }, methods: { showChat () { - if (Cookies.get(TOKEN_KEY)) { + if (Cookies.get(TOKEN_KEY) || this.$route.path.indexOf('/install/v3/') === 0) { this.loginSuccess() // _MEIQIA('showPanel'); } else { @@ -136,7 +154,6 @@ export default { } _MEIQIA('metadata', metadata); - _MEIQIA('init'); _MEIQIA('showPanel') }, openChatWindow () { @@ -175,10 +192,11 @@ export default { border-radius: 50%; box-shadow: rgb(0 0 0 / 16%) 0px 5px 14px; position: fixed; - bottom: 100px; + bottom: 15vh; right: 25px; text-align: center; cursor: pointer; + z-index: 1000; } .logout { position: fixed;