优化tab的轮播图的数据

This commit is contained in:
A1300399510
2024-03-26 17:30:58 +08:00
parent d8f64a1a5f
commit 9cc3ef52fa
20 changed files with 347 additions and 331 deletions

View File

@@ -1,6 +1,7 @@
<template>
<div class="home box-min-1200-src">
<pageTopBar :bannerList="bannerList.data.home"></pageTopBar>
<!-- <pageTopBar :bannerList="bannerList.data.home"></pageTopBar> -->
<pageTopBar></pageTopBar>
<!-- 搜索模块 -->
<seachModule :getDataList="personHouseingInfo"></seachModule>
<!-- 房源展示 -->
@@ -227,14 +228,14 @@ let waterfallList = ref([])
let noWaterfallList = ref(3)
//轮播
let bannerList = reactive({ data: [] })
let banner = () => {
api.banner().then(res => {
if (res.code === 200) {
bannerList.data = res.data
}
})
}
// let bannerList = reactive({ data: [] })
// let banner = () => {
// api.banner().then(res => {
// if (res.code === 200) {
// bannerList.data = res.data
// }
// })
// }
//开关
let loadMore = ref(true)
@@ -353,7 +354,7 @@ onMounted(() => {
document.documentElement.scrollTop = 0
currentInstance = getCurrentInstance()
getRecommendList()
banner()
// banner()
window.addEventListener('scroll', onPageSrcoll, true);
})

View File

@@ -1,12 +1,13 @@
<template>
<pageTopBar :bannerList="bannerList.data.apartment"></pageTopBar>
<!-- <pageTopBar :bannerList="bannerList.data.apartment"></pageTopBar> -->
<pageTopBar></pageTopBar>
<!-- 筛选 -->
<div class="screen-box wid1200">
<seach-module @handleTransfer="handleTransfer" :count="listCount" :initPitchValue="pitchValue"></seach-module>
</div>
<div class="list wid1200 flexflex" ref="gridContainer">
<apartment-item v-if="list.length != 0" v-for="item in list" :item="item"></apartment-item>
<apartment-item v-if="list.length != 0" v-for="(item, index) in list" :key="index" :item="item"></apartment-item>
</div>
<div v-if="list.length == 0" class="empty-box wid1200 flexcenter">
@@ -66,7 +67,7 @@ onMounted(() => {
pitchValue.value = store.state.apartmentPitchValue
if (route.query["companyid"]) pitchValue.value["companyid"] = route.query["companyid"]
banner() // 获取轮播图数据
// banner() // 获取轮播图数据
getData() // 获取列表数据
window.addEventListener("scroll", handleScroll)
@@ -147,12 +148,12 @@ const handleTransfer = data => {
}
//轮播
let bannerList = reactive({ data: [] })
let banner = () => {
proxy.$get("/tenement/pc/api/banner").then(res => {
if (res.code === 200) bannerList.data = res.data
})
}
// let bannerList = reactive({ data: [] })
// let banner = () => {
// proxy.$get("/tenement/pc/api/banner").then(res => {
// if (res.code === 200) bannerList.data = res.data
// })
// }
</script>
<style lang="less" scoped>
.screen-box {

View File

@@ -1,6 +1,7 @@
<template>
<div class="box-min-1200-src">
<pageTopBar :bannerList="bannerList.data.intermediaryHousing"></pageTopBar>
<!-- <pageTopBar :bannerList="bannerList.data.intermediaryHousing"></pageTopBar> -->
<pageTopBar></pageTopBar>
<seachModule :count="dataList.count" :getDataList="setSeachSelectData"></seachModule>
<div class="dis-f jus-x al-item">
<div class="body-maxWidth mg-t-35">
@@ -50,14 +51,14 @@ let loadingText = ref(" 下拉加载更多 ")
provide("count", dataCount)
//轮播
let bannerList = reactive({ data: [] })
let banner = () => {
api.banner().then(res => {
if (res.code === 200) {
bannerList.data = res.data
}
})
}
// let bannerList = reactive({ data: [] })
// let banner = () => {
// api.banner().then(res => {
// if (res.code === 200) {
// bannerList.data = res.data
// }
// })
// }
//保存搜索设置
let setSeachSelectData = (data, noMask = false) => {
@@ -129,7 +130,7 @@ onMounted(() => {
gutter: 20,
})
// getDataList()
banner()
// banner()
window.addEventListener("scroll", downLoadMore, true)
})

View File

@@ -1,6 +1,7 @@
<template>
<div class="box-min-1200-src">
<pageTopBar :bannerList="bannerList.data.personHousing"></pageTopBar>
<!-- <pageTopBar :bannerList="bannerList.data.personHousing"></pageTopBar> -->
<pageTopBar></pageTopBar>
<seachModule :getDataList="setSeachSelectData"></seachModule>
<div class="dis-f jus-x al-item">
<div class="body-maxWidth mg-t-35">
@@ -70,14 +71,14 @@ let setSeachSelectData = (data, noMask = false) => {
}
//轮播
let bannerList = reactive({ data: [] })
let banner = () => {
api.banner().then(res => {
if (res.code === 200) {
bannerList.data = res.data
}
})
}
// let bannerList = reactive({ data: [] })
// let banner = () => {
// api.banner().then(res => {
// if (res.code === 200) {
// bannerList.data = res.data
// }
// })
// }
//获取搜索数据
let getDataList = data => {
@@ -146,7 +147,7 @@ onMounted(() => {
// seachSelectData.data = { [type]: typeData }
// }
// }
banner()
// banner()
// getDataList(seachSelectData.data)
window.addEventListener("scroll", downLoadMore, true)
})