mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 03:52:50 +00:00
fix: 发送消息失败再次编辑格式丢失的问题
This commit is contained in:
parent
19fd36b195
commit
a6ce767532
@ -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());
|
||||
}
|
||||
|
||||
@ -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 = '重新发送'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user