Merge pull request 'feat: 修改加载次数问题' (#271) from fix/updatesyspic into test

Reviewed-on: #271
pull/272/head
yaoshuli 1 year ago
commit 75eb7275ef

@ -6,7 +6,7 @@ import { useInfiniteScroll } from '@vueuse/core'
import dayjs from 'dayjs' import dayjs from 'dayjs'
// import imagesloaded from 'imagesloaded' // import imagesloaded from 'imagesloaded'
import { cloneDeep, debounce } from 'lodash-es' import { cloneDeep, debounce, isEqual } from 'lodash-es'
// import Masonry from 'masonry-layout' // import Masonry from 'masonry-layout'
import { NIcon, useMessage } from 'naive-ui' import { NIcon, useMessage } from 'naive-ui'
@ -140,6 +140,7 @@ const listStyle = computed(() => {
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
console.log('初始化加载了')
loadMore() loadMore()
}, },
{ distance: 10, canLoadMore: () => canloadMore }, { distance: 10, canLoadMore: () => canloadMore },
@ -201,6 +202,7 @@ configStore.$subscribe(() => {
watch( watch(
() => searchValue.value, () => searchValue.value,
async (newVal, oldVal) => { async (newVal, oldVal) => {
console.log('搜索框的值', newVal, oldVal)
if (newVal) { if (newVal) {
isInitSeaerch.value = true isInitSeaerch.value = true
pagination.pageNo = 0 pagination.pageNo = 0
@ -222,7 +224,8 @@ watch(
watch( watch(
() => configStore.getAsideValue, () => configStore.getAsideValue,
async (newVal, oldVal) => { async (newVal, oldVal) => {
if (newVal) { console.log('getAsideValue变化了', newVal, oldVal, isEqual(newVal, oldVal))
if (pagination.pageNo > 1 && newVal && !(Object.entries(newVal).toString() === Object.entries(oldVal).toString())) {
reset() reset()
loadMore() loadMore()
} }
@ -542,6 +545,7 @@ async function refreshHandler(filtersearchId?: any) {
if (filtersearchId) if (filtersearchId)
filterId = filtersearchId filterId = filtersearchId
console.log('refreshHandler执行了')
loadMore(true) loadMore(true)
// nextTick(() => { // nextTick(() => {
// setTimeout(() => { // setTimeout(() => {
@ -643,7 +647,7 @@ function refresh(val?: any) {
if (timer.value) if (timer.value)
clearInterval(timer.value) clearInterval(timer.value)
console.log('refresh刷新了')
reset() reset()
loadMore() loadMore()
configStore.setTimeNum(0) configStore.setTimeNum(0)

Loading…
Cancel
Save