From 8926f3d3b60214bb710651811d29394af5ce51c3 Mon Sep 17 00:00:00 2001 From: luJianJun <2587063613@qq.com> Date: Thu, 10 Aug 2023 17:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=97=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/seachPage/input.vue | 33 ++++++++++++++------ src/components/selectTabBox/selectTabBox.vue | 3 +- src/views/detail.vue | 4 ++- src/views/seachIndex.vue | 14 +++++++-- 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/components/seachPage/input.vue b/src/components/seachPage/input.vue index 53e0789..ef67e64 100644 --- a/src/components/seachPage/input.vue +++ b/src/components/seachPage/input.vue @@ -226,7 +226,7 @@ let selectPage = (type) => { }) tabType.value = type seachAllType['tabType'] = type - seachAllType['searchid'] = setPageKey() + seachAllType['searchid'] = setPageKey().searchid //根据类型初始化筛选参数 if (type === 'person') { seachAllType['intermediary'] = 0 @@ -250,8 +250,9 @@ let selectPage = (type) => { if (tabType.value != 'need') { setSeachVal() } - if ((seachVal.value && !setPageKey())) return - getDataList(seachAllType) + if ((seachVal.value && !setPageKey().searchid)) return + let seachObj=setSeachId() + getDataList(seachAllType,seachObj.count==0?false:true) } let getDataList = props.getDataList @@ -286,7 +287,8 @@ let checkPageType = () => { } else { seachAllType['intermediary'] = '' } - getDataList(seachAllType) + let seachObj=setSeachId() + getDataList(seachAllType,seachObj.count==0?false:true) } @@ -298,6 +300,9 @@ let seachKey = reactive({ studentapartment: {} } }) +let seachInfoData=shallowReactive({ + data:{} +}) //搜索数据 let seachAllType = reactive({ @@ -315,7 +320,7 @@ if (isNeedHousing.value) { //切换选项重置输入框内容 let setSeachVal = () => { - seachAllType['searchid'] = setPageKey() + seachAllType['searchid'] = setPageKey().searchid seachVal.value = seachKey.key.keyword } @@ -371,12 +376,17 @@ let setSeachConditions = (type, data) => { seachAllType['isverified'] = 0 seachAllType['isintermediary'] = 0 } - getDataList(seachAllType) + let seachObj=setSeachId() + getDataList(seachAllType,seachObj.count==0?false:true) } //设置当前搜索key let setPageKey = () => { - return tabType.value === 'person' ? seachKey.key.personal.searchid : tabType.value === 'intermediary' ? seachKey.key.intermediary.searchid : tabType.value === 'apartment' ? seachKey.key.studentapartment.searchid : '' + return tabType.value === 'person' ? seachKey.key.personal : tabType.value === 'intermediary' ? seachKey.key.intermediary : tabType.value === 'apartment' ? seachKey.key.studentapartment : '' +} + +let setSeachId=()=>{ + return tabType.value === 'person' ? seachInfoData.data.personal : tabType.value === 'intermediary' ? seachInfoData.data.intermediary : tabType.value === 'apartment' ? seachInfoData.data.studentapartment : '' } //搜索初始化 @@ -384,8 +394,10 @@ let searchInit = (data) => { api.search({ keyword: data }).then(res => { if (res.code === 200) { seachKey.key = res.data - seachAllType.searchid = setPageKey() - getDataList(seachAllType) + seachInfoData.data=JSON.parse(JSON.stringify(res.data)) + let seachObj=setSeachId() + seachAllType.searchid = seachObj.searchid + getDataList(seachAllType,seachObj.count==0?false:true) } else { ElMessage({ message: res.message, @@ -403,7 +415,8 @@ let seachList = (item) => { } if (seachAllType['intermediary'] === 6) { seachAllType['keyword'] = seachVal.value - getDataList(seachAllType) + let seachObj=setSeachId() + getDataList(seachAllType,seachObj.count==0?false:true) } else { searchInit(seachVal.value) } diff --git a/src/components/selectTabBox/selectTabBox.vue b/src/components/selectTabBox/selectTabBox.vue index b4f61d1..d01b84b 100644 --- a/src/components/selectTabBox/selectTabBox.vue +++ b/src/components/selectTabBox/selectTabBox.vue @@ -416,6 +416,7 @@ let setSelectData = (id, data = [], title) => { setLocation('location', [selectTabCheck.id + '']) if (id === '') { selectData.data = [] + loactionArr.data=null setSeachCondition('location', []) } } @@ -455,7 +456,7 @@ let selectSeach = (data = []) => { } schoolSelectObj.id = '' schoolSelectObj.title = '' - + console.log(loactionArr.data,data) if(loactionArr.data&&(loactionArr.data.toString()===data.toString()))return loactionArr.data=JSON.parse(JSON.stringify(data)) diff --git a/src/views/detail.vue b/src/views/detail.vue index 78725ac..5435966 100644 --- a/src/views/detail.vue +++ b/src/views/detail.vue @@ -2409,7 +2409,8 @@ img { .img-video { width: 26px; height: 26px; - margin-right: 5px; + margin-right: 3px; + margin-left:-2px; } .img-icon { @@ -2430,6 +2431,7 @@ img { font-weight: 400; font-style: normal; font-size: 14px; + margin-right:8px; } .no-img-pd{ diff --git a/src/views/seachIndex.vue b/src/views/seachIndex.vue index abba05d..a69427f 100644 --- a/src/views/seachIndex.vue +++ b/src/views/seachIndex.vue @@ -61,13 +61,13 @@ let listMasonryInstance = null provide('count', dataCount) //保存搜索设置 -let setSeachSelectData = (data) => { +let setSeachSelectData = (data,type) => { pages.value = 1 seachSelectData.data = { ...data } loading.value = true - getDataList(seachSelectData.data) + getDataList(seachSelectData.data,type) } //初始化列表参数 @@ -79,7 +79,15 @@ let setInitial = () => { } //获取搜索数据 -let getDataList = (data) => { +let getDataList = (data,type=true) => { + console.log(data,type) + if(!type){ //是否继续搜索 + seachSelectData.data.tabType !== 'apartment'?pageList.value = []:listApartment.value = [] + dataList.data = [] + dataCount.value = 0 + loading.value = false + return + } loadingText.value=' 加载中..... ' if (!loading.value) return let postData = {