房源信息模块

This commit is contained in:
gxwebsoft
2023-08-08 20:02:22 +08:00
parent 1b923e5cff
commit 93e0876e13
11 changed files with 343 additions and 146 deletions

View File

@@ -4,17 +4,21 @@
<u-sticky offset-top="5" zIndex="999">
<view class="search-fix fixed" v-if="scrollTop < 30">
<view class="search">
<view class="region">青秀区</view>
<u-notice-bar bgColor="#ffffff" direction="column" :text="hotKeywords" speed="250" @click="onNoticeBar"></u-notice-bar>
<!-- <uni-data-select class="select-width" v-model="where.region" :localdata="region"
placeholder="所在区域"></uni-data-select> -->
<view class="input">
<u-search placeholder="您想找哪里" bgColor="#ffffff" v-model="keyword" :animation="true"></u-search>
<u-search placeholder="您想找哪里" bgColor="#ffffff" v-model="where.keywords" :showAction="false" :animation="true" @search="onSearch"></u-search>
</view>
</view>
</view>
<view class="search-fix" v-else>
<view class="search">
<view class="region">青秀区</view>
<u-notice-bar bgColor="#ffffff" direction="column" :text="hotKeywords" speed="250"></u-notice-bar>
<!-- <uni-data-select class="select-width" v-model="where.region" :localdata="region"
placeholder="所在区域"></uni-data-select> -->
<view class="input">
<u-search placeholder="您想找哪里" bgColor="#ffffff" v-model="keyword" :animation="true"></u-search>
<u-search placeholder="您想找哪里" bgColor="#ffffff" v-model="where.keywords" :showAction="false" :animation="true" @search="onSearch"></u-search>
</view>
</view>
</view>
@@ -25,7 +29,7 @@
</view>
<!-- 选项卡 -->
<view class="tabs">
<u-tabs :list="menu" @click="click"></u-tabs>
<u-tabs :list="menu" @click="onClick"></u-tabs>
</view>
<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
@scrolltolower="lower" @scroll="onScroll">
@@ -52,6 +56,7 @@
import * as Util from '@/utils/util.js'
import store from '@/store'
import storage from '@/utils/storage'
import * as DictApi from '@/api/dict.js'
import * as HouseInfoApi from '@/api/house-info.js'
const menu = [{
@@ -72,7 +77,10 @@
loadMore: true,
status: '加载更多',
page: 1,
where: {},
where: {
recommend: 1
},
region: [],
// 控制onShow事件是否刷新订单列表
canReset: false,
disabled: false,
@@ -80,6 +88,10 @@
'https://file.wsdns.cn/20230802/f33f5ac239c843438b36f40941d946ef.png',
'https://file.wsdns.cn/20230802/1116a02b07904991b2ebdc2c3da4a691.png',
],
hotKeywords: [
'五象航洋城',
'富雅国际金融中心'
],
menu,
scrollTop: 0,
old: {
@@ -89,6 +101,7 @@
},
onLoad() {
this.getDict()
this.list = []
this.onRefreshList()
},
@@ -110,6 +123,18 @@
}
},
methods: {
getDict() {
DictApi.getDictionaryOptions({
dictCode: 'region'
}).then(res => {
this.region = res.data.map(d => {
return {
value: d.dictDataCode,
text: d.dictDataName
}
})
})
},
onRefreshList() {
const app = this
const userId = uni.getStorageSync('userId')
@@ -132,6 +157,28 @@
})
})
},
onClick(e){
const index = e.index
this.where = {}
if(index == 0){
this.where.recommend = 1
}
if(index == 1){
this.where.mustSee = 1
}
this.onSearch()
},
onNoticeBar(index){
// console.log('this.hotKeywords[index]: ',this.hotKeywords[index]);
this.where.keywords = this.hotKeywords[index]
this.onSearch()
},
onSearch() {
this.list = []
this.page = 1
this.onRefreshList()
// this.$push('/sub_pages/member/member', this.where)
},
},
watch: {
@@ -141,7 +188,7 @@
<style lang="scss" scoped>
.page {
.search-fix {
width: 500rpx;
width: 600rpx;
margin: auto;
background-color: #ffffff;
display: flex;
@@ -149,7 +196,7 @@
box-shadow: 0 3rpx 10rpx 0px #cccccc;
.search {
width: 400rpx;
width: 580rpx;
margin: 15rpx auto;
display: flex;
justify-content: space-between;
@@ -160,19 +207,22 @@
color: #666666;
font-size: 28rpx;
}
.input{
width: 250rpx;
}
}
}
.fixed {
position: fixed;
top: 300rpx;
left: 125rpx;
left: 75rpx;
}
.no-fixed {
position: absolute;
top: 0rpx;
left: 125rpx;
left: 75rpx;
}
.tabs {
@@ -228,4 +278,7 @@
}
}
}
.select-width{
width: 200rpx;
}
</style>