mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-15 19:28:11 +00:00
perf: 优化发消息时有时候出现空白需要滚动才出现内容的情况
This commit is contained in:
parent
26d0d07850
commit
0835e5b069
@ -62,8 +62,8 @@
|
||||
</ul>
|
||||
</div>
|
||||
<!--等待-->
|
||||
<div v-else-if="msgData.type === 'loading'" class="content-text no-dark-content">
|
||||
......
|
||||
<div v-else-if="msgData.type === 'loading'" class="content-loading">
|
||||
<Loading/>
|
||||
</div>
|
||||
<!--未知-->
|
||||
<div v-else class="content-unknown">{{$L("未知的消息类型")}}</div>
|
||||
|
||||
@ -934,26 +934,28 @@ export default {
|
||||
text: typeLoad ? '' : msgText,
|
||||
},
|
||||
}
|
||||
this.tempMsgs.push(tempMsg)
|
||||
this.msgType = ''
|
||||
this.replyActiveId = 0;
|
||||
this.onActive();
|
||||
this.$nextTick(this.onToBottom)
|
||||
//
|
||||
this.$store.dispatch("call", {
|
||||
url: 'dialog/msg/sendtext',
|
||||
data: {
|
||||
dialog_id: tempMsg.dialog_id,
|
||||
reply_id: tempMsg.reply_id,
|
||||
text: msgText,
|
||||
},
|
||||
method: 'post',
|
||||
complete: _ => this.tempMsgs = this.tempMsgs.filter(({id}) => id != tempId)
|
||||
}).then(({data}) => {
|
||||
this.sendSuccess(data)
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg)
|
||||
});
|
||||
setTimeout(_ => {
|
||||
this.tempMsgs.push(tempMsg)
|
||||
this.msgType = ''
|
||||
this.replyActiveId = 0;
|
||||
this.onActive();
|
||||
this.$nextTick(this.onToBottom)
|
||||
//
|
||||
this.$store.dispatch("call", {
|
||||
url: 'dialog/msg/sendtext',
|
||||
data: {
|
||||
dialog_id: tempMsg.dialog_id,
|
||||
reply_id: tempMsg.reply_id,
|
||||
text: msgText,
|
||||
},
|
||||
method: 'post',
|
||||
complete: _ => this.tempMsgs = this.tempMsgs.filter(({id}) => id != tempId)
|
||||
}).then(({data}) => {
|
||||
this.sendSuccess(data)
|
||||
}).catch(({msg}) => {
|
||||
$A.modalError(msg)
|
||||
});
|
||||
}, 10)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -740,6 +740,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
.content-loading {
|
||||
display: flex;
|
||||
|
||||
.common-loading {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.content-unknown {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user