Browse Source

fix: ios部分设备出现白屏的bug

master
xsx 5 months ago
parent
commit
aa18f59f4c
  1. 32
      im-uniapp/pages/chat/chat-box.vue

32
im-uniapp/pages/chat/chat-box.vue

@ -642,13 +642,21 @@ export default {
});
},
onClickToBottom() {
this.scrollToBottom();
//
// 100s
/**
* 有些ios设备在点击回到底部后页面会卡住原因不详
* 解决方式: 延迟300ms再滚动
*/
setTimeout(() => {
this.isInBottom = true;
this.newMessageSize = 0;
}, 100)
this.scrollToBottom();
/**
* 有些设备滚到底部时会莫名触发滚动到顶部的事件
* 解决方式: 延迟100ms保证能准确设置底部标志
*/
setTimeout(() => {
this.isInBottom = true;
this.newMessageSize = 0;
}, 100)
}, 300)
},
onScroll(e) {
//
@ -656,16 +664,14 @@ export default {
},
onScrollToTop() {
if (this.showMinIdx > 0) {
// #ifndef H5
// appscroll-into-view
this.scrollToMsgIdx(this.showMinIdx);
// #endif
// #ifdef H5
// h5scroll-top
//
if (uni.getSystemInfoSync().platform == 'ios') {
// iosscroll-top
this.holdingScrollBar(this.scrollViewHeight);
} else {
// scroll-into-view
this.scrollToMsgIdx(this.showMinIdx);
}
// #endif
// 20
this.showMinIdx = this.showMinIdx > 20 ? this.showMinIdx - 20 : 0;
}

Loading…
Cancel
Save