From 60f0f45def7194f2626c16b469bd1906f5bd7863 Mon Sep 17 00:00:00 2001 From: luJianJun <2587063613@qq.com> Date: Thu, 20 Jul 2023 16:26:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=BC=A0=E6=A0=87=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E5=88=B0=E5=8F=AF=E7=82=B9=E6=A8=A1=E5=9D=97=20=20?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E6=A0=B7=E5=BC=8F=E6=94=B9=E5=8F=98=20=20?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=96=B0=E5=A2=9E=E5=8A=A0=E8=BD=BD=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 2 +- .../biserialListItem/biserialListItem.vue | 48 ++++++++---- src/components/seachModule/seachModule.vue | 77 +++++++++++-------- src/components/seachPage/input.vue | 45 +++++++---- src/components/selectTabBox/selectTabBox.vue | 3 +- src/main.js | 2 +- src/store/index.js | 1 + src/utils/axios.js | 5 +- src/utils/loading.js | 32 ++++++++ src/views/HomeView.vue | 58 ++++++++++---- src/views/detail.vue | 18 ++++- src/views/housingView/intermediary.vue | 18 +++-- src/views/housingView/needHousing.vue | 18 +++-- src/views/housingView/person.vue | 26 +++++-- src/views/seachIndex.vue | 39 ++++++++-- 15 files changed, 281 insertions(+), 111 deletions(-) create mode 100644 src/utils/loading.js diff --git a/src/App.vue b/src/App.vue index a8046f3..81e94d8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ +} + diff --git a/src/views/detail.vue b/src/views/detail.vue index 8530f91..1bccd1d 100644 --- a/src/views/detail.vue +++ b/src/views/detail.vue @@ -4,7 +4,17 @@
-123 + +
+ +
@@ -59,7 +69,7 @@ img { justify-content: space-between; } -.title-top-box{ +.title-top-box { width: 1200px; height: 186px; background: inherit; @@ -74,6 +84,10 @@ img { box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.117647058823529); font-size: 14px; transform: translateY(-38px); + + .breadcrumb-box { + padding: 20px; + } } \ No newline at end of file diff --git a/src/views/housingView/intermediary.vue b/src/views/housingView/intermediary.vue index f5426bd..b4052a4 100644 --- a/src/views/housingView/intermediary.vue +++ b/src/views/housingView/intermediary.vue @@ -35,6 +35,7 @@ import noList from "../../components/public/empty-duck.vue"; import circleBtn from '@/components/public/circle-btn.vue' import api from "../../utils/api"; import tool from '../../toolJs/downLoadMore' +import { ElMessage } from 'element-plus' //获取数据 let pages = ref(1) @@ -70,15 +71,15 @@ let getDataList = (data) => { let postData = { page: pages.value, intermediary: 1, + limit:20, ...data } api.getLists(postData).then(res => { if (res.code === 200) { loading.value = true dataList.data = res.data.data - if (res.data.data.length === 0) { + if(res.data.count<20){ loading.value = false - return } if (pages.value === 1) { setInitial() @@ -91,7 +92,10 @@ let getDataList = (data) => { pageList['2'].push(dataList.data[1]) }) } else { - // ElMessage(res.message) + ElMessage({ + message: res.message, + center: true, + }) } }) } @@ -99,10 +103,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 diff --git a/src/views/housingView/needHousing.vue b/src/views/housingView/needHousing.vue index 6c1c873..b4f4af1 100644 --- a/src/views/housingView/needHousing.vue +++ b/src/views/housingView/needHousing.vue @@ -36,6 +36,7 @@ import noList from "../../components/public/empty-duck.vue"; import circleBtn from '@/components/public/circle-btn.vue' import api from "../../utils/api"; import tool from '../../toolJs/downLoadMore' +import { ElMessage } from 'element-plus' //获取数据 let pages = ref(1) @@ -77,15 +78,15 @@ let getDataList = (data) => { let postData = { page: pages.value, intermediary: 0, + limit:20, ...data } api.getLists(postData).then(res => { if (res.code === 200) { loading.value = true dataList.data = res.data.data - if (res.data.data.length === 0) { + if(res.data.count<20){ loading.value = false - return } if (pages.value === 1) { setInitial() @@ -98,7 +99,10 @@ let getDataList = (data) => { pageList['2'].push(dataList.data[1]) }) } else { - // ElMessage(res.message) + ElMessage({ + message: res.message, + center: true, + }) } }) } @@ -106,10 +110,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 diff --git a/src/views/housingView/person.vue b/src/views/housingView/person.vue index 769042c..1ed4a4f 100644 --- a/src/views/housingView/person.vue +++ b/src/views/housingView/person.vue @@ -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} diff --git a/src/views/seachIndex.vue b/src/views/seachIndex.vue index 7215d41..00a8293 100644 --- a/src/views/seachIndex.vue +++ b/src/views/seachIndex.vue @@ -1,7 +1,7 @@