提交
This commit is contained in:
@@ -1103,12 +1103,13 @@ 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(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}?type=location&data=${housingInfo['data']['info'].location.substring(0, 1)}`)
|
||||
console.log(`${store.state.routeList['secondaryIndex'].path}/location/${housingInfo['data']['info'].location.substring(0, 1)}`)
|
||||
store.state.routeList['thirdIndex'] = {
|
||||
path: `${store.state.routeList['secondaryIndex'].path}?type=location&data=${housingInfo['data']['info'].location.substring(0, 1)}`,
|
||||
path: `${store.state.routeList['secondaryIndex'].path}/location/${housingInfo['data']['info'].location.substring(0, 1)}`,
|
||||
title: `${location[housingInfo['data']['info'].location.substring(0, 1)]}${type[housingInfo['data']['info'].type.substring(0, 1)]}房源`
|
||||
}
|
||||
if (housingInfo['data']['info'].location.length > 0)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<loadMoreText :loadText="loading?'加载中....':'到底了'"></loadMoreText>
|
||||
<loadMoreText :loadText="loading ? '加载中....' : '到底了'"></loadMoreText>
|
||||
<listBtmPrompt></listBtmPrompt>
|
||||
<footerTool></footerTool>
|
||||
</div>
|
||||
@@ -77,7 +77,7 @@ let setInitial = () => {
|
||||
|
||||
//获取搜索数据
|
||||
let getDataList = (data) => {
|
||||
if(!loading.value)return
|
||||
if (!loading.value) return
|
||||
loading.value = false
|
||||
let postData = {
|
||||
page: pages.value,
|
||||
@@ -94,8 +94,8 @@ let getDataList = (data) => {
|
||||
dataList.count = res.data.count
|
||||
dataCount.value = res.data.count
|
||||
nextTick(() => {
|
||||
if(dataList.data[0])pageList['1'].push(dataList.data[0])
|
||||
if(dataList.data[1])pageList['2'].push(dataList.data[1])
|
||||
if (dataList.data[0]) pageList['1'].push(dataList.data[0])
|
||||
if (dataList.data[1]) pageList['2'].push(dataList.data[1])
|
||||
})
|
||||
} else {
|
||||
ElMessage({
|
||||
@@ -109,10 +109,10 @@ let getDataList = (data) => {
|
||||
//添加数据
|
||||
let addListData = () => {
|
||||
let num = null
|
||||
if (pageList.tab > (dataList.count>20?dataList.data.length-2:dataList.count-2)) {
|
||||
if(dataList.data.length>20){
|
||||
if (pageList.tab > (dataList.count > 20 ? dataList.data.length - 2 : dataList.count - 2)) {
|
||||
if (dataList.data.length > 20) {
|
||||
loading.value = true
|
||||
}else{
|
||||
} else {
|
||||
loading.value = false
|
||||
}
|
||||
return
|
||||
@@ -135,7 +135,7 @@ let watchImgLoad = (id, listId, height) => {
|
||||
//加载更多
|
||||
let downLoadMore = () => {
|
||||
tool.loadMore(() => {
|
||||
if (!loading.value||dataList.data.length==0) return
|
||||
if (!loading.value || dataList.data.length == 0) return
|
||||
pages.value++
|
||||
getDataList(seachSelectData.data)
|
||||
})
|
||||
@@ -143,15 +143,25 @@ let downLoadMore = () => {
|
||||
|
||||
//listImg
|
||||
onMounted(() => {
|
||||
let {type,data}=router.currentRoute.value.query
|
||||
let typeData=null
|
||||
if(data)typeData=JSON.parse(data)
|
||||
|
||||
if(data&&Object.keys(data).length>0){
|
||||
if(type!=='location'){
|
||||
seachSelectData.data={[type]:typeData.id}
|
||||
}else{
|
||||
seachSelectData.data={[type]:typeData}
|
||||
console.log(123)
|
||||
let type=null,data=null
|
||||
if (router.currentRoute.value.params.type) {
|
||||
let { type, data } = router.currentRoute.value.params
|
||||
type=type
|
||||
data=data
|
||||
} else {
|
||||
let { type, data } = router.currentRoute.value.query
|
||||
type=type
|
||||
data=data
|
||||
}
|
||||
let typeData = null
|
||||
if (data) typeData = JSON.parse(data)
|
||||
|
||||
if (data && Object.keys(data).length > 0) {
|
||||
if (type !== 'location') {
|
||||
seachSelectData.data = { [type]: typeData.id }
|
||||
} else {
|
||||
seachSelectData.data = { [type]: typeData }
|
||||
}
|
||||
}
|
||||
getDataList(seachSelectData.data)
|
||||
|
||||
Reference in New Issue
Block a user