搜索页搜索数量同步
This commit is contained in:
parent
fb81238823
commit
179d846bae
@ -3,7 +3,7 @@
|
||||
<div class="body-maxWidth">
|
||||
<div class="s-w-100 seach-box-bg">
|
||||
<div class="seach-box">
|
||||
<div class="top-seach dis-f al-item">
|
||||
<div class="top-seach dis-f al-item" v-if="props.seachPage">
|
||||
<div style="position: absolute;left: -8px;top: 20px;">
|
||||
<div class="location-box dis-f jus-x al-item">
|
||||
<img src="../../assets/homeImage/addressImg.png" class="img" alt="">
|
||||
@ -160,7 +160,7 @@
|
||||
收起筛选条件<img class="icon" src="@/assets/img/publicImage/triangle-black.svg" />
|
||||
</div>
|
||||
|
||||
<div class="screen-footer flexacenter">
|
||||
<div class="screen-footer flexacenter" v-if="props.seachPage">
|
||||
<div class="quantity flexacenter">
|
||||
共 <b class="b">{{ count }}</b> 个品牌公寓
|
||||
</div>
|
||||
@ -185,6 +185,10 @@ const props = defineProps({
|
||||
count: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
seachPage: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
|
||||
|
0
src/components/detail/imageWatch.vue
Normal file
0
src/components/detail/imageWatch.vue
Normal file
@ -157,7 +157,7 @@
|
||||
<script setup>
|
||||
import { reactive, ref, shallowReactive, defineProps, watchEffect, defineExpose } from 'vue'
|
||||
import selectTabBox from "../selectTabBox/selectTabBox.vue";
|
||||
import apartmentSelect from '../apartment/seach.vue'
|
||||
import apartmentSelect from '../apartment/seachModule.vue'
|
||||
import store from '../../store/index';
|
||||
import api from '@/utils/api';
|
||||
import { useRouter } from 'vue-router';
|
||||
@ -184,19 +184,18 @@ let selectPage = (type) => {
|
||||
if (type === 'apartment') {
|
||||
selectTabBoxInfo.value.cleanSelect()//清空筛选数据
|
||||
} else {
|
||||
apartmentSelectInfo.value.cleanSelect()
|
||||
apartmentSelectInfo.value.cleanSelect&&apartmentSelectInfo.value.cleanSelect()
|
||||
}
|
||||
//清空数据
|
||||
if (type === 'apartment')
|
||||
seachAllType = reactive({
|
||||
keyword: '',
|
||||
keyword: seachAllType['keyword'],
|
||||
location: [],
|
||||
searchid: '',
|
||||
intermediary: 0
|
||||
intermediary: ''
|
||||
})
|
||||
|
||||
tabType.value = type
|
||||
seachAllType['tabType'] = type
|
||||
seachAllType['searchid'] = setPageKey()
|
||||
if (type === 'person') {
|
||||
seachAllType['intermediary'] = 0
|
||||
} else if (type === 'intermediary') {
|
||||
@ -240,11 +239,13 @@ let checkPageType = () => {
|
||||
|
||||
|
||||
//搜索key
|
||||
let seachKey = reactive({ key: {
|
||||
personal:{},
|
||||
intermediary:{},
|
||||
studentapartment:{}
|
||||
} })
|
||||
let seachKey = reactive({
|
||||
key: {
|
||||
personal: {},
|
||||
intermediary: {},
|
||||
studentapartment: {}
|
||||
}
|
||||
})
|
||||
|
||||
//搜索数据
|
||||
let seachAllType = reactive({
|
||||
@ -311,10 +312,10 @@ let seachList = (item) => {
|
||||
if (!seachVal.value) {
|
||||
return
|
||||
}
|
||||
if(seachAllType['intermediary']===6){
|
||||
seachAllType['keyword']=seachVal.value
|
||||
if (seachAllType['intermediary'] === 6) {
|
||||
seachAllType['keyword'] = seachVal.value
|
||||
getDataList(seachAllType)
|
||||
}else{
|
||||
} else {
|
||||
searchInit(seachVal.value)
|
||||
}
|
||||
}
|
||||
@ -365,6 +366,19 @@ let getLocationData = (data) => {
|
||||
}
|
||||
}
|
||||
|
||||
//更新当前数据数量
|
||||
let setListCount=(item,num)=>{
|
||||
console.log(item,num)
|
||||
console.log(seachKey.key)
|
||||
if(item.tabType==="intermediary"){
|
||||
seachKey.key['intermediary']['count']=num
|
||||
}else if(item.tabType==="person"){
|
||||
seachKey.key['personal']['count']=num
|
||||
}else if(item.tabType==="apartment"){
|
||||
seachKey.key['studentapartment']['count']=num
|
||||
}
|
||||
}
|
||||
|
||||
//调用判断页面
|
||||
checkPageType()
|
||||
|
||||
@ -373,7 +387,8 @@ watchEffect(() => {
|
||||
if (seachArea.data.length > 0 && !seachArea.data[0].data) getLocationData(store.state.indexData.config.location)
|
||||
})
|
||||
defineExpose({
|
||||
searchInit
|
||||
searchInit,
|
||||
setListCount
|
||||
})
|
||||
|
||||
</script>
|
||||
|
@ -549,7 +549,7 @@ let setOtherCheck = (data) => {
|
||||
|
||||
//清除筛选
|
||||
let cleanSelect = () => {
|
||||
cleanRent()
|
||||
// cleanRent()
|
||||
otherCheck['list'] = []
|
||||
releaseObj.id = 0
|
||||
gender.id = 0
|
||||
@ -564,6 +564,8 @@ let cleanSelect = () => {
|
||||
selectData.data = []
|
||||
schoolSelectObj.id = ''
|
||||
schoolSelectObj.title = '不限'
|
||||
rentObj.min = ''
|
||||
rentObj.max = ''
|
||||
// setCheckData([])
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,10 @@
|
||||
</div>
|
||||
<div class="image-box">
|
||||
<div class="dis-f al-item">
|
||||
|
||||
<img src="../assets/img/detail/videoIcon.png" class="img-video" alt="">
|
||||
<div class="num-box">1</div>
|
||||
<img src="../assets/img/detail/imageIcon.png" class="img-icon" alt="">
|
||||
<div class="num-box">2</div>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
@ -195,17 +198,22 @@ img {
|
||||
.img-video {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
.img-icon {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
margin:0 5px 0 10px
|
||||
}
|
||||
|
||||
.num-box {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background:#fdda55;
|
||||
line-height:20px;
|
||||
text-align:center;
|
||||
color: #333333;
|
||||
font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
|
||||
font-weight: 400;
|
||||
|
@ -15,7 +15,7 @@
|
||||
listId="2"></biserialItem>
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="seachSelectData.data.intermediary === ''" ref="gridContainer">
|
||||
<div v-show="seachSelectData.data.intermediary === ''&&dataList.data && dataList.data.length > 0" ref="gridContainer">
|
||||
<apartment-item v-for="item in listApartment" :item="item"></apartment-item>
|
||||
</div>
|
||||
<div class="dis-f jus-x no-list-box al-item" v-show="dataList.data && dataList.data.length === 0">
|
||||
@ -102,6 +102,7 @@ let getDataList = (data) => {
|
||||
seachApi.then(res => {
|
||||
if (res.code === 200) {
|
||||
console.log(res.data)
|
||||
// console.log(seachSelectData.data)
|
||||
dataList.data = res.data.data
|
||||
if (seachSelectData.data.tabType !== 'apartment') {
|
||||
if (pages.value === 1) {
|
||||
@ -116,13 +117,14 @@ let getDataList = (data) => {
|
||||
})
|
||||
} else {
|
||||
let data = res.data
|
||||
dataList.count = res.data.count
|
||||
listApartment.value = listApartment.value.concat(data.data)
|
||||
nextTick(() => {
|
||||
masonryInstance.reloadItems();
|
||||
masonryInstance.layout();
|
||||
})
|
||||
}
|
||||
|
||||
inputModuleInfo.value.setListCount(seachSelectData.data,dataList.count)
|
||||
|
||||
} else {
|
||||
ElMessage({
|
||||
|
Loading…
x
Reference in New Issue
Block a user