feat: 修改加载问题

pull/314/head
raoyongjun 1 year ago
parent 598858e144
commit f1fd15a695

@ -227,6 +227,7 @@ watch(() => collapse.value, (newVal, oldVal) => {
const asideLoadMore = debounce(() => { const asideLoadMore = debounce(() => {
console.log('加载了这里首页的数据--------------------') console.log('加载了这里首页的数据--------------------')
reset()
loadMore() loadMore()
}, 400) }, 400)
@ -241,7 +242,7 @@ watch(
// listData.value = more // listData.value = more
// isInitSeaerch.value = false // isInitSeaerch.value = false
// // configStore.setSearchValue(""); // // configStore.setSearchValue("");
reset() // reset()
// loadMore() // loadMore()
asideLoadMore() asideLoadMore()
isInitSeaerch.value = false isInitSeaerch.value = false
@ -264,7 +265,7 @@ watch(
async (newVal, oldVal) => { async (newVal, oldVal) => {
// console.log('configStore.getAsideValue', newVal, oldVal, Object.entries(newVal).toString() === Object.entries(oldVal).toString(), pagination.pageNo) // console.log('configStore.getAsideValue', newVal, oldVal, Object.entries(newVal).toString() === Object.entries(oldVal).toString(), pagination.pageNo)
if (pagination.pageNo > 1 && newVal && !(Object.entries(newVal).toString() === Object.entries(oldVal).toString())) { if (pagination.pageNo > 1 && newVal && !(Object.entries(newVal).toString() === Object.entries(oldVal).toString())) {
reset() // reset()
asideLoadMore() asideLoadMore()
} }
}, },
@ -360,7 +361,7 @@ async function featchList(userSearchId?: string) {
} }
async function loadMore() { async function loadMore() {
console.log('loadMore加兹安pagination.pageNo----------------', pagination.pageNo) console.log('loadMore首页pagination.pageNo----------------', pagination.pageNo)
if (loading.value || el.value == null) if (loading.value || el.value == null)
return return
canloadMore = false canloadMore = false
@ -368,7 +369,7 @@ async function loadMore() {
more.forEach((item) => { more.forEach((item) => {
item.calHeight = 182 * item.high / item.wide item.calHeight = 182 * item.high / item.wide
}) })
console.log('loadMore加载后的pagination.pageNo----------------', pagination.pageNo) console.log('loadMore加载后首页的pagination.pageNo----------------', pagination.pageNo)
// listData.value.push(...more) // listData.value.push(...more)
if (pagination.pageNo <= 1) { if (pagination.pageNo <= 1) {
listData.value = [] listData.value = []
@ -595,7 +596,7 @@ function reset(val?) {
} }
async function refreshHandler(filtersearchId?: any) { async function refreshHandler(filtersearchId?: any) {
reset(true) // reset(true)
if (filtersearchId) if (filtersearchId)
filterId = filtersearchId filterId = filtersearchId

Loading…
Cancel
Save