|
|
@@ -30,6 +30,7 @@
|
|
|
}"
|
|
|
@click="toggleEmoji(false)"
|
|
|
ref="listRef"
|
|
|
+ id="vanList"
|
|
|
>
|
|
|
<van-pull-refresh v-model="isLoading" @refresh="onRefresh" :disabled="finishedPage">
|
|
|
<!-- <div class="tips" v-if="finishedPage">没有更多了</div> -->
|
|
|
@@ -259,7 +260,7 @@ const title = computed(() => {
|
|
|
});
|
|
|
|
|
|
function goBottom() {
|
|
|
- listRef.value.scrollTop = listRef.value.scrollHeight;
|
|
|
+ document.getElementById('vanList').scrollTop = document.getElementById('vanList').scrollHeight;
|
|
|
}
|
|
|
|
|
|
function submit(e) {
|
|
|
@@ -364,7 +365,11 @@ onMounted(() => {
|
|
|
console.log(msg);
|
|
|
if (msg.to === teamId.value) {
|
|
|
list.value = getPushMsg(msg, list.value);
|
|
|
- if (listRef.value.scrollTop + 100 > listRef.value.scrollHeight) {
|
|
|
+ if (
|
|
|
+ document.getElementById('vanList').scrollTop + document.getElementById('vanList').clientHeight >
|
|
|
+ document.getElementById('vanList').scrollHeight - 100 ||
|
|
|
+ msg.from === store.state.userInfo.id
|
|
|
+ ) {
|
|
|
nextTick(() => {
|
|
|
goBottom();
|
|
|
});
|