4.6
This commit is contained in:
@@ -237,7 +237,7 @@
|
||||
<img class="icon" src="@/assets/img/apartmentDetail/consult-icon.png" />
|
||||
咨询
|
||||
</div>
|
||||
<div v-else class="full-rent">已租满</div>
|
||||
<div v-else class="full-rent flexcenter">已租满</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="type-item flexacenter" v-for="(item, index) in roomList" :key="index">
|
||||
@@ -613,6 +613,44 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="isInspectPop" width="600" class="inspectPop" :show-close="false">
|
||||
<!-- <div class="title-box dis-f al-item jus-x">
|
||||
点评
|
||||
<img src="@/assets/img/detail/close.png" class="close-icon" @click="isSelectSchool = false" />
|
||||
</div> -->
|
||||
<div class="type flexacenter">
|
||||
<div class="item pitch">全部 4</div>
|
||||
<div class="item">寄托实地考察 2</div>
|
||||
<div class="item">寄托回访 2</div>
|
||||
</div>
|
||||
|
||||
<div class="list">
|
||||
<div class="item flexflex" v-for="(item, index) in 10" :key="index">
|
||||
<img class="avatar" src="https://oss.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-d_Zwocn3qqsgFptxhcq_cQnrld6YjDgwVBq_D-81qNDQyOQ~~" />
|
||||
<div class="remark-content flexflex flex1">
|
||||
<div class="type flexacenter">
|
||||
<img class="image" src="@/assets/img/publicImage/return-visit.png" />
|
||||
<img class="image" src="@/assets/img/publicImage/inspect-icon.png" />
|
||||
寄托实地考察
|
||||
</div>
|
||||
<div class="username flexacenter">
|
||||
寄托方同学
|
||||
<div class="checked-in">已入住</div>
|
||||
<img class="image" src="" />
|
||||
</div>
|
||||
<div class="date">2025.3.15</div>
|
||||
<div class="text">交通和生活都非常便利,房间整洁完善,拎包入住没问题!周围五百米内,超市、购物广场及娱乐设施应有尽有。步行至地铁口仅需3分钟! 所有房间都有大窗,基本都朝南,每个房间阳光都很充足,窗外是公园。所有房间可以看到绿树,公园,很开阔,不压抑。真是非常难得的窗景! 客服小COCO24小时在线,每日提供清洁服务,妥妥的生活无忧!</div>
|
||||
<div class="media" scroll-x>
|
||||
<div class="media-item" v-for="(item, index) in 10" :key="index">
|
||||
<img class="media-img" src="https://oss.x-php.com/Zvt57TuJSUvkyhw-xG7Y2l-X9pkucH3qqsgFptxhcq_cQnrleqEnW1EdBq_D-81qNDQyOQ~~" />
|
||||
<img class="media-icon" src="@/assets/img/publicImage/video-icon.svg" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -1283,7 +1321,8 @@ let showDistance = ref(false);
|
||||
|
||||
// 点击收藏
|
||||
const handleCollect = () => {
|
||||
api.apartmentCollection({ token }).then((res) => {
|
||||
// api.apartmentCollection({ token }).then((res) => {
|
||||
proxy.$post("https://api.gter.net/v1/apartment/collection", { token }).then((res) => {
|
||||
if (res.code != 200) return;
|
||||
const data = res.data;
|
||||
info.value.iscollect = data.status || 0;
|
||||
@@ -1389,6 +1428,8 @@ const roomCollect = (id, index) => {
|
||||
roomList.value[index].iscollection = data.status || 0;
|
||||
});
|
||||
};
|
||||
|
||||
let isInspectPop = ref(false);
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@@ -1916,4 +1957,181 @@ const roomCollect = (id, index) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.inspectPop {
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
.title-box {
|
||||
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
|
||||
font-weight: 650;
|
||||
font-style: normal;
|
||||
font-size: 25px;
|
||||
line-height: 26px;
|
||||
color: #000000;
|
||||
text-align: center;
|
||||
padding-top: 25px;
|
||||
padding-bottom: 16px;
|
||||
.close-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.type {
|
||||
padding: 20px 20px;
|
||||
border-bottom: 1px dotted #d7d7d7;
|
||||
.item {
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
border-radius: 12px;
|
||||
height: 30px;
|
||||
background-color: rgba(235, 235, 235, 1);
|
||||
padding: 0 12px;
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
|
||||
&.pitch {
|
||||
background-color: rgba(249, 93, 93, 1);
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
max-height: 600px;
|
||||
overflow: auto;
|
||||
|
||||
.item {
|
||||
padding-top: 20px;
|
||||
padding-left: 20px;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
border-bottom: 1px dashed #d7d7d7;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.remark-content {
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
.type {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
height: 23px;
|
||||
background: inherit;
|
||||
background-color: #f2f2f2;
|
||||
border-radius: 78px 0 0 78px;
|
||||
padding: 0 6px;
|
||||
border: none;
|
||||
|
||||
.image {
|
||||
// width: 24px;
|
||||
height: 16px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
.username {
|
||||
// font-size: 24px;
|
||||
font-size: 14px;
|
||||
// color: #333333;
|
||||
// margin-bottom: 4.5px;
|
||||
|
||||
color: #555;
|
||||
margin-right: 10px;
|
||||
// cursor: pointer;
|
||||
margin-bottom: 4px;
|
||||
.image {
|
||||
height: 20px;
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.checked-in {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
background-color: rgba(246, 246, 246, 0);
|
||||
border: 1px solid rgba(80, 227, 194, 1);
|
||||
border-radius: 45px;
|
||||
font-size: 12px;
|
||||
color: #50e3c2;
|
||||
padding: 0 8px;
|
||||
margin-left: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.date {
|
||||
color: #a3a3a3;
|
||||
font-size: 13px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
line-height: 24px;
|
||||
white-space: pre-line;
|
||||
margin-bottom: 12px;
|
||||
margin-right: 13px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.media {
|
||||
white-space: nowrap;
|
||||
overflow: auto;
|
||||
width: 512px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.media-item {
|
||||
display: inline-flex;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
.media-img {
|
||||
// width: 213px;
|
||||
width: 105px;
|
||||
height: 70px;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.media-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
|
||||
<!-- 所在区域 -->
|
||||
<div class="form-option modeOne flexacenter" v-if="intermediary != 6 && item.field == 'location'">
|
||||
<el-popover v-model:visible="areaPopState" placement="bottom" :width="640" :show-arrow="false" trigger="click" popper-style="padding:0; border-radius:16px;" :disabled="verified == 1">
|
||||
<el-popover v-model:visible="areaPopState" placement="bottom" :width="640" :show-arrow="false" trigger="click" popper-style="padding:0; border-radius:16px !important;" :disabled="verified == 1">
|
||||
<template #reference>
|
||||
<div ref="location" class="modeOne-item flexacenter" :class="{ 'disabled': verified == 1 }" style="width: 640px;">
|
||||
<div class="modeOne-text flexacenter" v-if="info['location']">
|
||||
|
||||
@@ -17,9 +17,13 @@
|
||||
</div>
|
||||
|
||||
<!-- 其他附近房源 -->
|
||||
<div v-if="moreList.length != 0" class="other-nearby-listings-box flexcenter">没有找到更多房源,为您推荐其他附近房源</div>
|
||||
<div class="wid1200" ref="moreShowList">
|
||||
<apartment-item v-for="(item, index) in moreList" :key="index" :item="item" :pitchValue="pitchValue"></apartment-item>
|
||||
<!-- <div v-if="moreList.length != 0" class="other-nearby-listings-box flexcenter">没有找到更多房源,为您推荐其他附近房源</div> -->
|
||||
<div v-if="moreList.length != 0" class="more-title wid1200 flexacenter">
|
||||
<img class="more-icon" src="@/assets/img/publicImage/more-recommend.png" />
|
||||
更多推荐
|
||||
</div>
|
||||
<div class="list wid1200" ref="moreShowList">
|
||||
<apartment-item v-for="(item, index) in moreList" :key="index" :item="item" :pitchValue="pitchValue" :masonryInstance="masonryInstanceMore" @handlecollect="handleMoreCollect"></apartment-item>
|
||||
</div>
|
||||
|
||||
<div class="bottom-tps" v-if="list.length != 0 && page == 0">- 到底了 -</div>
|
||||
@@ -66,19 +70,19 @@ let list = ref([]);
|
||||
let listCount = ref(0); // 列表数量
|
||||
|
||||
let masonryInstance = null;
|
||||
// let masonryInstanceMore = null
|
||||
let masonryInstanceMore = null;
|
||||
|
||||
onMounted(() => {
|
||||
// 初始化瀑布流
|
||||
masonryInstance = new Masonry(gridContainer.value, {
|
||||
itemSelector: ".item",
|
||||
gutter: 22,
|
||||
gutter: 22.5,
|
||||
});
|
||||
|
||||
// masonryInstanceMore = new Masonry(moreShowList.value, {
|
||||
// itemSelector: ".item",
|
||||
// gutter: 20,
|
||||
// })
|
||||
masonryInstanceMore = new Masonry(moreShowList.value, {
|
||||
itemSelector: ".item",
|
||||
gutter: 22.5,
|
||||
});
|
||||
|
||||
// pitchValue.value = store.getters.getApartmentPitchValue
|
||||
|
||||
@@ -114,11 +118,7 @@ const getData = () => {
|
||||
localStorage.setItem("apartmentPitchValue", JSON.stringify(pitchValue.value));
|
||||
|
||||
proxy
|
||||
.$post("https://api.gter.net/v1/apartment/lists", {
|
||||
limit: 10,
|
||||
page,
|
||||
...pitchValue.value,
|
||||
})
|
||||
.$post("https://api.gter.net/v1/apartment/lists", { limit: 12, page, ...pitchValue.value })
|
||||
.then((res) => {
|
||||
if (res.code != 200) return;
|
||||
let data = res.data;
|
||||
@@ -133,6 +133,13 @@ const getData = () => {
|
||||
requestLoading = false;
|
||||
});
|
||||
|
||||
// console.log("pitchValue.value", pitchValue.value);
|
||||
|
||||
if (page == 0 && (pitchValue.value.companyid || pitchValue.value.rent_max || pitchValue.value.rent_min || pitchValue.value.roomlistings || pitchValue.value.roomtype || pitchValue.value.school || pitchValue.value.tag)) {
|
||||
morePage = 1;
|
||||
getMoreList();
|
||||
}
|
||||
|
||||
// 小于20 代表筛选 数据不够了,需要加载更多的 随便在这里初始化 更多的 瀑布流 HTML
|
||||
// if (data.data.length < 20 && (pitchValue.value["school"] || pitchValue.value["location"].length != 0)) {
|
||||
// morePage.value = 1
|
||||
@@ -149,7 +156,8 @@ const handleScroll = () => {
|
||||
const scrollHeight = document.documentElement.scrollHeight;
|
||||
const clientHeight = document.documentElement.clientHeight;
|
||||
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
||||
if (scrollTop + clientHeight >= scrollHeight - 350) getData();
|
||||
if (scrollTop + clientHeight >= scrollHeight - 350 && page != 0) getData();
|
||||
if (scrollTop + clientHeight >= scrollHeight - 350 && page == 0) getMoreList();
|
||||
};
|
||||
|
||||
let pitchValue = ref({
|
||||
@@ -172,6 +180,9 @@ const handleTransfer = (data) => {
|
||||
store.state.apartmentPitchValue = pitchValue.value;
|
||||
page = 1;
|
||||
list.value = [];
|
||||
|
||||
moreList.value = [];
|
||||
|
||||
getData();
|
||||
break;
|
||||
}
|
||||
@@ -180,31 +191,42 @@ const handleTransfer = (data) => {
|
||||
|
||||
let moreShowList = ref(null);
|
||||
let moreState = ref(false); // 更多列表 显示状态
|
||||
let morePage = ref(1);
|
||||
let morePage = 1;
|
||||
let moreList = ref([]);
|
||||
let moreLoading = ref(false);
|
||||
|
||||
// 加载更多数据列表
|
||||
const getMoreList = () => {
|
||||
if (morePage.value == 0 || moreLoading.value) return;
|
||||
if (morePage == 0 || moreLoading.value) return;
|
||||
moreLoading.value = true;
|
||||
let postData = {
|
||||
page: morePage.value,
|
||||
...pitchValue.value,
|
||||
};
|
||||
|
||||
api.getMoreLists(postData).then((res) => {
|
||||
// let postData = {
|
||||
// page: morePage.value,
|
||||
// ...pitchValue.value,
|
||||
// };
|
||||
|
||||
let notids = [];
|
||||
list.value.forEach((element) => notids.push(element.id));
|
||||
|
||||
proxy.$post("https://api.gter.net/v1/apartment/lists", { notids, page: morePage, limit: 12 }).then((res) => {
|
||||
if (res.code != 200) return;
|
||||
const data = res.data;
|
||||
if (!data.data) return;
|
||||
// moreList.value = data.data || [];
|
||||
|
||||
// nextTick(() => {
|
||||
// masonryInstanceMore.reloadItems();
|
||||
// masonryInstanceMore.layout();
|
||||
// moreLoading.value = false;
|
||||
// });
|
||||
|
||||
moreList.value = moreList.value.concat(data.data);
|
||||
moreState.value = true;
|
||||
if (data.data && data.data.length < data.limit) morePage.value = 0;
|
||||
else {
|
||||
morePage.value++;
|
||||
window.addEventListener("scroll", getMoreScroll, true);
|
||||
}
|
||||
// if (data.data && data.data.length < data.limit) morePage = 0;
|
||||
// else morePage++;
|
||||
|
||||
morePage = data.page * data.limit >= data.count ? 0 : morePage + 1;
|
||||
|
||||
nextTick(() => {
|
||||
masonryInstanceMore.reloadItems();
|
||||
masonryInstanceMore.layout();
|
||||
@@ -233,13 +255,34 @@ const handlecollect = (uniqid) => {
|
||||
}
|
||||
});
|
||||
|
||||
api.apartmentCollection({ token }).then((res) => {
|
||||
// api.apartmentCollection({ token }).then((res) => {
|
||||
proxy.$post("https://api.gter.net/v1/apartment/collection", { token }).then((res) => {
|
||||
if (res.code != 200) return;
|
||||
const data = res.data;
|
||||
list.value[targetIndex]["iscollect"] = data.status;
|
||||
ElMessage.success(res.message);
|
||||
});
|
||||
};
|
||||
|
||||
// 处理列表的点击收藏
|
||||
const handleMoreCollect = (uniqid) => {
|
||||
let targetIndex = 0;
|
||||
let token = "";
|
||||
|
||||
moreList.value.forEach((element, index) => {
|
||||
if (element.uniqid == uniqid) {
|
||||
targetIndex = index;
|
||||
token = element.token || "";
|
||||
}
|
||||
});
|
||||
|
||||
proxy.$post("https://api.gter.net/v1/apartment/collection", { token }).then((res) => {
|
||||
if (res.code != 200) return;
|
||||
const data = res.data;
|
||||
moreList.value[targetIndex]["iscollect"] = data.status;
|
||||
ElMessage.success(res.message);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.screen-box {
|
||||
@@ -287,4 +330,15 @@ const handlecollect = (uniqid) => {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 43px;
|
||||
}
|
||||
|
||||
.more-title {
|
||||
color: #333333;
|
||||
font-size: 16px;
|
||||
margin: 20px auto 0;
|
||||
.more-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<biserialItem v-for="(item, i) in pageList" :key="i" :item="item"></biserialItem>
|
||||
</div>
|
||||
<div class="body-maxWidth" v-show="seachSelectData.data && seachSelectData.data.tabType === 'apartment' && dataList.data && dataList.data.length > 0" ref="gridContainer">
|
||||
<apartment-item v-for="(item, index) in listApartment" :key="index" :item="item" :masonryInstance="masonryInstance"></apartment-item>
|
||||
<apartment-item v-for="(item, index) in listApartment" :key="index" :item="item" :masonryInstance="masonryInstance"></apartment-item>
|
||||
</div>
|
||||
<div class="dis-f jus-x no-list-box al-item" v-show="dataList.data && dataList.data.length === 0">
|
||||
<noList hintText="暂无搜索结果" hintTextTwo="建议更换搜索关键词,或放宽筛选条件"></noList>
|
||||
@@ -23,167 +23,169 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {reactive, onMounted, ref, provide, onBeforeUnmount, nextTick} from "vue"
|
||||
import pageTopBar from "../components/pageTopBar/pageTopBar.vue"
|
||||
import biserialItem from "../components/biserialListItem/biserialListItem.vue"
|
||||
import listBtmPrompt from "../components/public/have-questions.vue"
|
||||
import noList from "../components/public/empty-duck.vue"
|
||||
import api from "../utils/api"
|
||||
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"
|
||||
import footerTool from "@/components/footer/footer.vue"
|
||||
import loadMoreText from "../components/loadMore/loadMoreText.vue"
|
||||
import backToTop from "@/components/public/backToTop.vue"
|
||||
import { reactive, onMounted, ref, provide, onBeforeUnmount, nextTick, getCurrentInstance } from "vue";
|
||||
import pageTopBar from "../components/pageTopBar/pageTopBar.vue";
|
||||
import biserialItem from "../components/biserialListItem/biserialListItem.vue";
|
||||
import listBtmPrompt from "../components/public/have-questions.vue";
|
||||
import noList from "../components/public/empty-duck.vue";
|
||||
import api from "../utils/api";
|
||||
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";
|
||||
import footerTool from "@/components/footer/footer.vue";
|
||||
import loadMoreText from "../components/loadMore/loadMoreText.vue";
|
||||
import backToTop from "@/components/public/backToTop.vue";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
//路由
|
||||
const route = useRouter()
|
||||
let routeQuery = reactive({data: {}})
|
||||
const route = useRouter();
|
||||
let routeQuery = reactive({ data: {} });
|
||||
|
||||
//获取数据
|
||||
let pages = ref(1) //页数
|
||||
let dataList = reactive({data: [], count: 0}) //个人/中介数据
|
||||
let dataCount = ref(0) //数据数量
|
||||
let pageList = ref([])
|
||||
let pages = ref(1); //页数
|
||||
let dataList = reactive({ data: [], count: 0 }); //个人/中介数据
|
||||
let dataCount = ref(0); //数据数量
|
||||
let pageList = ref([]);
|
||||
// let pageList = reactive({ 1: [], 2: [], height1: 0, height2: 0, tab: 1 })//双列瀑布数据
|
||||
let seachSelectData = reactive({data: {}}) //搜索数据
|
||||
let loading = ref(true) //开关
|
||||
let loadingText = ref(` 下拉加载更多 `)
|
||||
let listApartment = ref([]) //公寓数据
|
||||
let masonryInstance = null //瀑布实例
|
||||
let listMasonryInstance = null
|
||||
provide("count", dataCount)
|
||||
let seachSelectData = reactive({ data: {} }); //搜索数据
|
||||
let loading = ref(true); //开关
|
||||
let loadingText = ref(` 下拉加载更多 `);
|
||||
let listApartment = ref([]); //公寓数据
|
||||
let masonryInstance = null; //瀑布实例
|
||||
let listMasonryInstance = null;
|
||||
provide("count", dataCount);
|
||||
|
||||
//保存搜索设置
|
||||
let setSeachSelectData = (data, type) => {
|
||||
pages.value = 1
|
||||
pages.value = 1;
|
||||
seachSelectData.data = {
|
||||
...data,
|
||||
}
|
||||
loading.value = true
|
||||
getDataList(seachSelectData.data, type)
|
||||
}
|
||||
};
|
||||
loading.value = true;
|
||||
getDataList(seachSelectData.data, type);
|
||||
};
|
||||
|
||||
//初始化列表参数
|
||||
let setInitial = () => {
|
||||
pageList[1] = []
|
||||
pageList[2] = []
|
||||
pageList.height1 = 0
|
||||
pageList.height2 = 0
|
||||
}
|
||||
pageList[1] = [];
|
||||
pageList[2] = [];
|
||||
pageList.height1 = 0;
|
||||
pageList.height2 = 0;
|
||||
};
|
||||
|
||||
//获取搜索数据
|
||||
let getDataList = (data, type = true) => {
|
||||
console.log("data", data);
|
||||
if (!type) {
|
||||
//是否继续搜索
|
||||
seachSelectData.data.tabType !== "apartment" ? (pageList.value = []) : (listApartment.value = [])
|
||||
dataList.data = []
|
||||
dataCount.value = 0
|
||||
loading.value = false
|
||||
return
|
||||
seachSelectData.data.tabType !== "apartment" ? (pageList.value = []) : (listApartment.value = []);
|
||||
dataList.data = [];
|
||||
dataCount.value = 0;
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
loadingText.value = " 加载中..... "
|
||||
if (!loading.value) return
|
||||
loadingText.value = " 加载中..... ";
|
||||
if (!loading.value) return;
|
||||
let postData = {
|
||||
page: pages.value,
|
||||
limit: 20,
|
||||
...data,
|
||||
}
|
||||
loading.value = false
|
||||
let seachApi = null
|
||||
if (seachSelectData.data.tabType !== "apartment") {
|
||||
seachApi = api.getLists(postData)
|
||||
} else {
|
||||
seachApi = api.apartment(postData)
|
||||
}
|
||||
seachApi.then(res => {
|
||||
};
|
||||
loading.value = false;
|
||||
let seachApi = null;
|
||||
if (seachSelectData.data.tabType !== "apartment") seachApi = api.getLists(postData);
|
||||
else seachApi = proxy.$post("https://api.gter.net/v1/apartment/lists", postData);
|
||||
// else seachApi = api.apartment(postData)
|
||||
|
||||
seachApi.then((res) => {
|
||||
if (res.code === 200) {
|
||||
dataList.data = res.data.data
|
||||
dataList.data = res.data.data;
|
||||
if (res.data.data.length < 20) {
|
||||
loadingText.value = ` 到底了 `
|
||||
loading.value = false
|
||||
loadingText.value = ` 到底了 `;
|
||||
loading.value = false;
|
||||
} else {
|
||||
loadingText.value = " 下拉加载更多 "
|
||||
loading.value = true
|
||||
loadingText.value = " 下拉加载更多 ";
|
||||
loading.value = true;
|
||||
}
|
||||
if (seachSelectData.data.tabType !== "apartment") {
|
||||
if (pages.value === 1) {
|
||||
setInitial()
|
||||
pageList.value = []
|
||||
setInitial();
|
||||
pageList.value = [];
|
||||
}
|
||||
pageList.tab = 1
|
||||
dataList.count = res.data.count
|
||||
dataCount.value = res.data.count
|
||||
pageList.value = pageList.value.concat(dataList.data)
|
||||
pageList.tab = 1;
|
||||
dataList.count = res.data.count;
|
||||
dataCount.value = res.data.count;
|
||||
pageList.value = pageList.value.concat(dataList.data);
|
||||
nextTick(() => {
|
||||
listMasonryInstance.reloadItems()
|
||||
listMasonryInstance.layout()
|
||||
})
|
||||
listMasonryInstance.reloadItems();
|
||||
listMasonryInstance.layout();
|
||||
});
|
||||
} else {
|
||||
let data = res.data
|
||||
dataList.count = res.data.count
|
||||
dataCount.value = res.data.count
|
||||
if (pages.value === 1) listApartment.value = []
|
||||
listApartment.value = listApartment.value.concat(data.data)
|
||||
let data = res.data;
|
||||
dataList.count = res.data.count;
|
||||
dataCount.value = res.data.count;
|
||||
if (pages.value === 1) listApartment.value = [];
|
||||
listApartment.value = listApartment.value.concat(data.data);
|
||||
nextTick(() => {
|
||||
masonryInstance.reloadItems()
|
||||
masonryInstance.layout()
|
||||
masonryInstance.reloadItems();
|
||||
masonryInstance.layout();
|
||||
if (res.data.data.length >= 20) {
|
||||
loading.value = true
|
||||
loading.value = true;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
inputModuleInfo.value.setListCount(seachSelectData.data, dataList.count)
|
||||
inputModuleInfo.value.setListCount(seachSelectData.data, dataList.count);
|
||||
} else {
|
||||
ElMessage({
|
||||
message: res.message,
|
||||
center: true,
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
let isDownGetData = ref(true) // 是否可以下拉获取数据
|
||||
let isDownGetData = ref(true); // 是否可以下拉获取数据
|
||||
|
||||
provide("isDownGetData", isDownGetData)
|
||||
provide("isDownGetData", isDownGetData);
|
||||
//加载更多
|
||||
let downLoadMore = () => {
|
||||
tool.loadMore(() => {
|
||||
if (!loading.value || !isDownGetData.value) return
|
||||
pages.value++
|
||||
getDataList(seachSelectData.data)
|
||||
})
|
||||
}
|
||||
if (!loading.value || !isDownGetData.value) return;
|
||||
pages.value++;
|
||||
getDataList(seachSelectData.data);
|
||||
});
|
||||
};
|
||||
|
||||
let inputModuleInfo = ref(null)
|
||||
const gridContainer = ref(null)
|
||||
const list = ref(null)
|
||||
let inputModuleInfo = ref(null);
|
||||
const gridContainer = ref(null);
|
||||
const list = ref(null);
|
||||
//listImg
|
||||
onMounted(() => {
|
||||
listMasonryInstance = new Masonry(list.value, {
|
||||
itemSelector: ".item",
|
||||
gutter: 20,
|
||||
})
|
||||
});
|
||||
masonryInstance = new Masonry(gridContainer.value, {
|
||||
itemSelector: ".item",
|
||||
gutter: 15,
|
||||
})
|
||||
routeQuery.data = route.currentRoute.value.query
|
||||
});
|
||||
routeQuery.data = route.currentRoute.value.query;
|
||||
if (routeQuery.data.keyword && routeQuery.data.keyword.replace(/\s/g, "") && routeQuery.data.houseingPageType != 6) {
|
||||
inputModuleInfo.value.searchInit(routeQuery.data.keyword) //调用搜索组件的搜索功能
|
||||
inputModuleInfo.value.searchInit(routeQuery.data.keyword); //调用搜索组件的搜索功能
|
||||
// route.currentRoute.value.query.keyword = ''
|
||||
} else {
|
||||
inputModuleInfo.value.checkPageType()
|
||||
inputModuleInfo.value.checkPageType();
|
||||
}
|
||||
window.addEventListener("scroll", downLoadMore, true)
|
||||
})
|
||||
window.addEventListener("scroll", downLoadMore, true);
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener("scroll", downLoadMore, true)
|
||||
})
|
||||
window.removeEventListener("scroll", downLoadMore, true);
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
img {
|
||||
|
||||
@@ -213,7 +213,7 @@ import emptyDuck from "@/components/public/empty-duck.vue";
|
||||
import choosingIdentity from "@/components/edit/choosingIdentity.vue";
|
||||
import backToTop from "@/components/public/backToTop.vue";
|
||||
import authenticationInfo from "@/components/seachModule/authenticationInfo.vue";
|
||||
import { redirectToExternalWebsite } from '@/utils/util.js'
|
||||
import { redirectToExternalWebsite } from "@/utils/util.js";
|
||||
|
||||
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick, pushScopeId } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
@@ -279,7 +279,7 @@ const init = () => {
|
||||
else tabState.value = "fav";
|
||||
} else tabState.value = route.query["tab"];
|
||||
|
||||
if (data.user?.uin == 4171117) tabState.value = "fav";
|
||||
// if (data.user?.uin == 4171117) tabState.value = "fav";
|
||||
|
||||
if (tabState.value == "publish") getPublishData();
|
||||
else getFavData();
|
||||
@@ -511,12 +511,9 @@ const handleScroll = () => {
|
||||
};
|
||||
|
||||
// 跳转公寓详情页
|
||||
const goApartmentDetail = (item) => redirectToExternalWebsite(`/apartmentDetail?uniqid=${item.uniqid}`)
|
||||
const goApartmentDetail = (item) => redirectToExternalWebsite(`/apartmentDetail?uniqid=${item.uniqid}`);
|
||||
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener("scroll", handleScroll);
|
||||
});
|
||||
onUnmounted(() => window.removeEventListener("scroll", handleScroll));
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
Reference in New Issue
Block a user