From c0132f27fd4ea917d412e15408c469d1faed96ae Mon Sep 17 00:00:00 2001 From: A1300399510 Date: Tue, 18 Jul 2023 19:01:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=AF=93=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../img/publicImage/black-circle-cross.svg | 11 + src/assets/img/publicImage/round-fork.svg | 11 + src/components/apartment/seachModule.vue | 289 ++++++++------ src/components/pageTopBar/pageTopBar.vue | 24 +- src/components/public/apartment-item.vue | 4 + src/components/public/empty-duck.vue | 2 + src/components/public/public-list-item.vue | 376 ++++++++++++++++++ src/views/housingView/apartment.vue | 52 ++- src/views/user.vue | 33 +- 9 files changed, 648 insertions(+), 154 deletions(-) create mode 100644 src/assets/img/publicImage/black-circle-cross.svg create mode 100644 src/assets/img/publicImage/round-fork.svg create mode 100644 src/components/public/public-list-item.vue diff --git a/src/assets/img/publicImage/black-circle-cross.svg b/src/assets/img/publicImage/black-circle-cross.svg new file mode 100644 index 0000000..844a191 --- /dev/null +++ b/src/assets/img/publicImage/black-circle-cross.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/img/publicImage/round-fork.svg b/src/assets/img/publicImage/round-fork.svg new file mode 100644 index 0000000..e61e518 --- /dev/null +++ b/src/assets/img/publicImage/round-fork.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/apartment/seachModule.vue b/src/components/apartment/seachModule.vue index 12d4eda..3e83f16 100644 --- a/src/components/apartment/seachModule.vue +++ b/src/components/apartment/seachModule.vue @@ -11,39 +11,46 @@
-
- -
- - 搜索 -
-
-
-
-
- 历史搜索 -
-
-
- {{ item }} + +
+ + +
+
+
+
+
历史搜索
+
+
{{ item }} +
+
-
-
-
-
- 热门推荐 -
-
-
- {{ item }} +
+
热门推荐
+
+
{{ item }} +
+
+ +
+ + 搜索
+ +
发布房源 @@ -80,8 +87,18 @@
租金
- ~ HK$/月 +
+ ~ HK$/月 +
+ +
+ + 清除金额 +
@@ -131,7 +148,7 @@ @@ -142,7 +159,7 @@ \ No newline at end of file diff --git a/src/components/pageTopBar/pageTopBar.vue b/src/components/pageTopBar/pageTopBar.vue index 4cb8ba9..d58067e 100644 --- a/src/components/pageTopBar/pageTopBar.vue +++ b/src/components/pageTopBar/pageTopBar.vue @@ -58,12 +58,12 @@ \ No newline at end of file diff --git a/src/views/housingView/apartment.vue b/src/views/housingView/apartment.vue index f520f9e..779020f 100644 --- a/src/views/housingView/apartment.vue +++ b/src/views/housingView/apartment.vue @@ -3,11 +3,14 @@
- +
- + +
+
+
@@ -23,6 +26,7 @@ import biserialItem from '../../components/biserialListItem/biserialListItem.vue import apartmentItem from '@/components/public/apartment-item.vue'; import haveQuestions from '@/components/public/have-questions.vue' import pageFooter from '@/components/footer/footer.vue' +import emptyDuck from '@/components/public/empty-duck.vue' import { ref, onMounted, onUnmounted, watch, getCurrentInstance, nextTick } from 'vue'; import { ElLoading } from 'element-plus' import Masonry from 'masonry-layout'; @@ -38,6 +42,7 @@ const gridContainer = ref(null); let list = ref([]) +let listCount = ref(0) // 列表数量 let masonryInstance = null @@ -75,6 +80,8 @@ const getData = () => { let data = res.data list.value = list.value.concat(data.data) page = data.page * data.limit >= data.count ? 0 : page + 1 + + listCount = data.count nextTick(() => { masonryInstance.reloadItems(); masonryInstance.layout(); @@ -93,25 +100,28 @@ const handleScroll = () => { const scrollHeight = document.documentElement.scrollHeight; const clientHeight = document.documentElement.clientHeight; const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; - - if (scrollTop + clientHeight >= scrollHeight) { - // 进行滚动到底部时的操作 - console.log('已滚动到底部'); - // 执行其他操作... - getData() - } + if (scrollTop + clientHeight >= scrollHeight) getData() }; let pitchValue = {} // 筛选组件的参数的中转 const handleTransfer = (data) => { - // console.log("data", data.value); - pitchValue = { ...data.value } - // console.log("data", pitchValue); - page = 1 - list.value = [] - getData() + for (const key in data.value) { + console.log(data.value[key] != pitchValue[key]); + if (data.value[key] != pitchValue[key]) { + pitchValue = { ...data.value } + + page = 1 + list.value = [] + getData() + } + // if () { + + // } + } + + } @@ -131,4 +141,16 @@ const handleTransfer = (data) => { width: 386px; } } + +.empty-box { + width: 1200px; + height: 500px; + background-color: rgba(255, 255, 255, 1); + border-radius: 16px; + -moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.0784313725490196); + -webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.0784313725490196); + box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.0784313725490196); + justify-content: center; + margin: 0 auto; +} diff --git a/src/views/user.vue b/src/views/user.vue index 9ab7f70..2bd04df 100644 --- a/src/views/user.vue +++ b/src/views/user.vue @@ -69,11 +69,17 @@
{{ count['publish'] }} 条房源(上架 {{ stat['listing'] }} | 草稿 {{ stat['draft'] }} | 下架 {{ stat['offshelf'] }})
-
-
- +
+
+
+
+
+ +
+
+ @@ -91,6 +97,7 @@ import systematicNotificationPop from '@/components/user/systematic-notification import haveQuestions from '@/components/public/have-questions.vue' import pageFooter from '@/components/footer/footer.vue' import biserialListItem from '@/components/biserialListItem/biserialListItem.vue' +import publicListItem from '@/components/public/public-list-item.vue' import { ref, reactive, onMounted, getCurrentInstance } from 'vue' const { proxy } = getCurrentInstance() import { ElLoading } from 'element-plus' @@ -105,7 +112,7 @@ let user = ref({}) let count = ref({}) // 发布和收藏的数量 let newmessagenum = ref(0) let validityidentity = ref('') -let tabState = ref('publish') // fav publish +let tabState = ref('fav') // fav publish const identityObj = { 1: "中介认证", @@ -117,13 +124,15 @@ async function init() { if (res.code != 200) return let data = res.data - if (data.count['publish'] > 0) { - tabState.value = 'publish' - getPublishData() - } else { - tabState.value = 'fav' - getFavData() - } + // if (data.count['publish'] > 0) { + // tabState.value = 'publish' + // getPublishData() + // } else { + // tabState.value = 'fav' + // getFavData() + // } + + getFavData() user.value = data.user count.value = data.count @@ -408,6 +417,4 @@ const cutTab = (value) => { margin-bottom: 20px; } } - -