个人房源---差下拉更多 搜索信息
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<pageTopBar></pageTopBar>
|
||||
<seachModule :count="dataList.count"></seachModule>
|
||||
<seachModule :count="dataList.count" :getDataList="getDataList"></seachModule>
|
||||
<div class="dis-f jus-x al-item">
|
||||
<div class="body-maxWidth mg-t-35">
|
||||
<div class="dis-f jus-bet">
|
||||
@@ -19,7 +19,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {reactive,onMounted,ref} from 'vue'
|
||||
import {reactive,onMounted,ref,provide} from 'vue'
|
||||
import pageTopBar from '../../components/pageTopBar/pageTopBar.vue';
|
||||
import seachModule from "../../components/seachModule/seachModule.vue";
|
||||
import biserialItem from '../../components/biserialListItem/biserialListItem.vue'
|
||||
@@ -28,19 +28,25 @@ import api from "../../utils/api";
|
||||
//获取数据
|
||||
let pages=ref(1)
|
||||
let dataList= reactive({data:[],count:0})
|
||||
let dataCount=ref(0)
|
||||
let pageList=reactive({1:[],2:[],height1:0,height2:0,tab:2})
|
||||
let getDataList=()=>{
|
||||
provide('count', dataCount)
|
||||
let getDataList=(data)=>{
|
||||
let postData={
|
||||
page:pages.value
|
||||
page:pages.value,
|
||||
...data
|
||||
}
|
||||
api.getLists(postData).then(res=>{
|
||||
console.log(res.data)
|
||||
if(res.code===200){
|
||||
dataList.count=res.data.count
|
||||
dataCount.value=res.data.count
|
||||
dataList.data=res.data
|
||||
console.log(dataList.data)
|
||||
// console.log(dataList.data)
|
||||
pageList[1].push(dataList.data.data[0])
|
||||
pageList[2].push(dataList.data.data[1])
|
||||
}else{
|
||||
ElMessage(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -50,7 +56,7 @@ let addListData=()=>{
|
||||
let num=null
|
||||
if(pageList.tab>=19)return
|
||||
++pageList.tab
|
||||
console.log(pageList.height1,pageList.height2)
|
||||
// console.log(pageList.height1,pageList.height2)
|
||||
if(pageList.height1>pageList.height2){
|
||||
num=2
|
||||
}else{
|
||||
@@ -61,7 +67,7 @@ let addListData=()=>{
|
||||
|
||||
//监听图片加载
|
||||
let watchImgLoad=(id,listId,height)=>{
|
||||
console.log(listId,height)
|
||||
// console.log(listId,height)
|
||||
pageList[`height${listId}`]+=height
|
||||
// console.log(pageList)
|
||||
addListData()
|
||||
|
||||
Reference in New Issue
Block a user