Merge pull request 'feat: 修改bug' (#175) from fix/suspiciousSort into test

Reviewed-on: #175
pull/178/head
raoyongjun 1 year ago
commit 93ffdeed71

@ -29,6 +29,7 @@ const similarRange = ref('desc')
const batch = ref(false)
const imageRef = ref<ComponentElRef | null>();
let filterId = null;
const isTop = ref(false)
let sortObj: any = {
orderByUptime: 'desc'
};
@ -110,7 +111,11 @@ const layout = debounce(() => {
const scrollHeight = el.value!.scrollHeight
const clientHeight = el.value!.clientHeight
const top = scrollHeight - clientHeight - 20
if(isTop.value) {
el.value!.scrollTo({ top: 0, behavior: 'instant' })
}else {
el.value!.scrollTo({ top, behavior: 'instant' })
}
// let height = 800 - 15;
// const screenWidth = window.screen.width;
// if(screenWidth <= 1920) {
@ -119,10 +124,22 @@ const layout = debounce(() => {
// el.value!.scrollTo({ top: height, behavior: 'instant' })
loading = false
console.log("loading---------------", loading);
console.log("pagination.pageNo---------------", pagination.pageNo);
if(pagination.pageNo == 3) {
let timer;
if(timer) {
clearTimeout(timer);
}
timer = setTimeout(() => {
isTop.value = false
console.log("isTop.value---------------", isTop.value);
}, 1000)
}
})
}, 300)
watch(viewMode, () => {
isTop.value = true;
layout()
})
@ -402,6 +419,7 @@ async function onChange() {
canloadMore = true;
const list = await featchList()
listData.value = list
isTop.value = true;
layout()
}
@ -419,6 +437,7 @@ async function onChangeView() {
canloadMore = true;
const list = await featchList()
listData.value = list
isTop.value = true;
layout()
}

Loading…
Cancel
Save