mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 03:52:50 +00:00
perf: 优化消息首页加载效果
This commit is contained in:
parent
66135d8222
commit
ce83bef0ed
@ -164,6 +164,7 @@
|
|||||||
@scroll="onScroll"
|
@scroll="onScroll"
|
||||||
@range="onRange"
|
@range="onRange"
|
||||||
@totop="onPrevPage"
|
@totop="onPrevPage"
|
||||||
|
@resized="onItemRendered"
|
||||||
|
|
||||||
@on-mention="onMention"
|
@on-mention="onMention"
|
||||||
@on-longpress="onLongpress"
|
@on-longpress="onLongpress"
|
||||||
@ -700,6 +701,7 @@ export default {
|
|||||||
|
|
||||||
unreadMsgId: 0, // 最早未读消息id
|
unreadMsgId: 0, // 最早未读消息id
|
||||||
positionLoad: 0, // 定位跳转加载中
|
positionLoad: 0, // 定位跳转加载中
|
||||||
|
isFirstPageReady: false, // 首页消息是否准备完成
|
||||||
msgPreparedStatus: false, // 消息准备完成
|
msgPreparedStatus: false, // 消息准备完成
|
||||||
listPreparedStatus: false, // 消息准备完成
|
listPreparedStatus: false, // 消息准备完成
|
||||||
selectedTextStatus: false, // 是否选择文本
|
selectedTextStatus: false, // 是否选择文本
|
||||||
@ -1056,6 +1058,7 @@ export default {
|
|||||||
this.msgType = ''
|
this.msgType = ''
|
||||||
this.searchShow = false
|
this.searchShow = false
|
||||||
this.unreadMsgId = 0
|
this.unreadMsgId = 0
|
||||||
|
this.isFirstPageReady = false
|
||||||
this.listPreparedStatus = false
|
this.listPreparedStatus = false
|
||||||
this.scrollToBottomAndRefresh = false
|
this.scrollToBottomAndRefresh = false
|
||||||
//
|
//
|
||||||
@ -1975,6 +1978,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onFooterResize() {
|
onFooterResize() {
|
||||||
|
if (!this.$refs.footer) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const footer = this.$refs.footer;
|
const footer = this.$refs.footer;
|
||||||
const marginSize = parseInt($A.css(footer, 'marginTop')) + parseInt($A.css(footer, 'marginBottom'))
|
const marginSize = parseInt($A.css(footer, 'marginTop')) + parseInt($A.css(footer, 'marginBottom'))
|
||||||
if (this.$refs.scroller) {
|
if (this.$refs.scroller) {
|
||||||
@ -2097,6 +2103,17 @@ export default {
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onItemRendered() {
|
||||||
|
if (!this.$refs.scroller || !this.$refs.footer) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!this.isFirstPageReady) {
|
||||||
|
this.isFirstPageReady = true
|
||||||
|
this.onFooterResize()
|
||||||
|
this.onToBottom()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onDialogMenu(cmd) {
|
onDialogMenu(cmd) {
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case "searchMsg":
|
case "searchMsg":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user