删除数据重新搜索

This commit is contained in:
luJianJun 2023-07-27 15:04:25 +08:00
parent ff15fe1a0e
commit 570849c02f
3 changed files with 107 additions and 90 deletions

View File

@ -182,7 +182,6 @@ let watchInfo = () => {
onMounted(() => {
imgRef = getCurrentInstance()
let {type}=router.currentRoute.value.query
console.log(data.data)
if(type){
pageType.value=type
}else{

View File

@ -75,7 +75,7 @@
v-show="selectTabCheck.id === item.id && selectTabCheck.id">&nbsp>&nbsp
<div :class="{ 'select-num': selectData.data && selectData.data.length }">
{{
selectData.data && selectData.data.length === 0 ? '不限' :
selectData.data && selectData.data.length === 0||selectData.data.length===selectTabCheck.data.length ? '不限' :
selectData.data && selectData.data.length
}}
</div>
@ -204,9 +204,11 @@
&nbsp</span>
<div class="dis-f al-item">
<div v-show="selectTabCheck.id && selectTabCheck.title">{{ selectTabCheck.title }}:</div>
<div v-for="(item, i) in selectData.data" :key="i" class="btm-btn">
{{ item.title }}
<img src="../../assets/homeImage/closeIcon.svg" @click="deleteSelect(i)" class="img" alt="">
<div class="dis-f" style="flex-wrap: wrap;">
<div v-for="(item, i) in selectData.data" :key="i" class="btm-btn">
{{ item.title }}
<img src="../../assets/homeImage/closeIcon.svg" @click="deleteSelect(i)" class="img" alt="">
</div>
</div>
</div>
</div>
@ -446,8 +448,14 @@ let selectSeach = (data = []) => {
}
//
let deleteSelect = (id) => {
selectData.data.splice(id, 1)
let deleteSelect = (i) => {
let data = []
selectData.data.splice(i, 1)
selectData.data.map(res => {
data.push(res.id)
})
checkBoxGroupInfo.value.setCheckData(data)
setSeachCondition('location', data)
}
//
@ -580,9 +588,9 @@ let routerQuerySet = () => {
//
if ((routeQuery.data && routeQuery.data.houseingPageType === '1') || (routePath.value === '/intermediaryHousing')) {
otherData.value = [{ title: '认证中介', id: 'isintermediary' }, { title: '有电梯', id: 'iselevator' }, { title: '有阳台', id: 'issunshinearea' }]
} else if((routeQuery.data && routeQuery.data.houseingPageType === '6') || (routePath.value === '/needHousing')){
} else if ((routeQuery.data && routeQuery.data.houseingPageType === '6') || (routePath.value === '/needHousing')) {
otherData.value = [{ title: '有电梯', id: 'iselevator' }, { title: '有阳台', id: 'issunshinearea' }]
}else{
} else {
otherData.value = [{ title: '认证房源', id: 'isverified' }, { title: '有电梯', id: 'iselevator' }, { title: '有阳台', id: 'issunshinearea' }]
}
if (Object.keys(routeQuery.data).length > 0) {
@ -598,17 +606,17 @@ let routerQuerySet = () => {
hireTypeObj.title = data.name
hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限'
} else if (routeQuery.data.type === 'location') {
let areaItem = routeQuery.data.areaItem?JSON.parse(routeQuery.data.areaItem):''
let areaItem = routeQuery.data.areaItem ? JSON.parse(routeQuery.data.areaItem) : ''
selectTabCheck.id = areaItem.id * 1;
selectTabCheck.title = areaItem.name
selectTabCheck.data = list[areaItem.id].data;
selectData.data = seachAreaId(data)
if (routeQuery.data.types) {
let types = JSON.parse(routeQuery.data.types)
let {data} = types
let { data } = types
let type = data.id.toString().substring(0, 1)
hireTypeObj.id = selectData.data.length==0?'':data.id
hireTypeObj.title =selectData.data.length==0?'':data.name
hireTypeObj.id = selectData.data.length == 0 ? '' : data.id
hireTypeObj.title = selectData.data.length == 0 ? '' : data.name
hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限'
}
setCheckBoxData(data)//

View File

@ -1,7 +1,8 @@
<template>
<div>
<pageTopBar></pageTopBar>
<div class="dis-f jus-x al-item" :class="{'mg-b-80':pageType==3&&(recommendListData.length==0||publisherList.length==0)}">
<div class="dis-f jus-x al-item"
:class="{ 'mg-b-80': pageType == 3 && (recommendListData.length == 0 || publisherList.length == 0) }">
<div class="body-maxWidth mg-t-35">
<breadcrumb :data="housingInfo['data']" :operation='setOperation'></breadcrumb>
<el-affix :offset="0" @change="changeTitleType" z-index="700">
@ -12,9 +13,10 @@
v-if="pageType == 1 &&
housingInfo['data'] &&
housingInfo['data'].info.verified" alt="">
<img src="../assets/homeImage/intermediaryTabImg.png" class="intermediary-logo" style="margin-right:10px;" v-if="pageType == 2 &&
housingInfo['data'] &&
housingInfo['data'].isintermediary == 1" alt="">
<img src="../assets/homeImage/intermediaryTabImg.png" class="intermediary-logo"
style="margin-right:10px;" v-if="pageType == 2 &&
housingInfo['data'] &&
housingInfo['data'].isintermediary == 1" alt="">
<div class="line" v-if="housingInfo['data'] && housingInfo['data'].info.verified"></div>
<span class="need-houing-type" v-if="pageType == 3">预算</span>
<span class="unit">HK$</span>
@ -46,12 +48,16 @@
</div>
<div class="dis-f al-item">
<div class="tool-btn dis-f al-item jus-x">
<div class="dis-f al-item" @click="setOperation">
<img src="../assets/img/detail/collect.png" v-show="housingInfo['data']&&!housingInfo['data'].isfav" class="tool-icon" alt="">
<img src="../assets/img/detail/collectT.png" v-show="housingInfo['data']&&housingInfo['data'].isfav" class="tool-icon"
<div class="dis-f al-item" @click="setOperation">
<img src="../assets/img/detail/collect.png"
v-show="housingInfo['data'] && !housingInfo['data'].isfav" class="tool-icon"
alt="">
<img src="../assets/img/detail/collectT.png"
v-show="housingInfo['data'] && housingInfo['data'].isfav" class="tool-icon"
alt="">
<span>
{{ housingInfo['data']&&housingInfo['data'].isfav ? housingInfo['data']&&housingInfo['data']['info'].count_fav : '收藏' }}
{{ housingInfo['data'] && housingInfo['data'].isfav ?
housingInfo['data'] && housingInfo['data']['info'].count_fav : '收藏' }}
</span>
</div>
<div class="line" style="margin:0 20px;"></div>
@ -146,11 +152,9 @@
housingInfo['data'].info.video.length">
{{ housingInfo['data'] && housingInfo['data'].info.video ?
housingInfo['data'] && housingInfo['data'].info.video.length : 0 }}</div>
<img src="../assets/img/detail/imageIcon.png"
v-if="housingInfo['data'] &&
<img src="../assets/img/detail/imageIcon.png" v-if="housingInfo['data'] &&
housingInfo['data'].info.picturegroup &&
housingInfo['data'].info.picturegroup.length"
class="img-icon" alt="">
housingInfo['data'].info.picturegroup.length" class="img-icon" alt="">
<div class="num-box" v-if="housingInfo['data'] &&
housingInfo['data'].info.picturegroup &&
housingInfo['data'].info.picturegroup.length">
@ -162,15 +166,17 @@
<div class="img-list-box dis-f jus-x al-item" @click="imageShow = true"
v-show="imgList.length > 0">
<img src="../assets/img/detail/moreNot.svg" class="icon left-icon" alt=""
@click.stop="moveImageList('left')" v-show="imgListTab === 0&&imageLIst[imageLIst.length-1]>800">
@click.stop="moveImageList('left')"
v-show="imgListTab === 0 && imageLIst[imageLIst.length - 1] > 800">
<img src="../assets/img/detail/moreAllow.svg" class="icon left-icon" alt=""
style="transform: rotate(180deg);" @click.stop="moveImageList('left')"
v-show="imgListTab > 0&&imageLIst[imageLIst.length-1]>800">
v-show="imgListTab > 0 && imageLIst[imageLIst.length - 1] > 800">
<img src="../assets/img/detail/moreAllow.svg" class="icon right-icon" alt=""
@click.stop="moveImageList('right')" v-show="imgList.length - 1 !== imgListTab&&imageLIst[imageLIst.length-1]>800">
@click.stop="moveImageList('right')"
v-show="imgList.length - 1 !== imgListTab && imageLIst[imageLIst.length - 1] > 800">
<img src="../assets/img/detail/moreNot.svg" class="icon right-icon" alt=""
style="transform: rotate(180deg);" @click.stop="moveImageList('right')"
v-show="imgList.length - 1 === imgListTab&&imageLIst[imageLIst.length-1]>800">
v-show="imgList.length - 1 === imgListTab && imageLIst[imageLIst.length - 1] > 800">
<div class="dis-f al-item list-box s-w-100" ref="imageList" v-if="imgList.length > 0">
<div v-for="(item, i) in imgList" :key="i">
<div class="video" v-if="item && !item.thumbnail">
@ -311,7 +317,7 @@
</div>
</div>
<!-- -->
<div class="info-box-s" v-if="pageType !=3">
<div class="info-box-s" v-if="pageType != 3">
<div class="info dis-f al-item">
<div class="title-box">
房屋类型
@ -332,8 +338,9 @@
<span class="text">
{{ housingInfo['data'] && housingInfo['data'].info.floor }}&nbsp
</span>
<span class="text" style="margin-left:0;" v-if="housingInfo['data'] &&housingInfo['data'].info.elevator">
<span class="text" style="margin-left:0;"
v-if="housingInfo['data'] && housingInfo['data'].info.elevator">
|
{{
indexData['data'] &&
@ -413,7 +420,7 @@
</div>
</div>
<!-- -->
<div class="map-box" v-if="pageType !=3&&housingInfo['data']&&housingInfo['data'].info.longitude">
<div class="map-box" v-if="pageType != 3 && housingInfo['data'] && housingInfo['data'].info.longitude">
<div class="dis-f al-item title-box">
<img src="../assets/img/detail/mapIcon.png" class="img" alt="">
<span class="title">{{
@ -440,33 +447,34 @@
<div class="top-box"></div>
<div class="title-box dis-f al-item jus-x">
<span class="title">房源距离院校</span>
<img src="../assets/img/detail/close.png" class="close-icon" @click="showDistance=false" alt="">
<img src="../assets/img/detail/close.png" class="close-icon"
@click="showDistance = false" alt="">
</div>
{{ distanceList }}
<div class="distance-info-data dis-f" v-if="distanceList.length > 0">
<div class="dis-f al-item school-info" v-for="(item, index) in distanceList"
:key="index" :class="{ 'mg-t-50': index > 0 }">
<div class="icon-box dis-f al-item jus-x"
:class="{ 'home-icon': item && item.address }">
<div class="line" v-show="index > 0"></div>
<img src="../assets/img/detail/school.png" class="icon"
v-show="item && item.address" alt="">
<img src="../assets/img/detail/home.png" class="icon"
v-show="item && !item.address" alt="">
</div>
{{ item && item.name }}
<div v-for="(items, i) in item && item.point" :key="i">
<span class="address-info">
{{ items.title }}
</span>
<span v-html="setDistanceList(items && `${items.distance}`)">
</span>
<!-- <span class="distance-text">
<div class="distance-box-s" v-if="distanceList.length > 0">
<div class="distance-info-data dis-f">
<div class="dis-f al-item school-info" v-for="(item, index) in distanceList"
:key="index" :class="{ 'mg-t-50': index > 0 }">
<div class="icon-box dis-f al-item jus-x"
:class="{ 'home-icon': item && item.address }">
<div class="line" v-show="index > 0"></div>
<img src="../assets/img/detail/school.png" class="icon"
v-show="item && item.address" alt="">
<img src="../assets/img/detail/home.png" class="icon"
v-show="item && !item.address" alt="">
</div>
{{ item && item.name }}
<div v-for="(items, i) in item && item.point" :key="i">
<span class="address-info">
{{ items.title }}
</span>
<span v-html="setDistanceList(items && `${items.distance}`)">
</span>
<!-- <span class="distance-text">
1.1公里
</span> -->
</div>
</div>
</div>
</div>
</div>
<div class="dis-f al-item" style="position:relative;" @click="setShowDistance">
@ -516,7 +524,7 @@
<div class="dis-f al-item houseing-info-box-s">
房源ID: <span class="houseing-id" @click="clone(housingInfo['data'] &&
housingInfo['data'].info.uid)">{{ housingInfo['data'] &&
housingInfo['data'].info.uid }}</span>
housingInfo['data'].info.uid }}</span>
<span class="browse-box">
浏览: <span class="text">{{ housingInfo['data'] && housingInfo['data'].info.count_view
}}</span>
@ -604,10 +612,9 @@
}} </span>
</div>
<div v-if="checkUpdateTime(housingInfo['data'] && housingInfo['data'].info.updatetime)">
<div class="dis-f al-item jus-x time-box" v-if="
housingInfo['data'] &&
<div class="dis-f al-item jus-x time-box" v-if="housingInfo['data'] &&
housingInfo['data'].intermediarylistingcount > 0 &&
housingInfo['data']&&['config']['intermediary'] == 1 &&
housingInfo['data'] && ['config']['intermediary'] == 1 &&
housingInfo['data'].isintermediary == 1">
<img src="../assets/img/detail/presonNumIcon.png" class="icon" alt="">
<span>房源 x{{ housingInfo['data'] && housingInfo['data'].intermediarylistingcount
@ -707,10 +714,10 @@
<!-- 中介名片弹窗 -->
<div class="dis-f jus-x al-item business-card-img-pop" v-show="showBusinessCard">
<img src="../assets/img/detail/imageClose.svg" @click="showBusinessCard = false" class="close-img" alt="">
<img :src="contacts['data'].businesscard&&contacts['data'].businesscard[0].image" class="img" alt="">
<img :src="contacts['data'].businesscard && contacts['data'].businesscard[0].image" class="img" alt="">
</div>
<!-- 推荐 -->
<div class="dis-f jus-x" v-if="pageType != 3&&(recommendListData.length > 0||publisherList.length > 0)">
<div class="dis-f jus-x" v-if="pageType != 3 && (recommendListData.length > 0 || publisherList.length > 0)">
<div class="body-maxWidth housing-title" style="margin-top:30px;">
附近房源
</div>
@ -730,7 +737,7 @@
</div>
</div>
</div>
<div class="dis-f jus-x bottom-tps" v-if="pageType != 3&&(recommendListData.length > 0||publisherList.length > 0)">
<div class="dis-f jus-x bottom-tps" v-if="pageType != 3 && (recommendListData.length > 0 || publisherList.length > 0)">
- {{ loadText }} -
</div>
<footerTool></footerTool>
@ -1003,7 +1010,7 @@ let interval = ''
let moveImageList = (type) => {
let clientWidth = imageList.value.clientWidth
let scrollWidth = imageList.value.scrollWidth
if(type === 'right'&&imageLIst.value[imgListTab.value] + clientWidth >= scrollWidth)return
if (type === 'right' && imageLIst.value[imgListTab.value] + clientWidth >= scrollWidth) return
if ((type === 'left' && imgListTab.value === 0) || (imgListTab.value === imageLIst.value.length - 1 && type === 'right')) return
type === 'left' ? imgListTab.value-- : imgListTab.value++
setOffsetWidth(imageLIst.value[imgListTab.value], type)
@ -1079,7 +1086,7 @@ let clone = (text) => {
document.body.removeChild(textareaEle);
ElMessage({
message: '复制成功',
type:'success',
type: 'success',
center: true,
})
}
@ -1099,7 +1106,7 @@ let setHousingArr = () => {
arr = housingInfo['data'].info.video ? arr.concat(housingInfo['data'] && housingInfo['data'].info.video) : []
arr = housingInfo['data'].info.picturegroup ? arr.concat(housingInfo['data'] && housingInfo['data'].info.picturegroup) : []
imgList.value = imgList.value.concat(arr)
console.log(imgList.value)
// console.log(imgList.value)
}
let location = store.state.indexData.config && store.state.indexData.config.location
@ -1107,29 +1114,29 @@ let location = store.state.indexData.config && store.state.indexData.config.loca
let setNavigation = () => {
let type = store.state.indexData.config && store.state.indexData.config.type
indexData['data'] = store.state.indexData
console.log('routeLis',store.state)
console.log('routeLis', store.state)
console.log(location)
if (!location) return
if (pageType.value == 1 || pageType.value == 2) {
// type=location&data=["2.2"]&areaItem={"id":2,"name":""}
// console.log(`${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}`)
store.state.routeList['thirdIndex'] = {
path: `${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}/${JSON.stringify({id:housingInfo['data']['info'].location.substring(0, 1),name:location[housingInfo['data']['info'].location.substring(0, 1)]})}/${JSON.stringify({type:'types',data:{name:type[housingInfo['data']['info'].type.substring(0, 1)],id:housingInfo['data']['info'].type}})}`,
path: `${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}/${JSON.stringify({ id: housingInfo['data']['info'].location.substring(0, 1), name: location[housingInfo['data']['info'].location.substring(0, 1)] })}/${JSON.stringify({ type: 'types', data: { name: type[housingInfo['data']['info'].type.substring(0, 1)], id: housingInfo['data']['info'].type } })}`,
title: `${location[housingInfo['data']['info'].location.substring(0, 1)]}${type[housingInfo['data']['info'].type.substring(0, 1)]}房源`
}
if (housingInfo['data']['info'].location.length > 0)
store.state.routeList['fourthIndex'] = {
path: `${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 3)])}/${JSON.stringify({id:housingInfo['data']['info'].location.substring(0, 1),name:location[housingInfo['data']['info'].location.substring(0, 1)]})}/${JSON.stringify({type:'types',data:{name:type[housingInfo['data']['info'].type.substring(0, 3)],id:housingInfo['data']['info'].type}})}`,
path: `${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 3)])}/${JSON.stringify({ id: housingInfo['data']['info'].location.substring(0, 1), name: location[housingInfo['data']['info'].location.substring(0, 1)] })}/${JSON.stringify({ type: 'types', data: { name: type[housingInfo['data']['info'].type.substring(0, 3)], id: housingInfo['data']['info'].type } })}`,
title: `${location[housingInfo['data']['info'].location]}${type[housingInfo['data']['info'].type]}`
}
}else if(pageType.value == 4){
} else if (pageType.value == 4) {
store.state.routeList['thirdIndex'] = {
path:{
path:`${store.state.routeList['secondaryIndex'].path}`,
query:{
id:1
path: {
path: `${store.state.routeList['secondaryIndex'].path}`,
query: {
id: 1
}
} ,
},
title: ``
}
if (housingInfo['data']['info'].location.length > 0)
@ -1155,16 +1162,16 @@ let getHousingInfo = () => {
housingInfo['data'] = res.data
setHousingArr()
setNavigation()
distanceList.value = distanceList.value.concat(housingInfo['data']['info'].pointData||[])
distanceList.value = distanceList.value.concat(housingInfo['data']['info'].pointData || [])
distanceList.value.unshift({
address: true,
name: housingInfo['data']['info'].address,
})
concatInfo['data'] = store.state.indexData.wechat
if (res.data.contacts) contacts['data'] = res.data.contacts
if (housingInfo['data'].info.verified&&pageType.value!=3) {
if (housingInfo['data'].info.verified && pageType.value != 3) {
getPublisherList()
} else if(pageType.value!=3){
} else if (pageType.value != 3) {
recommendList()
}
@ -1344,7 +1351,7 @@ onMounted(() => {
if (pageType.value != 3) {
setTimeout(() => {
window.addEventListener('scroll', onPageSrcoll, true);
document.body.scrollTop=0
document.body.scrollTop = 0
}, 1000)
}
@ -1402,8 +1409,9 @@ img {
.pos-a {
position: absolute;
}
.mg-b-80{
margin-bottom:80px;
.mg-b-80 {
margin-bottom: 80px;
}
.housing-title {
@ -1485,7 +1493,7 @@ img {
.img {
width: 800px;
height:800px;
height: 800px;
}
}
@ -1954,7 +1962,7 @@ img {
font-size: 14px;
color: #333;
cursor: pointer;
margin-top:10px;
margin-top: 10px;
.logo {
width: 22px;
@ -2003,7 +2011,7 @@ img {
.crowd-box {
width: 120px;
height: 120px;
margin-top:30px;
margin-top: 30px;
background: inherit;
background-color: rgba(255, 255, 255, 1);
border: none;
@ -2041,7 +2049,7 @@ img {
.wx-qrcode {
width: 103px;
height: 103px;
border-radius:50%;
border-radius: 50%;
}
}
@ -2579,6 +2587,11 @@ img {
height: 70px;
}
.distance-box-s {
height: 500px;
overflow-y: scroll;
}
.distance-info-data {
padding: 30px 45px 0 45px;
position: relative;
@ -2616,8 +2629,6 @@ img {
}
.school-info {
height:500px;
overflow-y: scroll;
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
font-style: normal;
@ -2672,9 +2683,9 @@ img {
}
}
::-webkit-scrollbar {
/* ::-webkit-scrollbar {
display: none;
}
} */
.line-school-box {
width: 100%;
@ -2765,6 +2776,5 @@ img {
}
}
}
}
</style>
}</style>