首页/资产列表/资产详情页面样式修改

This commit is contained in:
2025-12-25 17:14:51 +08:00
parent 964e4f9c33
commit d5953d219f
4 changed files with 1446 additions and 873 deletions

View File

@@ -544,23 +544,23 @@
height: 44px; height: 44px;
border-bottom: solid 1rpx #eee; border-bottom: solid 1rpx #eee;
z-index: 12; z-index: 12;
background-color: #ffffff; background: linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);
flex-direction: row; flex-direction: row;
.first-menu { .first-menu {
width: 100%; width: 100%;
font-size: 15px; font-size: 15px;
color: #757575; color: #000000;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
transition: color .2s linear; transition: color .2s linear;
&.on { &.on {
color: #2979ff; color: #f44336;
.iconfont { .iconfont {
color: #2979ff; color: #f44336;
} }
} }
@@ -585,6 +585,7 @@
width: 100%; width: 100%;
position: absolute; position: absolute;
left: 0; left: 0;
margin-top: -2px;
transform: translate3d(0, - 100%, 0); transform: translate3d(0, - 100%, 0);
max-height: 345px; max-height: 345px;
background-color: #ffffff; background-color: #ffffff;
@@ -624,7 +625,7 @@
> .iconfont { > .iconfont {
display: none; display: none;
font-size: 18px; font-size: 18px;
color: #2979ff; color: #f44336;
} }
} }
} }
@@ -654,7 +655,7 @@
border-bottom: solid 1rpx #e5e5e5; border-bottom: solid 1rpx #e5e5e5;
&.on { &.on {
color: #2979ff; color: #f44336;
> .menu-name { > .menu-name {
> .iconfont { > .iconfont {
@@ -677,12 +678,12 @@
> .iconfont { > .iconfont {
display: none; display: none;
font-size: 18px; font-size: 18px;
color: #2979ff; color: #f44336;
} }
} }
&.on { &.on {
color: #2979ff; color: #f44336;
> .menu-name { > .menu-name {
> .iconfont { > .iconfont {
@@ -716,7 +717,7 @@
&.on { &.on {
border-color: #f6c8ac; border-color: #f6c8ac;
color: #2979ff; color: #f44336;
} }
.iconfont { .iconfont {
@@ -757,8 +758,8 @@
flex-wrap: wrap; flex-wrap: wrap;
.on { .on {
border-color: #2979ff; border-color: #f44336;
background-color: #2979ff; background-color: #f44336;
color: #fff; color: #fff;
} }
@@ -794,18 +795,18 @@
width: 320rpx; width: 320rpx;
height: 42px; height: 42px;
border-radius: 42px; border-radius: 42px;
border: 2rpx solid #2979ff; border: 2rpx solid #f44336;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.reset { .reset {
color:#2979ff; color:#f44336;
} }
.submit { .submit {
color: #fff; color: #fff;
background-color: #2979ff; background-color: #f44336;
} }
} }
} }

View File

@@ -1,18 +1,17 @@
<template> <template>
<view class="asset-detail"> <view class="asset-detail">
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<customNavbar <!-- <customNavbar
title="不动资产详情" ref="navbar"/> title="资产详情" ref="navbar"/> -->
<!-- 顶部信息块 -->
<view :style="{ paddingTop: navTotalHeight + 'px' }"> <!-- <u-navbar title="资产详情" :autoBack="true" :background="background" title-color="#2D2B2C"
<!-- <u-swiper back-icon-color="#2D2B2C">
:list="asset.images" </u-navbar> -->
height="220" <!-- 图片展示区 -->
border-radius="12" <view class="image-section" :style="{ paddingTop: navTotalHeight + 'px' }">
autoplay <u-icon name="arrow-left" color="#000000" size="24px" @click="back"></u-icon>
interval="3000" <image src="/static/30091712.jpg"></image>
></u-swiper> --> <!-- <AssetGallery
<AssetGallery
:insideImages="asset.images" :insideImages="asset.images"
:vrImage="asset.vrImage" :vrImage="asset.vrImage"
:vrSrc="asset.vr" :vrSrc="asset.vr"
@@ -22,302 +21,414 @@
@vr-click="viewVR" @vr-click="viewVR"
@video-play="playVideo" @video-play="playVideo"
@ad-click="onAdClick" @ad-click="onAdClick"
/> /> -->
</view>
</view> <!-- 资产基本信息 -->
<view class="container">
<view class="basic-info">
<view class="info-header">
<view class="category-tag">{{ asset.category }}</view>
<view class="asset-name">{{ asset.name }}</view>
</view>
<view class="rent-price">¥1500/</view>
<view class="community-info">
<text class="label">所属小区</text>
<text>{{ asset.community }}</text>
</view>
<view class="address-info">
<text class="label">地址</text>
<text>{{ asset.address }}</text>
</view>
<button class="vr-btn" @click="viewVR">查看VR图</button>
</view>
<view class="content"> <!-- 地图位置 -->
<!-- 基本信息 --> <view class="map-container">
<mycard title="资产信息"> <map :latitude="asset.lat" :longitude="asset.lng" :markers="markers"
<view class="info-list"> style="width: 92%; height: 300rpx;"></map>
<u-cell-group> </view>
<u-cell-item title="资产编号" :value="asset.code" :arrow="false"/>
<u-cell-item title="资产类别" :value="asset.category" :arrow="false"/>
<u-cell-item title="资产面积" :value="asset.area + '㎡'" :arrow="false"/>
<u-cell-item title="资产价值" :value="'¥' + formatMoney(asset.value)" :arrow="false"/>
<u-cell-item title="权属单位" :value="asset.owner" :arrow="false"/>
</u-cell-group>
</view>
</mycard>
<!-- 位置信息 --> <!-- 资产信息表格 -->
<mycard title="位置信息" > <view class="asset-info-table">
<view class="map-section"> <view class="table-title">资产信息</view>
<u-cell-group> <view class="table-content">
<u-cell-item title="地址" :value="asset.address" :arrow="false"/> <view class="table-row">
</u-cell-group> <view class="row-item">
<view class="item-label">编号</view>
<view class="item-value">{{ asset.code }}</view>
</view>
<view class="row-item">
<view class="item-label">面积</view>
<view class="item-value">105</view>
</view>
</view>
<view class="table-row">
<view class="row-item">
<view class="item-label">类别</view>
<view class="item-value">{{ asset.category }}</view>
</view>
<view class="row-item">
<view class="item-label">价值</view>
<view class="item-value">¥{{ formatMoney(asset.value) }}</view>
</view>
</view>
<view class="table-row">
<view class="row-item full-width">
<view class="item-label">权属</view>
<view class="item-value">{{ asset.owner }}</view>
</view>
</view>
</view>
</view>
</view>
<map <!-- 预约弹窗 -->
:latitude="asset.lat" <u-popup v-model="showReserve" mode="bottom" border-radius="20">
:longitude="asset.lng" <view class="popup-content">
:markers="markers" <text class="popup-title">预约看房</text>
style="width: 100%; height: 300rpx; border-radius: 12rpx; margin-top: 20rpx;" <u-input v-model="reserveName" placeholder="请输入姓名" />
></map> <u-input v-model="reservePhone" placeholder="请输入电话" />
</view> <u-button type="primary" @click="submitReserve">提交预约</u-button>
</mycard> </view>
</u-popup>
<!-- 备注信息 --> <!-- 底部导航栏 -->
<mycard title="备注信息"> <assetBottomBar v-if="asset.status === 0" :phone="asset.contact" @reserve="showReserve = true" />
<view class="remark"> </view>
{{ asset.remark || '暂无备注信息' }}
</view>
</mycard>
</view>
<!-- 预约弹窗 -->
<u-popup v-model="showReserve" mode="bottom" border-radius="20">
<view class="popup-content">
<text class="popup-title">预约看房</text>
<u-input v-model="reserveName" placeholder="请输入姓名" />
<u-input v-model="reservePhone" placeholder="请输入电话" />
<u-button type="primary" @click="submitReserve">提交预约</u-button>
</view>
</u-popup>
<!-- 底部导航栏 -->
<assetBottomBar v-if ="asset.status === 0" :phone="asset.contact" @reserve="showReserve = true" />
</view>
</template> </template>
<script> <script>
import mycard from '../../components/card/mycard.vue'; import mycard from '../../components/card/mycard.vue';
import assetBottomBar from '../../components/bottom/assetBottomBar.vue'; import assetBottomBar from '../../components/bottom/assetBottomBar.vue';
import AssetGallery from '../../components/gallery/AssetGallery.vue' import AssetGallery from '../../components/gallery/AssetGallery.vue'
export default { export default {
components:{ components: {
mycard, mycard,
assetBottomBar, assetBottomBar,
AssetGallery AssetGallery
}, },
data() { data() {
return { // 静态资产数据
// 控制预约弹窗显示 const staticAsset = {
showReserve: false, name: '',
navTotalHeight: 0, community: '',
// 预约表单数据 code: '',
reserveName: '', category: '',
reservePhone: '', area: 0,
assetId: null, value: 0,
asset: { rent: 0,
name: '', owner: '',
community: '', address: '',
code: '', lat: 0,
category: '', lng: 0,
area: '', images: [],
value: '', vrImage: '',
rent: '', vr: '',
owner: '', videos: [],
address: '', plans: [],
lat: 0, adImage: '',
lng: 0, remark: '',
images: [], isFavorite: false,
remark: '', status: 0,
isFavorite: false, contact: ''
status: 0 };
},
markers: [],
};
},
onLoad(options) {
this.assetId = options.id || 'A001';
this.loadAssetDetail();
// this.recordView();
},
mounted() {
const navbar = this.$refs.navbar;
const navHeight = navbar.navContentHeight; // 直接拿子组件 data
this.navTotalHeight = navHeight; // 加上额外间距
}, return {
methods: { // 控制预约弹窗显示
// 模拟接口请求 showReserve: false,
loadAssetDetail() { navTotalHeight: 0,
setTimeout(() => { // 预约表单数据
console.log("fork数据") reserveName: '',
this.asset = { reservePhone: '',
name: '广州市中心写字楼A栋', assetId: null,
community: '天河国际商务区', // 直接使用静态数据
code: 'GDZC2025001', asset: staticAsset,
category: '商业用房', // 根据静态数据初始化标记
area: 1250.5, markers: [{
value: 28000000, id: 1,
rent: 88000, latitude: staticAsset.lat,
owner: '广州市国资委', longitude: staticAsset.lng,
address: '广州市天河区体育西路88号', title: staticAsset.name,
lat: 23.135, }, ],
lng: 113.327, background: {
images: [ backgroundColor: '#ffffff',
{ // 渐变色
image:'/static/img/index/swiper/swiper3.jpg' // backgroundImage: 'linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);'
} },
};
},
onLoad(options) {
this.assetId = options.id || 'A001';
// 静态数据初始化
this.loadAssetDetail();
// this.recordView();
},
mounted() {
// const navbar = this.$refs.navbar;
// const navHeight = navbar.navContentHeight; // 直接拿子组件 data
// this.navTotalHeight = navHeight; // 加上额外间距
},
methods: {
// 模拟接口请求
loadAssetDetail() {
setTimeout(() => {
console.log("fork数据")
this.asset = {
name: '广州市中心写字楼A栋',
community: '天河国际商务区',
code: 'GDZC2025001',
category: '商业用房',
area: 1250.5,
value: 28000000,
rent: 88000,
owner: '广州市国资委',
address: '广州市天河区体育西路88号',
lat: 23.135,
lng: 113.327,
images: [{
image: '/static/img/index/swiper/swiper3.jpg'
}],
remark: '该资产目前用于办公出租,维护状态良好。',
isFavorite: false,
status: 0
};
this.markers = [{
id: 1,
latitude: this.asset.lat,
longitude: this.asset.lng,
title: this.asset.name,
}, ];
}, 300);
},
formatMoney(num) {
return Number(num).toLocaleString();
},
toggleFavorite() {
this.asset.isFavorite = !this.asset.isFavorite;
uni.showToast({
title: this.asset.isFavorite ? '已收藏' : '取消收藏',
icon: 'success',
});
},
contactManager() {
uni.makePhoneCall({
phoneNumber: '400-123-4567',
});
},
viewVR() {
uni.showToast({
title: '打开卫星图...',
icon: 'none',
});
// 可扩展:跳转到 VR 页面或调用地图 API
},
submitReserve() {
console.log('提交预约看房申请')
this.showReserve = false;
},
recordView(assetId) {
let lifeData = uni.getStorageSync('lifeData');
let token = lifeData.vuex_token
let url = "/assets/viewRecord";
this.$u.get(url, {}, {
'WT': token
}).then(obj => {
], });
remark: '该资产目前用于办公出租,维护状态良好。', },
isFavorite: false, back(){
status: 0 // let pages = getCurrentPages();
}; // let beforePage = pages[pages.length - 2];
this.markers = [
{
id: 1,
latitude: this.asset.lat,
longitude: this.asset.lng,
title: this.asset.name,
},
];
}, 300);
},
formatMoney(num) {
return Number(num).toLocaleString();
},
toggleFavorite() {
this.asset.isFavorite = !this.asset.isFavorite;
uni.showToast({
title: this.asset.isFavorite ? '已收藏' : '取消收藏',
icon: 'success',
});
},
contactManager() {
uni.makePhoneCall({
phoneNumber: '400-123-4567',
});
},
viewVR() {
uni.showToast({
title: '打开卫星图...',
icon: 'none',
});
// 可扩展:跳转到 VR 页面或调用地图 API
},
submitReserve (){
console.log('提交预约看房申请')
this.showReserve = false;
},
recordView(assetId) {
let lifeData = uni.getStorageSync('lifeData');
let token = lifeData.vuex_token
let url = "/assets/viewRecord";
this.$u.get(url, {}, {'WT': token}).then(obj => {
}); uni.navigateBack({
} // delta: 1,
}, success: function() {
}; // beforePage.onLoad(beforePage
// .options); // 执行前一个页面的onLoad方法
}
})
},
},
};
</script> </script>
<style lang="scss" scoped> <style scoped>
.asset-detail { .image-section >>> .u-icon{
background-color: #f7f8fa; position: absolute;
min-height: 100vh; z-index: 99;
padding-bottom: 120rpx; top: 80rpx;
padding-top: 175rpx; /* 给导航栏留空间 */ left: 36rpx;
.top-block { }
background-color: #fff; </style>
border-radius: 16rpx;
margin: 20rpx; <style lang="scss" scoped>
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05); .asset-detail {
background-color: #f7f8fa;
.left-swiper { min-height: 100vh;
width: 45%; padding-bottom: 120rpx;
} padding-top: 0;
/* 不再需要固定的顶部内边距,由动态计算的 navTotalHeight 控制 */
.right-info { }
width: 50%;
padding-left: 20rpx; /* 图片展示区 */
.image-section {
.asset-name { width: 100%;
font-size: 32rpx; background-color: #000;
font-weight: bold; }
color: #333;
margin-bottom: 10rpx; .image-section image {
} width: 100%;
height: 740rpx;
.asset-community { }
font-size: 26rpx;
color: #666; /* 基本信息区 */
margin-bottom: 10rpx; .container {
} width: 100%;
border-radius: 40rpx 40rpx 0rpx 0rpx;
.asset-rent { background-color: #ffffff;
font-size: 26rpx; margin-top: -50rpx;
color: #444; position: relative;
}
.price {
color: #e54d42; .basic-info {
font-weight: bold; padding: 20rpx 30rpx;
margin-left: 4rpx; padding-top: 50rpx;
} }
}
.info-header {
.btn-group { display: flex;
margin-top: 20rpx; align-items: center;
align-self: flex-start; margin-bottom: 10rpx;
} }
}
} .category-tag {
background-color: #FCF2F3;
.content { color: #E9353C;
padding: 20rpx; font-size: 24rpx;
background-color: #f5f6fa; padding: 5rpx 15rpx;
min-height: 100vh; border-radius: 4rpx;
padding-bottom: 140rpx; /* 避免内容被遮住 */ margin-right: 15rpx;
}
.info-list {
padding: 10rpx 20rpx; .asset-name {
background-color: #ffffff; font-size: 32rpx;
border-radius: 12rpx; font-weight: bold;
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05); color: #333;
} flex: 1;
}
.map-section {
padding: 10rpx 20rpx 20rpx; .rent-price {
background-color: #ffffff; font-size: 36rpx;
border-radius: 12rpx; color: #FF2F31;
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05); margin: 15rpx 0;
display: flex; }
flex-direction: column;
.community-info,
map { .address-info {
width: 100%; font-size: 26rpx;
height: 320rpx; color: #666;
border-radius: 12rpx; margin-bottom: 10rpx;
margin-top: 20rpx; display: flex;
overflow: hidden; align-items: center;
} }
}
.label {
.remark { color: #999;
padding: 20rpx; margin-right: 10rpx;
font-size: 28rpx; }
color: #555;
line-height: 1.6; .vr-btn {
background-color: #ffffff; background-color: #F34038;
border-radius: 12rpx; color: #fff;
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05); border: none;
} padding: 0 14rpx;
} border-radius: 6rpx;
font-size: 24rpx;
} margin-top: -90rpx;
.popup-content { float: right;
padding: 40rpx 30rpx; }
background-color: #fff;
border-radius: 20rpx 20rpx 0 0; /* 地图容器 */
} .map-container {
width: 100%;
.popup-title { overflow: hidden;
display: block; display: flex;
font-size: 32rpx; justify-content: center;
font-weight: bold; }
color: #333;
text-align: center; /* 资产信息表格 */
margin-bottom: 30rpx; .asset-info-table {
} padding: 20rpx 30rpx;
margin-bottom: 20rpx;
.u-input { padding-bottom: 100rpx;
margin-bottom: 20rpx; }
}
.table-title {
.u-button { font-size: 30rpx;
margin-top: 20rpx; font-weight: bold;
border-radius: 50rpx; color: #333;
} margin-bottom: 20rpx;
}
.table-content {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.table-row {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
}
.row-item {
flex: 1;
min-width: 45%;
display: flex;
flex-direction: column;
gap: 5rpx;
}
.row-item.full-width {
min-width: 100%;
}
.item-label {
font-size: 24rpx;
color: #999;
}
.item-value {
font-size: 28rpx;
color: #333;
font-weight: 500;
}
/* 预约弹窗 */
.popup-content {
padding: 40rpx 30rpx;
background-color: #fff;
border-radius: 20rpx 20rpx 0 0;
}
.popup-title {
display: block;
font-size: 32rpx;
font-weight: bold;
color: #333;
text-align: center;
margin-bottom: 30rpx;
}
.u-input {
margin-bottom: 20rpx;
}
.u-button {
margin-top: 20rpx;
border-radius: 50rpx;
}
</style> </style>

File diff suppressed because it is too large Load Diff

View File

@@ -1,159 +1,306 @@
<template> <template>
<view class="search-list-page"> <view class="search-list-page">
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<customNavbar title="资产列表" /> <!-- <customNavbar title="搜索资产" /> -->
<u-sticky offset-top="0"> <u-navbar title="搜索资产" :autoBack="true" :background="background" title-color="#2D2B2C" back-icon-color="#2D2B2C">
<view class="sticky"> </u-navbar>
<filterDropdown :menuTop="0" :filterData="filterData" :defaultSelected="defaultSelected" :updateMenuName="true" @confirm="confirm" dataFormat="Object"></filterDropdown> <view class="search-list-content">
</view> <!-- 筛选标签栏 -->
</u-sticky> <view class="filter-dropdown-wrapper">
<view class="u-p-l-10 u-p-r-10 waterfall"> <u-sticky offset-top="0">
<u-waterfall v-model="flowList" ref="uWaterfall"> <view class="sticky" style="width: 100vw;">
<template v-slot:left="{leftList}"> <filterDropdown :menuTop="0" :filterData="filterData" :defaultSelected="defaultSelected"
<view class="demo-warter" v-for="(item, index) in leftList" :key="index"> :updateMenuName="true" @confirm="confirm" dataFormat="Object"></filterDropdown>
<u-lazy-load threshold="750" border-radius="12" :image="item.coverImgUrl" :index="index" </view>
@click="clickImage(item.id)"></u-lazy-load> </u-sticky>
<view class="item-title">{{item.name}}</view> </view>
<view class="item-desc">{{ item.footPrint}}</view> <!-- 搜索栏 -->
<view class="item-price">¥{{item.rentFee}}</view> <view class="search-bar-wrapper">
</view> <view class="search-bar">
</template> <view class="city-select">杭州 <text class="icon-down"></text></view>
<template v-slot:right="{rightList}"> <view class="search-input">
<view class="demo-warter" v-for="(item, index) in rightList" :key="index"> <text class="icon-search"></text>
<u-lazy-load threshold="750" border-radius="10" :image="item.coverImgUrl" :index="index" <input type="text" placeholder="请输入小区名称" />
@click="clickImage(item.id)"></u-lazy-load> </view>
<view class="item-title">{{item.name}}</view> </view>
<view class="item-desc">{{ item.footPrint}}</view> </view>
<view class="item-price">¥{{item.rentFee}}</view> <!-- 标签组 -->
</view> <view class="tag-group">
</template> <view class="tag-item" :class="{ active: selectedTags.includes(tag) }"
</u-waterfall> v-for="(tag, index) in tagGroupList" :key="index" @click="onTagClick(tag)">
<u-loadmore bg-color="rgb(240, 240, 240)" :status="loadStatus" @loadmore="findHouseList" style="height: 80rpx;line-height: 80rpx;"></u-loadmore> {{ tag }}
<u-back-top :scroll-top="scrollTop" top="1000"></u-back-top> </view>
<u-no-network></u-no-network> </view>
</view> </view>
</view>
<view class="u-p-l-10 u-p-r-10 waterfall">
<u-waterfall v-model="flowList" ref="uWaterfall">
<template v-slot:left="{ leftList }">
<view class="demo-warter" v-for="(item, index) in leftList" :key="index">
<u-lazy-load threshold="750" border-radius="8" :image="item.coverImgUrl" :index="index"
@click="clickImage(item.id)" mode="aspectFill"></u-lazy-load>
<view class="item-title">{{ item.name }}</view>
<view class="item-desc">{{ item.houseType }} {{ item.footPrint }} {{ item.orientation }}</view>
<view class="item-tags">
<view class="tag" v-for="(tag, tagIndex) in item.tags" :key="tagIndex">{{ tag }}</view>
</view>
<view class="item-price">¥{{ item.rentFee }}/<text></text></view>
</view>
</template>
<template v-slot:right="{ rightList }">
<view class="demo-warter" v-for="(item, index) in rightList" :key="index">
<u-lazy-load threshold="750" border-radius="8" :image="item.coverImgUrl" :index="index"
@click="clickImage(item.id)" mode="aspectFill"></u-lazy-load>
<view class="item-title">{{ item.name }}</view>
<view class="item-desc">{{ item.houseType }} {{ item.footPrint }} {{ item.orientation }}</view>
<view class="item-tags">
<view class="tag" v-for="(tag, tagIndex) in item.tags" :key="tagIndex">{{ tag }}</view>
</view>
<view class="item-price">¥{{ item.rentFee }}/<text></text></view>
</view>
</template>
</u-waterfall>
<u-loadmore bg-color="rgb(240, 240, 240)" :status="loadStatus" @loadmore="findHouseList"
style="height: 80rpx;line-height: 80rpx;"></u-loadmore>
<u-back-top :scroll-top="scrollTop" top="1000"></u-back-top>
<u-no-network></u-no-network>
</view>
</view>
</template> </template>
<script> <script>
import config from "@/common/config.js" // 全局配置文件 import config from "@/common/config.js" // 全局配置文件
import searchData from '@/common/utils/searchData.js';//筛选菜单数据 import searchData from '@/common/utils/searchData.js'; //筛选菜单数据
import filterDropdown from '@/components/zy/filterDropdown.vue'; import filterDropdown from '@/components/zy/filterDropdown.vue';
export default { export default {
components: { components: {
filterDropdown filterDropdown
}, },
data() { data() {
return { return {
indexArr: [], indexArr: [],
valueArr: [], valueArr: [],
defaultSelected: [], defaultSelected: [],
filterData: [], filterData: [],
searchData:{}, searchData: {},
pageNum: 1, pageNum: 1,
pageSize: 20, pageSize: 20,
scrollTop: 0, scrollTop: 0,
houseList: [], houseList: [],
loadStatus: 'loadmore', loadStatus: 'loadmore',
flowList: [], flowList: [],
} // 标签组数据和选中状态
}, tagGroupList: ['全套家具', '配套齐全', '优选好房', '生活便利'],
onLoad(option) { selectedTags: [],
background: {
// 渐变色
backgroundImage: 'linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);'
},
}
},
onLoad(option) {
let type = option.type let type = option.type
let villageName = option.villageName let villageName = option.villageName
this.searchData = {} this.searchData = {}
if(type){ if (type) {
this.searchData.type = type this.searchData.type = type
} }
if(villageName){ if (villageName) {
this.searchData.villageName = villageName this.searchData.villageName = villageName
} }
// 获取房源数据 // 获取房源数据
this.findHouseList(); this.findHouseList();
// 获取小区数据 // 获取小区数据
this.findVillageList() this.findVillageList()
}, },
onPageScroll(e) { onPageScroll(e) {
this.scrollTop = e.scrollTop; this.scrollTop = e.scrollTop;
}, },
onReachBottom() { onReachBottom() {
this.loadStatus = 'loading'; this.loadStatus = 'loading';
// 获取数据 // 获取数据
this.findHouseList() this.findHouseList()
}, },
// 下拉刷新 // 下拉刷新
onPullDownRefresh() { onPullDownRefresh() {
this.pageNum = 1 this.pageNum = 1
this.flowList = [] this.flowList = []
this.$refs.uWaterfall.clear(); this.$refs.uWaterfall.clear();
// 获取数据 // 获取数据
this.findHouseList(); this.findHouseList();
// 关闭刷新 // 关闭刷新
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, },
methods: { methods: {
findHouseList(type = 0) { // 标签点击事件
if(type == 1){ onTagClick(tag) {
this.pageNum = 1 // 检查标签是否已选中
this.flowList = [] const isSelected = this.selectedTags.includes(tag);
this.$refs.uWaterfall.clear(); if (isSelected) {
} // 如果已选中,则移除
let url = "/assets/findAssetList"; this.selectedTags = this.selectedTags.filter(item => item !== tag);
this.$u.post(url, { } else {
state:1, // 如果未选中,则添加
villageCity:uni.getStorageSync('lifeData').vuex_city, this.selectedTags.push(tag);
pageNum: this.pageNum, }
pageSize: this.pageSize, // 这里可以添加根据标签筛选数据的逻辑
orderByColumn: 'update_time,create_time', console.log('标签点击:', tag);
isAsc: 'desc' console.log('当前选中的标签:', this.selectedTags);
}).then(result => { // 可以调用findHouseList方法重新加载数据根据选中的标签进行筛选
const data = result.data.result; // this.pageNum = 1;
if(this.pageNum>1 && data.length < this.pageSize){ // this.flowList = [];
// return this.loadStatus = 'nomore'; // this.findHouseList(1);
} },
this.houseList = data;
for (let i = 0; i < this.houseList.length; i++) { findHouseList(type = 0) {
// 先转成字符串再转成对象,避免数组对象引用导致数据混乱 if (type == 1) {
let item = this.houseList[i] this.pageNum = 1
// if(!item.faceUrl.includes(config.staticUrl)){ this.flowList = []
// item.image = config.staticUrl+item.faceUrl this.$refs.uWaterfall.clear();
// }else{ }
// item.image = item.faceUrl // 隐藏接口请求,使用前端写死的测试数据
// } // let url = "/assets/findAssetList";
this.flowList.push(item); // this.$u.post(url, {
} // state:1,
++ this.pageNum // villageCity:uni.getStorageSync('lifeData').vuex_city,
this.loadStatus = 'loadmore'; // pageNum: this.pageNum,
}).catch(err => { // pageSize: this.pageSize,
console.log("失败:", err) // orderByColumn: 'update_time,create_time',
}) // isAsc: 'desc'
}, // }).then(result => {
findVillageList() { // const data = result.data.result;
let url = "/api/houseApi/findVillageList";
this.$u.get(url,{ // 前端写死的测试数据
city:uni.getStorageSync('lifeData').vuex_city, const data = [{
orderByColumn: 'name', id: 1,
isAsc: 'desc' name: '景秀天成保租房景秀天成保租房',
}).then(result => { footPrint: 105,
const data = result.rows rentFee: 1500,
for (let i = 0; i < data.length; i++) { coverImgUrl: '/static/img/index/swiper/swiper3.jpg',
// 先转成字符串再转成对象,避免数组对象引用导致数据混乱 houseType: '3室2厅',
let item = data[i] orientation: '南',
searchData[0].submenu.push({ tags: ['全套家具', '全套家电']
name: item.name, },
value: item.name {
}) id: 2,
name: '景秀天成保租房景秀天成保租房',
footPrint: 105,
rentFee: 1500,
coverImgUrl: '/static/img/index/swiper/swiper3.jpg',
houseType: '3室2厅',
orientation: '南',
tags: ['全套家具', '全套家电']
},
{
id: 3,
name: '景秀天成保租房景秀天成保租房',
footPrint: 105,
rentFee: 1500,
coverImgUrl: '/static/img/index/swiper/swiper3.jpg',
houseType: '3室2厅',
orientation: '南',
tags: ['全套家具', '全套家电']
},
{
id: 4,
name: '景秀天成保租房景秀天成保租房',
footPrint: 105,
rentFee: 1500,
coverImgUrl: '/static/img/index/swiper/swiper3.jpg',
houseType: '3室2厅',
orientation: '南',
tags: ['全套家具', '全套家电']
},
{
id: 5,
name: '景秀天成保租房景秀天成保租房',
footPrint: 105,
rentFee: 1500,
coverImgUrl: '/static/img/index/swiper/swiper3.jpg',
houseType: '3室2厅',
orientation: '南',
tags: ['全套家具', '全套家电']
},
{
id: 6,
name: '景秀天成保租房景秀天成保租房',
footPrint: 105,
rentFee: 1500,
coverImgUrl: '/static/img/index/swiper/swiper3.jpg',
houseType: '3室2厅',
orientation: '南',
tags: ['全套家具', '全套家电']
} }
this.filterData = searchData; ];
}); if (this.pageNum > 1 && data.length < this.pageSize) {
// return this.loadStatus = 'nomore';
}
this.houseList = data;
for (let i = 0; i < this.houseList.length; i++) {
// 先转成字符串再转成对象,避免数组对象引用导致数据混乱
let item = this.houseList[i]
this.flowList.push(item);
}
++this.pageNum
this.loadStatus = 'loadmore';
// }).catch(err => {
// console.log("失败:", err)
// })
},
findVillageList() {
// 隐藏接口请求,使用前端写死的测试数据
// let url = "/api/houseApi/findVillageList";
// this.$u.get(url,{
// city:uni.getStorageSync('lifeData').vuex_city,
// orderByColumn: 'name',
// isAsc: 'desc'
// }).then(result => {
// const data = result.rows
// for (let i = 0; i < data.length; i++) {
// // 先转成字符串再转成对象,避免数组对象引用导致数据混乱
// let item = data[i]
// searchData[0].submenu.push({
// name: item.name,
// value: item.name
// })
// }
// this.filterData = searchData;
// });
// 前端写死的测试小区数据
const villageData = [{
name: '景秀天成'
},
{
name: '锦绣花园'
},
{
name: '阳光小区'
},
{
name: '幸福家园'
},
{
name: '碧水湾'
}
];
// 添加测试小区数据到筛选菜单
for (let i = 0; i < villageData.length; i++) {
searchData[0].submenu.push({
name: villageData[i].name,
value: villageData[i].name
});
}
this.filterData = searchData;
}, },
clickImage(houseId) { clickImage(houseId) {
this.$u.route({ this.$u.route({
url: '/pages/detail/detail', url: '/pages/detail/detail',
params: { params: {
houseId: houseId houseId: houseId
} }
}) })
}, },
//接收菜单结果 //接收菜单结果
confirm(e) { confirm(e) {
@@ -165,22 +312,22 @@
let decoration = combo[1] let decoration = combo[1]
let feature = combo[2] let feature = combo[2]
this.searchData = {} this.searchData = {}
if(type){ if (type) {
this.searchData.type = type this.searchData.type = type
} }
if(villageName){ if (villageName) {
this.searchData.villageName = villageName this.searchData.villageName = villageName
} }
if(price){ if (price) {
this.searchData.price = price this.searchData.price = price
} }
if(houseNum && houseNum.length>0){ if (houseNum && houseNum.length > 0) {
this.searchData.houseNum = houseNum.toString() this.searchData.houseNum = houseNum.toString()
} }
if(decoration && decoration.length>0){ if (decoration && decoration.length > 0) {
this.searchData.decoration = decoration.toString() this.searchData.decoration = decoration.toString()
} }
if(feature && feature.length>0){ if (feature && feature.length > 0) {
this.searchData.feature = feature.toString() this.searchData.feature = feature.toString()
} }
this.pageNum = 1 this.pageNum = 1
@@ -189,93 +336,215 @@
this.$refs.uWaterfall.clear(); this.$refs.uWaterfall.clear();
this.findHouseList() this.findHouseList()
}, },
code(){ code() {
this.$mytip.toast('请咨询技术支持') this.$mytip.toast('请咨询技术支持')
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.search-list-page{ .search-list-page {
padding-top: 175rpx; background-color: #f5f5f5;
} }
.waterfall{
// padding-top: 85rpx; .search-list-content {
// padding-top: 20rpx;
background: linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);
border-radius: 0rpx;
padding-bottom: 20rpx;
}
// 搜索栏样式
.search-bar-wrapper {
padding: 10rpx 20rpx;
}
.search-bar {
display: flex;
background-color: #fff;
align-items: center;
border-radius: 10rpx;
padding: 20rpx 30rpx;
}
.city-select {
margin-right: 20rpx;
font-size: 28rpx;
color: #333;
}
.icon-down {
display: inline-block;
width: 0;
height: 0;
border-left: 8rpx solid transparent;
border-right: 8rpx solid transparent;
border-top: 8rpx solid #666;
margin-left: 5rpx;
vertical-align: middle;
}
.search-input {
flex: 1;
display: flex;
align-items: center;
}
.icon-search {
margin-right: 10rpx;
color: #999;
font-size: 28rpx;
}
.search-input input {
flex: 1;
font-size: 28rpx;
border: none;
background: transparent;
outline: none;
}
.filter-dropdown-wrapper {
// padding: 0 20rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
// 标签组样式
.tag-group {
padding: 15rpx 20rpx;
display: flex;
flex-wrap: wrap;
gap: 15rpx;
border-bottom: 1rpx solid #eee;
margin-top: 20rpx;
}
.tag-item {
padding: 5rpx 10rpx;
border-radius: 6rpx;
font-size: 24rpx;
color: #723324;
transition: all 0.3s ease;
border: 1px solid #DBB39D;
}
.tag-item.active {
background-color: #FCF2F3;
border: 1px solid #ffffff;
}
.waterfall {
padding-top: 20rpx;
background-color: #ffffff;
} }
.nomore { .nomore {
background-color: $u-bg-color; background-color: $u-bg-color;
} }
.search{ .search {
width: 54px; width: 54px;
height: 44px; height: 44px;
&:active{ &:active {
background-color: $u-bg-color; background-color: $u-bg-color;
} }
} }
.rowClass{ .rowClass {
border-radius: 8px; border-radius: 8px;
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
margin-top: 10rpx; margin-top: 10rpx;
} }
.hoverClass{ .hoverClass {
background-color: #E4E7ED; background-color: #E4E7ED;
} }
.tabName{ .tabName {
font-size: 28rpx; font-size: 28rpx;
color: $u-main-color; color: $u-main-color;
} }
.demo-warter { .demo-warter {
border-radius: 8px; border-radius: 8px;
margin-top: 3px; margin-top: 15rpx;
background-color: #ffffff; margin-right: 10rpx;
padding: 3px; margin-left: 10rpx;
position: relative; background-color: #ffffff;
padding: 0rpx;
position: relative;
overflow: hidden;
} }
.u-close { .u-close {
position: absolute; position: absolute;
top: 20rpx; top: 20rpx;
right: 20rpx; right: 20rpx;
}
// 图片样式
.u-lazy-load {
width: 100%;
height: 300rpx;
} }
.item-cover { .item-cover {
font-size: 55rpx; font-size: 55rpx;
color: $u-type-warning; color: $u-type-warning;
} }
.item-title { .item-title {
font-size: 28rpx; font-size: 28rpx;
color: $u-main-color; color: #333;
font-weight: bold; font-weight: 600;
padding-top: 5rpx; padding: 12rpx 15rpx 8rpx 15rpx;
padding-left: 10rpx; line-height: 40rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
} }
.item-price { .item-price {
font-weight: normal; font-size: 32rpx;
font-size: 32rpx; color: #FF2F31;
color: $u-type-warning; padding: 0 15rpx 15rpx 15rpx;
}
.item-price text {
font-size: 24rpx;
} }
.item-desc { .item-desc {
font-weight: normal; font-weight: normal;
font-size: 26rpx; font-size: 24rpx;
color: $u-tips-color; color: #999;
padding-bottom: 5rpx; padding: 0 15rpx 8rpx 15rpx;
padding-left: 10rpx; }
// 标签样式
.item-tags {
display: flex;
flex-wrap: wrap;
padding: 0 15rpx 12rpx 15rpx;
gap: 10rpx;
}
.tag {
padding: 4rpx 12rpx;
background-color: #f5f5f5;
border-radius: 12rpx;
font-size: 22rpx;
color: #666;
} }
.item-tag { .item-tag {
font-size: 24rpx; font-size: 24rpx;
color: $u-tips-color; color: $u-tips-color;
margin-top: 3px; margin-top: 3px;
} }
</style> </style>