From 073b1937f02baf6bc0e43c441a160dd6a292abae Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 19 Jun 2022 10:07:19 +0800 Subject: [PATCH] no msg --- .../js/pages/manage/components/ChatInput/index.vue | 6 ++++++ .../js/pages/manage/components/DialogWrapper.vue | 13 ++++++++++++- .../sass/pages/components/dialog-wrapper.scss | 6 +++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index f4f3cc0b0..12bf260ed 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -209,6 +209,7 @@ export default { observer: null, wrapperWidth: 0, + wrapperHeight: 0, editorHeight: 0, recordReady: false, @@ -233,6 +234,7 @@ export default { entries.some(({target, contentRect}) => { if (target === this.$el) { this.wrapperWidth = contentRect.width; + this.wrapperHeight = contentRect.height; } else if (target === this.$refs.editor) { this.editorHeight = contentRect.height; } @@ -443,6 +445,10 @@ export default { dialogInputCache() { this.$emit('input', this.getInputCache()) + }, + + wrapperHeight(newVal, oldVal) { + this.$emit('on-height-change', {newVal, oldVal}) } }, methods: { diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 35deb4f81..e7878c849 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -122,6 +122,7 @@ @on-record="sendRecord" @on-record-state="onRecordState" @on-emoji-visible-change="onEventEmojiVisibleChange" + @on-height-change="onHeightChange" @on-cancel-reply="onCancelReply" :placeholder="$L('输入消息...')"/> @@ -436,7 +437,7 @@ export default { if (this.msgNew > 0 && this.allMsgs.length > 0) { return 'newmsg' } - if (this.scrollTail > 50) { + if (this.scrollTail > 500) { return 'goto' } return null @@ -808,6 +809,16 @@ export default { } }, + onHeightChange({newVal, oldVal}) { + const diff = newVal - oldVal; + if (diff !== 0) { + const {offset, tail} = this.scrollInfo() + if (tail > 0) { + this.onToOffset(offset + diff) + } + } + }, + onActive() { this.$emit("on-active"); }, diff --git a/resources/assets/sass/pages/components/dialog-wrapper.scss b/resources/assets/sass/pages/components/dialog-wrapper.scss index e0a765cf5..452dbebff 100644 --- a/resources/assets/sass/pages/components/dialog-wrapper.scss +++ b/resources/assets/sass/pages/components/dialog-wrapper.scss @@ -823,10 +823,14 @@ display: flex; align-content: center; justify-content: center; + color: $primary-text-color; + background-color: #ffffff; + border: 1px solid #eeeeee; + box-shadow: 0 4px 8px 0 rgba($primary-text-color, 0.2); top: -48px; width: 40px; height: 40px; - line-height: 40px; + line-height: 38px; border-radius: 50%; .taskfont {