From a6ce767532a7230b5129dfe26b3051610f1f46ea Mon Sep 17 00:00:00 2001 From: kuaifan Date: Fri, 30 Jun 2023 22:25:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=86=8D=E6=AC=A1=E7=BC=96=E8=BE=91=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E4=B8=A2=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/components/ChatInput/index.vue | 1 - .../pages/manage/components/DialogWrapper.vue | 32 +++++++++++++++---- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index 2130d6754..61e5d76eb 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -713,7 +713,6 @@ export default { this.quill.on('text-change', _ => { this.textTimer && clearTimeout(this.textTimer) this.textTimer = setTimeout(_ => { - console.log(11); if (this.maxlength > 0 && this.quill.getLength() > this.maxlength) { this.quill.deleteText(this.maxlength, this.quill.getLength()); } diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 074723167..493dd89fb 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -840,14 +840,21 @@ export default { return null }, - footerStyle({keyboardType, keyboardHeight, safeAreaBottom, windowScrollY, isMessenger}) { - const style = {}; + footerPaddingBottom({keyboardType, keyboardHeight, safeAreaBottom, windowScrollY, isMessenger}) { if (windowScrollY === 0 && isMessenger && keyboardType === "show" && keyboardHeight > 0 && keyboardHeight < 120) { - style.paddingBottom = (keyboardHeight + safeAreaBottom) + 'px'; + return keyboardHeight + safeAreaBottom; + } + return 0; + }, + + footerStyle({footerPaddingBottom}) { + const style = {}; + if (footerPaddingBottom) { + style.paddingBottom = `${footerPaddingBottom}px`; } return style; }, @@ -1085,7 +1092,7 @@ export default { this.allMsgs = newList; } // - if (!this.windowActive || (tail > 10 && oldList.length > 0)) { + if (!this.windowActive || (tail > 45 && oldList.length > 0)) { const lastId = oldList[oldList.length - 1] ? oldList[oldList.length - 1].id : 0 const tmpList = newList.filter(item => item.id && item.id > lastId) this.msgNew += tmpList.length @@ -1102,7 +1109,7 @@ export default { this.navStyle = { marginTop: val + 'px' } - if (tail <= 10) { + if (tail <= 45) { requestAnimationFrame(this.onToBottom) } if (this.$refs.input.isFocus) { @@ -1130,6 +1137,15 @@ export default { if (index > -1) { setTimeout(_ => this.msgActiveIndex = -1, 800) } + }, + + footerPaddingBottom(val) { + if (val) { + const {tail} = this.scrollInfo(); + if (tail <= 45) { + requestAnimationFrame(this.onToBottom) + } + } } }, @@ -2080,7 +2096,7 @@ export default { const {offset, tail} = this.scrollInfo(); this.scrollOffset = offset; this.scrollTail = tail; - if (this.scrollTail <= 10) { + if (this.scrollTail <= 45) { this.msgNew = 0; } // @@ -2285,7 +2301,7 @@ export default { const {tail} = this.scrollInfo() this.setQuote(this.operateItem.id, type) this.inputFocus() - if (tail <= 10) { + if (tail <= 45) { requestAnimationFrame(this.onToBottom) } }, @@ -2546,8 +2562,10 @@ export default { config.okText = '再次编辑' config.onOk = () => { this.tempMsgs = this.tempMsgs.filter(({id}) => id != data.id) + this.$refs.input.setPasteMode(false) this.msgText = msg this.inputFocus() + this.$nextTick(_ => this.$refs.input.setPasteMode(true)) } } else if (type === 'record') { config.okText = '重新发送'