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

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

@@ -37,6 +37,7 @@ import circleBtn from '@/components/public/circle-btn.vue'
import api from "../../utils/api";
import tool from '../../toolJs/downLoadMore'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
//路由
const router = useRouter()
@@ -82,9 +83,12 @@ let getDataList = (data) => {
api.getLists(postData).then(res => {
if (res.code === 200) {
dataList.data = res.data.data
if (res.data.data.length === 0) {
// if (res.data.data.length === 0) {
// loading.value = false
// return
// }
if(res.data.count<20){
loading.value = false
return
}
if (pages.value === 1) {
setInitial()
@@ -92,12 +96,16 @@ let getDataList = (data) => {
pageList.tab = 1
dataList.count = res.data.count
dataCount.value = res.data.count
nextTick(() => {
pageList['1'].push(dataList.data[0])
pageList['2'].push(dataList.data[1])
})
} else {
// ElMessage(res.message)
ElMessage({
message: res.message,
center: true,
})
}
})
}
@@ -105,10 +113,12 @@ let getDataList = (data) => {
//添加数据
let addListData = () => {
let num = null
if (pageList.tab >= 18){
loading.value = true
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
@@ -137,7 +147,9 @@ let downLoadMore = () => {
//listImg
onMounted(() => {
let {type,data}=router.currentRoute.value.query
let typeData=JSON.parse(data)
let typeData=null
if(data)typeData=JSON.parse(data)
if(Object.keys(data).length>0){
if(type!=='location'){
seachSelectData.data={[type]:typeData.id}