perf: 优化消息首页加载效果

This commit is contained in:
kuaifan 2023-12-21 14:09:49 +08:00
parent 66135d8222
commit ce83bef0ed

View File

@ -164,6 +164,7 @@
@scroll="onScroll"
@range="onRange"
@totop="onPrevPage"
@resized="onItemRendered"
@on-mention="onMention"
@on-longpress="onLongpress"
@ -700,6 +701,7 @@ export default {
unreadMsgId: 0, // id
positionLoad: 0, //
isFirstPageReady: false, //
msgPreparedStatus: false, //
listPreparedStatus: false, //
selectedTextStatus: false, //
@ -1056,6 +1058,7 @@ export default {
this.msgType = ''
this.searchShow = false
this.unreadMsgId = 0
this.isFirstPageReady = false
this.listPreparedStatus = false
this.scrollToBottomAndRefresh = false
//
@ -1975,6 +1978,9 @@ export default {
},
onFooterResize() {
if (!this.$refs.footer) {
return
}
const footer = this.$refs.footer;
const marginSize = parseInt($A.css(footer, 'marginTop')) + parseInt($A.css(footer, 'marginBottom'))
if (this.$refs.scroller) {
@ -2097,6 +2103,17 @@ export default {
}).catch(() => {})
},
onItemRendered() {
if (!this.$refs.scroller || !this.$refs.footer) {
return
}
if (!this.isFirstPageReady) {
this.isFirstPageReady = true
this.onFooterResize()
this.onToBottom()
}
},
onDialogMenu(cmd) {
switch (cmd) {
case "searchMsg":