添加鼠标移动到可点模块 鼠标样式改变 全局新增加载动画

This commit is contained in:
2023-07-20 16:26:46 +08:00
parent 416b5232ae
commit 60f0f45def
15 changed files with 281 additions and 111 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div>
<pageTopBar></pageTopBar>
<inputModule :getDataList="setSeachSelectData" :count="dataCount"></inputModule>
<inputModule :getDataList="setSeachSelectData" :count="dataCount" ref="inputModuleInfo"></inputModule>
<div class="dis-f jus-x al-item">
<div class="body-maxWidth mg-t-35">
<div class="dis-f jus-bet"
@@ -38,6 +38,12 @@ import tool from '../toolJs/downLoadMore'
import inputModule from '../components/seachPage/input.vue'
import apartmentItem from '@/components/public/apartment-item.vue';
import Masonry from 'masonry-layout';
import { useRouter } from 'vue-router';
import { ElMessage } from 'element-plus'
//路由
const route = useRouter()
let routeQuery = reactive({ data: {} })
//获取数据
let pages = ref(1)//页数
@@ -80,6 +86,7 @@ let getDataList = (data) => {
let postData = {
page: pages.value,
intermediary: 0,
limit:20,
...data
}
loading.value = false
@@ -94,7 +101,7 @@ let getDataList = (data) => {
console.log(res.data)
loading.value = true
dataList.data = res.data.data
if (res.data.data.length < 20) {
if (res.data.count < 20) {
loading.value = false
}
if (seachSelectData.data.tabType !== 'apartment') {
@@ -119,7 +126,10 @@ let getDataList = (data) => {
} else {
// ElMessage(res.message)
ElMessage({
message: res.message,
center: true,
})
}
})
}
@@ -127,10 +137,13 @@ let getDataList = (data) => {
//添加数据
let addListData = () => {
let num = null
if (pageList.tab >= 18){
loading.value = true
console.log(pageList.tab , dataList.count)
if (pageList.tab >= (dataList.count>20?20-2:dataList.count-2)) {
if(dataList.count>20){
loading.value = true
}
return
}
}
pageList.tab++
if (pageList.height1 > pageList.height2) {
num = 2
@@ -149,12 +162,15 @@ let watchImgLoad = (id, listId, height) => {
//加载更多
let downLoadMore = () => {
tool.loadMore(() => {
if (!loading.value||dataList.data.length==0) return
console.log(loading.value)
if (!loading.value) return
pages.value++
getDataList(seachSelectData.data)
})
}
let inputModuleInfo=ref(null)
const gridContainer = ref(null);
//listImg
onMounted(() => {
@@ -162,7 +178,14 @@ onMounted(() => {
itemSelector: '.item',
gutter: 20
});
getDataList()
routeQuery.data = route.currentRoute.value.query
console.log(routeQuery)
if(routeQuery.data.keyword){
inputModuleInfo.value.searchInit(routeQuery.data.keyword)
route.currentRoute.value.query={}
}else{
getDataList()
}
window.addEventListener('scroll', downLoadMore, true);
})