输入框内容为空时搜索内容,设置为前一个搜索内容

This commit is contained in:
luJianJun 2023-08-02 14:47:08 +08:00
parent 5407042a87
commit 9c958fd85b

View File

@ -214,6 +214,7 @@ let selectPage = (type) => {
tabType.value = type
seachAllType['tabType'] = type
seachAllType['searchid'] = setPageKey()
//
if (type === 'person') {
seachAllType['intermediary'] = 0
seachAllType['isintermediary'] = 0
@ -232,7 +233,11 @@ let selectPage = (type) => {
seachAllType['isverified'] = 0
seachAllType['isintermediary'] = 0
}
if ((seachVal.value && !setPageKey()))return
//
if (tabType.value != 'need') {
setSeachVal()
}
if ((seachVal.value && !setPageKey())) return
getDataList(seachAllType)
}
@ -297,10 +302,15 @@ if (isNeedHousing.value) {
seachAllType['intermediary'] = 6
}
//
let setSeachVal = () => {
seachAllType['searchid'] = setPageKey()
seachVal.value = seachKey.key.keyword
}
//
let setSeachConditions = (type, data) => {
// console.log(1,seachAllType)
console.log(data)
if (seachAllType['tabType'] !== 'apartment') {
if (type === 'rent') {
seachAllType['rent_min'] = data.min
@ -322,10 +332,16 @@ let setSeachConditions = (type, data) => {
} else {
seachAllType = {
tabType: 'apartment',
searchid: setPageKey(),
...type.value
}
}
if (tabType.value != 'need') {
setSeachVal()
}else if(tabType.value=='need'){
seachVal.value = seachAllType.keyword
}
if (!seachAllType['tabType']) seachAllType['tabType'] = tabType.value
if (!seachVal.value) {
seachAllType.searchid = ''