Compare commits
2 Commits
964e4f9c33
...
dac2ae956d
| Author | SHA1 | Date | |
|---|---|---|---|
| dac2ae956d | |||
| d5953d219f |
@@ -1,17 +1,35 @@
|
||||
<template>
|
||||
<view
|
||||
class="custom-navbar"
|
||||
:style="{ paddingTop: statusBarHeight + 'px', height: navHeight + 'px' }"
|
||||
:class="{ 'transparent': isTransparent, 'opaque': !isTransparent }"
|
||||
:style="{
|
||||
paddingTop: statusBarHeight + 'px',
|
||||
height: navHeight + 'px',
|
||||
// 使用rgba颜色值控制背景透明度,而不是整个元素的opacity
|
||||
backgroundColor: `rgba(${hexToRgb(bgColor)}, ${opacity})`
|
||||
}"
|
||||
>
|
||||
<view class="nav-content">
|
||||
<!-- 左侧返回 -->
|
||||
<view class="nav-left">
|
||||
<u-icon name="arrow-left" size="44" color="#333" @click="onBack" v-if="showBack"></u-icon>
|
||||
<u-icon name="home" size="44" color="#333" @click="goHome" v-if="showHome"></u-icon>
|
||||
<u-icon
|
||||
name="arrow-left"
|
||||
size="44"
|
||||
:color="textColor"
|
||||
@click="onBack"
|
||||
v-if="showBack"
|
||||
></u-icon>
|
||||
<u-icon
|
||||
name="home"
|
||||
size="44"
|
||||
:color="textColor"
|
||||
@click="goHome"
|
||||
v-if="showHome"
|
||||
></u-icon>
|
||||
</view>
|
||||
|
||||
<!-- 中间标题 -->
|
||||
<view class="nav-title">{{ title }}</view>
|
||||
<view class="nav-title" :style="{ color: textColor }">{{ title }}</view>
|
||||
|
||||
<!-- 右侧按钮(位于胶囊左侧) -->
|
||||
<view
|
||||
@@ -26,10 +44,18 @@
|
||||
>
|
||||
<u-icon
|
||||
:name="btn.icon"
|
||||
:color="btn.color || '#333'"
|
||||
:color="btn.color || textColor"
|
||||
:size="btn.size || 40"
|
||||
></u-icon>
|
||||
</view>
|
||||
<!-- 额外的右侧图标 -->
|
||||
<view class="nav-btn" v-for="(icon, index) in extraIcons" :key="index" @click="onExtraIconClick(index)">
|
||||
<u-icon
|
||||
:name="icon"
|
||||
:color="textColor"
|
||||
size="40"
|
||||
></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -50,15 +76,38 @@ export default {
|
||||
back: {
|
||||
type: Function,
|
||||
default: null,
|
||||
},
|
||||
// 导航栏样式控制
|
||||
isTransparent: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
showBack: {
|
||||
type: Boolean,
|
||||
default: true // 左侧返回按钮默认显示
|
||||
},
|
||||
showHome: {
|
||||
type: Boolean,
|
||||
default: true // 回首页按钮默认显示
|
||||
}
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: '#ffffff'
|
||||
},
|
||||
textColor: {
|
||||
type: String,
|
||||
default: '#333333'
|
||||
},
|
||||
opacity: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
extraIcons: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
|
||||
// 按钮显示控制
|
||||
showBack: {
|
||||
type: Boolean,
|
||||
default: true // 左侧返回按钮默认显示
|
||||
},
|
||||
showHome: {
|
||||
type: Boolean,
|
||||
default: false // 回首页按钮默认不显示
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -87,6 +136,24 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 十六进制颜色转RGB
|
||||
hexToRgb(hex) {
|
||||
// 移除#号
|
||||
hex = hex.replace(/^#/, '');
|
||||
|
||||
// 处理缩写形式(如#RGB)
|
||||
if (hex.length === 3) {
|
||||
hex = hex.split('').map(char => char + char).join('');
|
||||
}
|
||||
|
||||
// 解析RGB值
|
||||
const r = parseInt(hex.substring(0, 2), 16);
|
||||
const g = parseInt(hex.substring(2, 4), 16);
|
||||
const b = parseInt(hex.substring(4, 6), 16);
|
||||
|
||||
return `${r}, ${g}, ${b}`;
|
||||
},
|
||||
|
||||
onBack() {
|
||||
if (this.back) {
|
||||
this.back();
|
||||
@@ -95,9 +162,13 @@ export default {
|
||||
}
|
||||
},
|
||||
goHome(){
|
||||
uni.reLaunch({
|
||||
uni.reLaunch({
|
||||
url:'../index/index'
|
||||
})
|
||||
},
|
||||
onExtraIconClick(index) {
|
||||
// 额外图标点击事件,可通过事件冒泡传递给父组件
|
||||
this.$emit('extra-icon-click', index);
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -109,9 +180,8 @@ export default {
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.08);
|
||||
z-index: 999;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
.nav-content {
|
||||
display: flex;
|
||||
@@ -131,8 +201,6 @@ export default {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.nav-right {
|
||||
@@ -142,5 +210,15 @@ export default {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
// 透明状态样式
|
||||
&.transparent {
|
||||
background-color: rgba(255, 255, 255, 0);
|
||||
}
|
||||
|
||||
// 不透明状态样式
|
||||
&.opaque {
|
||||
box-shadow: 0 2rpx 6rpx rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -544,23 +544,23 @@
|
||||
height: 44px;
|
||||
border-bottom: solid 1rpx #eee;
|
||||
z-index: 12;
|
||||
background-color: #ffffff;
|
||||
background: linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);
|
||||
flex-direction: row;
|
||||
|
||||
.first-menu {
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
color: #757575;
|
||||
color: #000000;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: color .2s linear;
|
||||
|
||||
&.on {
|
||||
color: #2979ff;
|
||||
color: #f44336;
|
||||
|
||||
.iconfont {
|
||||
color: #2979ff;
|
||||
color: #f44336;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -585,6 +585,7 @@
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
margin-top: -2px;
|
||||
transform: translate3d(0, - 100%, 0);
|
||||
max-height: 345px;
|
||||
background-color: #ffffff;
|
||||
@@ -624,7 +625,7 @@
|
||||
> .iconfont {
|
||||
display: none;
|
||||
font-size: 18px;
|
||||
color: #2979ff;
|
||||
color: #f44336;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -654,7 +655,7 @@
|
||||
border-bottom: solid 1rpx #e5e5e5;
|
||||
|
||||
&.on {
|
||||
color: #2979ff;
|
||||
color: #f44336;
|
||||
|
||||
> .menu-name {
|
||||
> .iconfont {
|
||||
@@ -677,12 +678,12 @@
|
||||
> .iconfont {
|
||||
display: none;
|
||||
font-size: 18px;
|
||||
color: #2979ff;
|
||||
color: #f44336;
|
||||
}
|
||||
}
|
||||
|
||||
&.on {
|
||||
color: #2979ff;
|
||||
color: #f44336;
|
||||
|
||||
> .menu-name {
|
||||
> .iconfont {
|
||||
@@ -716,7 +717,7 @@
|
||||
|
||||
&.on {
|
||||
border-color: #f6c8ac;
|
||||
color: #2979ff;
|
||||
color: #f44336;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
@@ -757,8 +758,8 @@
|
||||
flex-wrap: wrap;
|
||||
|
||||
.on {
|
||||
border-color: #2979ff;
|
||||
background-color: #2979ff;
|
||||
border-color: #f44336;
|
||||
background-color: #f44336;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -794,18 +795,18 @@
|
||||
width: 320rpx;
|
||||
height: 42px;
|
||||
border-radius: 42px;
|
||||
border: 2rpx solid #2979ff;
|
||||
border: 2rpx solid #f44336;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.reset {
|
||||
color:#2979ff;
|
||||
color:#f44336;
|
||||
}
|
||||
|
||||
.submit {
|
||||
color: #fff;
|
||||
background-color: #2979ff;
|
||||
background-color: #f44336;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
<template>
|
||||
<view class="asset-detail">
|
||||
<!-- 顶部导航栏 -->
|
||||
<customNavbar
|
||||
title="不动资产详情" ref="navbar"/>
|
||||
<!-- 顶部信息块 -->
|
||||
<view :style="{ paddingTop: navTotalHeight + 'px' }">
|
||||
<!-- <u-swiper
|
||||
:list="asset.images"
|
||||
height="220"
|
||||
border-radius="12"
|
||||
autoplay
|
||||
interval="3000"
|
||||
></u-swiper> -->
|
||||
<AssetGallery
|
||||
<view class="asset-detail">
|
||||
<!-- 顶部导航栏 -->
|
||||
<customNavbar
|
||||
title="资产详情"
|
||||
ref="navbar"
|
||||
:is-transparent="navbarStyle.isTransparent"
|
||||
:bg-color="navbarStyle.bgColor"
|
||||
:text-color="navbarStyle.textColor"
|
||||
:opacity="navbarStyle.opacity"
|
||||
:extra-icons="navbarStyle.extraIcons"
|
||||
:show-home="false"
|
||||
/>
|
||||
|
||||
<!-- 图片展示区 -->
|
||||
<view class="image-section" :style="{ paddingTop: navTotalHeight + 'px' }">
|
||||
<image src="/static/30091712.jpg"></image>
|
||||
<!-- <AssetGallery
|
||||
:insideImages="asset.images"
|
||||
:vrImage="asset.vrImage"
|
||||
:vrSrc="asset.vr"
|
||||
@@ -22,302 +25,434 @@
|
||||
@vr-click="viewVR"
|
||||
@video-play="playVideo"
|
||||
@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">
|
||||
<!-- 基本信息 -->
|
||||
<mycard title="资产信息">
|
||||
<view class="info-list">
|
||||
<u-cell-group>
|
||||
<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>
|
||||
<!-- 地图位置 -->
|
||||
<view class="map-container">
|
||||
<map :latitude="asset.lat" :longitude="asset.lng" :markers="markers"
|
||||
style="width: 92%; height: 300rpx;"></map>
|
||||
</view>
|
||||
|
||||
<!-- 位置信息 -->
|
||||
<mycard title="位置信息" >
|
||||
<view class="map-section">
|
||||
<u-cell-group>
|
||||
<u-cell-item title="地址" :value="asset.address" :arrow="false"/>
|
||||
</u-cell-group>
|
||||
<!-- 资产信息表格 -->
|
||||
<view class="asset-info-table">
|
||||
<view class="table-title">资产信息</view>
|
||||
<view class="table-content">
|
||||
<view class="table-row">
|
||||
<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"
|
||||
:longitude="asset.lng"
|
||||
:markers="markers"
|
||||
style="width: 100%; height: 300rpx; border-radius: 12rpx; margin-top: 20rpx;"
|
||||
></map>
|
||||
</view>
|
||||
</mycard>
|
||||
<!-- 预约弹窗 -->
|
||||
<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>
|
||||
|
||||
<!-- 备注信息 -->
|
||||
<mycard title="备注信息">
|
||||
<view class="remark">
|
||||
{{ 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>
|
||||
<!-- 底部导航栏 -->
|
||||
<assetBottomBar v-if="asset.status === 0" :phone="asset.contact" @reserve="showReserve = true" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mycard from '../../components/card/mycard.vue';
|
||||
import assetBottomBar from '../../components/bottom/assetBottomBar.vue';
|
||||
import AssetGallery from '../../components/gallery/AssetGallery.vue'
|
||||
export default {
|
||||
components:{
|
||||
mycard,
|
||||
assetBottomBar,
|
||||
AssetGallery
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 控制预约弹窗显示
|
||||
showReserve: false,
|
||||
navTotalHeight: 0,
|
||||
// 预约表单数据
|
||||
reserveName: '',
|
||||
reservePhone: '',
|
||||
assetId: null,
|
||||
asset: {
|
||||
name: '',
|
||||
community: '',
|
||||
code: '',
|
||||
category: '',
|
||||
area: '',
|
||||
value: '',
|
||||
rent: '',
|
||||
owner: '',
|
||||
address: '',
|
||||
lat: 0,
|
||||
lng: 0,
|
||||
images: [],
|
||||
remark: '',
|
||||
isFavorite: false,
|
||||
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; // 加上额外间距
|
||||
|
||||
},
|
||||
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 => {
|
||||
import mycard from '../../components/card/mycard.vue';
|
||||
import assetBottomBar from '../../components/bottom/assetBottomBar.vue';
|
||||
import AssetGallery from '../../components/gallery/AssetGallery.vue'
|
||||
export default {
|
||||
components: {
|
||||
mycard,
|
||||
assetBottomBar,
|
||||
AssetGallery
|
||||
},
|
||||
data() {
|
||||
// 静态资产数据
|
||||
const staticAsset = {
|
||||
name: '',
|
||||
community: '',
|
||||
code: '',
|
||||
category: '',
|
||||
area: 0,
|
||||
value: 0,
|
||||
rent: 0,
|
||||
owner: '',
|
||||
address: '',
|
||||
lat: 0,
|
||||
lng: 0,
|
||||
images: [],
|
||||
vrImage: '',
|
||||
vr: '',
|
||||
videos: [],
|
||||
plans: [],
|
||||
adImage: '',
|
||||
remark: '',
|
||||
isFavorite: false,
|
||||
status: 0,
|
||||
contact: ''
|
||||
};
|
||||
|
||||
return {
|
||||
// 控制预约弹窗显示
|
||||
showReserve: false,
|
||||
navTotalHeight: 0,
|
||||
// 预约表单数据
|
||||
reserveName: '',
|
||||
reservePhone: '',
|
||||
assetId: null,
|
||||
// 直接使用静态数据
|
||||
asset: staticAsset,
|
||||
// 根据静态数据初始化标记
|
||||
markers: [{
|
||||
id: 1,
|
||||
latitude: staticAsset.lat,
|
||||
longitude: staticAsset.lng,
|
||||
title: staticAsset.name,
|
||||
}, ],
|
||||
background: {
|
||||
backgroundColor: '#ffffff',
|
||||
// 渐变色
|
||||
// backgroundImage: 'linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);'
|
||||
},
|
||||
|
||||
// 导航栏样式控制
|
||||
navbarStyle: {
|
||||
isTransparent: true,
|
||||
bgColor: '#ffffff',
|
||||
textColor: '#000000',
|
||||
opacity: 0,
|
||||
extraIcons: ['ellipsis', 'eye'] // 右侧额外图标
|
||||
},
|
||||
|
||||
// 滚动距离
|
||||
scrollTop: 0
|
||||
};
|
||||
},
|
||||
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; // 加上额外间距
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
// 计算导航栏透明度和样式
|
||||
this.updateNavbarStyle(e.scrollTop);
|
||||
},
|
||||
methods: {
|
||||
// 根据滚动距离更新导航栏样式
|
||||
updateNavbarStyle(scrollTop) {
|
||||
// 定义滚动阈值,超过此值导航栏变为不透明
|
||||
const threshold = 200;
|
||||
|
||||
// 计算透明度
|
||||
let opacity = scrollTop / threshold;
|
||||
opacity = Math.min(opacity, 1);
|
||||
opacity = Math.max(opacity, 0);
|
||||
|
||||
// 更新导航栏样式
|
||||
this.navbarStyle.opacity = opacity;
|
||||
|
||||
if (opacity > 0.5) {
|
||||
this.navbarStyle.isTransparent = false;
|
||||
} else {
|
||||
this.navbarStyle.isTransparent = true;
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
// 模拟接口请求
|
||||
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 => {
|
||||
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.asset-detail {
|
||||
background-color: #f7f8fa;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 120rpx;
|
||||
padding-top: 175rpx; /* 给导航栏留空间 */
|
||||
.top-block {
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
margin: 20rpx;
|
||||
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
.asset-detail {
|
||||
background-color: #f7f8fa;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 120rpx;
|
||||
padding-top: 0;
|
||||
/* 不再需要固定的顶部内边距,由动态计算的 navTotalHeight 控制 */
|
||||
}
|
||||
|
||||
.left-swiper {
|
||||
width: 45%;
|
||||
}
|
||||
/* 图片展示区 */
|
||||
.image-section {
|
||||
width: 100%;
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
.right-info {
|
||||
width: 50%;
|
||||
padding-left: 20rpx;
|
||||
.image-section image {
|
||||
width: 100%;
|
||||
height: 740rpx;
|
||||
}
|
||||
|
||||
.asset-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
/* 基本信息区 */
|
||||
.container {
|
||||
width: 100%;
|
||||
border-radius: 40rpx 40rpx 0rpx 0rpx;
|
||||
background-color: #ffffff;
|
||||
margin-top: -50rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.asset-community {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.basic-info {
|
||||
padding: 20rpx 30rpx;
|
||||
padding-top: 50rpx;
|
||||
}
|
||||
|
||||
.asset-rent {
|
||||
font-size: 26rpx;
|
||||
color: #444;
|
||||
.info-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #e54d42;
|
||||
font-weight: bold;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
}
|
||||
.category-tag {
|
||||
background-color: #FCF2F3;
|
||||
color: #E9353C;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 15rpx;
|
||||
border-radius: 4rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
margin-top: 20rpx;
|
||||
align-self: flex-start;
|
||||
}
|
||||
}
|
||||
}
|
||||
.asset-name {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 20rpx;
|
||||
background-color: #f5f6fa;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 140rpx; /* 避免内容被遮住 */
|
||||
.rent-price {
|
||||
font-size: 36rpx;
|
||||
color: #FF2F31;
|
||||
margin: 15rpx 0;
|
||||
}
|
||||
|
||||
.info-list {
|
||||
padding: 10rpx 20rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.community-info,
|
||||
.address-info {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
margin-bottom: 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.map-section {
|
||||
padding: 10rpx 20rpx 20rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.label {
|
||||
color: #999;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
map {
|
||||
width: 100%;
|
||||
height: 320rpx;
|
||||
border-radius: 12rpx;
|
||||
margin-top: 20rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.vr-btn {
|
||||
background-color: #F34038;
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 0 14rpx;
|
||||
border-radius: 6rpx;
|
||||
font-size: 24rpx;
|
||||
margin-top: -90rpx;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.remark {
|
||||
padding: 20rpx;
|
||||
font-size: 28rpx;
|
||||
color: #555;
|
||||
line-height: 1.6;
|
||||
background-color: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
}
|
||||
/* 地图容器 */
|
||||
.map-container {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
}
|
||||
.popup-content {
|
||||
padding: 40rpx 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
/* 资产信息表格 */
|
||||
.asset-info-table {
|
||||
padding: 20rpx 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
padding-bottom: 100rpx;
|
||||
}
|
||||
|
||||
.popup-title {
|
||||
display: block;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.table-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.u-input {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
.table-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.u-button {
|
||||
margin-top: 20rpx;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
</style>
|
||||
.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>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,159 +1,306 @@
|
||||
<template>
|
||||
<view class="search-list-page">
|
||||
<view class="search-list-page">
|
||||
<!-- 顶部导航栏 -->
|
||||
<customNavbar title="资产列表" />
|
||||
<u-sticky offset-top="0">
|
||||
<view class="sticky">
|
||||
<filterDropdown :menuTop="0" :filterData="filterData" :defaultSelected="defaultSelected" :updateMenuName="true" @confirm="confirm" dataFormat="Object"></filterDropdown>
|
||||
</view>
|
||||
</u-sticky>
|
||||
<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="12" :image="item.coverImgUrl" :index="index"
|
||||
@click="clickImage(item.id)"></u-lazy-load>
|
||||
<view class="item-title">{{item.name}}</view>
|
||||
<view class="item-desc">{{ item.footPrint}}㎡</view>
|
||||
<view class="item-price">¥{{item.rentFee}}</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="10" :image="item.coverImgUrl" :index="index"
|
||||
@click="clickImage(item.id)"></u-lazy-load>
|
||||
<view class="item-title">{{item.name}}</view>
|
||||
<view class="item-desc">{{ item.footPrint}}㎡</view>
|
||||
<view class="item-price">¥{{item.rentFee}}</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>
|
||||
<!-- <customNavbar title="搜索资产" /> -->
|
||||
<u-navbar title="搜索资产" :autoBack="true" :background="background" title-color="#2D2B2C" back-icon-color="#2D2B2C">
|
||||
</u-navbar>
|
||||
<view class="search-list-content">
|
||||
<!-- 筛选标签栏 -->
|
||||
<view class="filter-dropdown-wrapper">
|
||||
<u-sticky offset-top="0">
|
||||
<view class="sticky" style="width: 100vw;">
|
||||
<filterDropdown :menuTop="0" :filterData="filterData" :defaultSelected="defaultSelected"
|
||||
:updateMenuName="true" @confirm="confirm" dataFormat="Object"></filterDropdown>
|
||||
</view>
|
||||
</u-sticky>
|
||||
</view>
|
||||
<!-- 搜索栏 -->
|
||||
<view class="search-bar-wrapper">
|
||||
<view class="search-bar">
|
||||
<view class="city-select">杭州 <text class="icon-down"></text></view>
|
||||
<view class="search-input">
|
||||
<text class="icon-search"></text>
|
||||
<input type="text" placeholder="请输入小区名称" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 标签组 -->
|
||||
<view class="tag-group">
|
||||
<view class="tag-item" :class="{ active: selectedTags.includes(tag) }"
|
||||
v-for="(tag, index) in tagGroupList" :key="index" @click="onTagClick(tag)">
|
||||
{{ tag }}
|
||||
</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>
|
||||
|
||||
<script>
|
||||
import config from "@/common/config.js" // 全局配置文件
|
||||
import searchData from '@/common/utils/searchData.js';//筛选菜单数据
|
||||
import filterDropdown from '@/components/zy/filterDropdown.vue';
|
||||
export default {
|
||||
components: {
|
||||
filterDropdown
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
import searchData from '@/common/utils/searchData.js'; //筛选菜单数据
|
||||
import filterDropdown from '@/components/zy/filterDropdown.vue';
|
||||
export default {
|
||||
components: {
|
||||
filterDropdown
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
indexArr: [],
|
||||
valueArr: [],
|
||||
defaultSelected: [],
|
||||
filterData: [],
|
||||
searchData:{},
|
||||
defaultSelected: [],
|
||||
filterData: [],
|
||||
searchData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
scrollTop: 0,
|
||||
houseList: [],
|
||||
loadStatus: 'loadmore',
|
||||
flowList: [],
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
loadStatus: 'loadmore',
|
||||
flowList: [],
|
||||
// 标签组数据和选中状态
|
||||
tagGroupList: ['全套家具', '配套齐全', '优选好房', '生活便利'],
|
||||
selectedTags: [],
|
||||
background: {
|
||||
// 渐变色
|
||||
backgroundImage: 'linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);'
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
let type = option.type
|
||||
let villageName = option.villageName
|
||||
this.searchData = {}
|
||||
if(type){
|
||||
if (type) {
|
||||
this.searchData.type = type
|
||||
}
|
||||
if(villageName){
|
||||
if (villageName) {
|
||||
this.searchData.villageName = villageName
|
||||
}
|
||||
// 获取房源数据
|
||||
this.findHouseList();
|
||||
// 获取房源数据
|
||||
this.findHouseList();
|
||||
// 获取小区数据
|
||||
this.findVillageList()
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadStatus = 'loading';
|
||||
// 获取数据
|
||||
this.findHouseList()
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.pageNum = 1
|
||||
this.flowList = []
|
||||
this.$refs.uWaterfall.clear();
|
||||
// 获取数据
|
||||
this.findHouseList();
|
||||
// 关闭刷新
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
methods: {
|
||||
findHouseList(type = 0) {
|
||||
if(type == 1){
|
||||
this.pageNum = 1
|
||||
this.flowList = []
|
||||
this.$refs.uWaterfall.clear();
|
||||
}
|
||||
let url = "/assets/findAssetList";
|
||||
this.$u.post(url, {
|
||||
state:1,
|
||||
villageCity:uni.getStorageSync('lifeData').vuex_city,
|
||||
pageNum: this.pageNum,
|
||||
pageSize: this.pageSize,
|
||||
orderByColumn: 'update_time,create_time',
|
||||
isAsc: 'desc'
|
||||
}).then(result => {
|
||||
const data = result.data.result;
|
||||
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]
|
||||
// if(!item.faceUrl.includes(config.staticUrl)){
|
||||
// item.image = config.staticUrl+item.faceUrl
|
||||
// }else{
|
||||
// item.image = item.faceUrl
|
||||
// }
|
||||
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
|
||||
})
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
onReachBottom() {
|
||||
this.loadStatus = 'loading';
|
||||
// 获取数据
|
||||
this.findHouseList()
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.pageNum = 1
|
||||
this.flowList = []
|
||||
this.$refs.uWaterfall.clear();
|
||||
// 获取数据
|
||||
this.findHouseList();
|
||||
// 关闭刷新
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
methods: {
|
||||
// 标签点击事件
|
||||
onTagClick(tag) {
|
||||
// 检查标签是否已选中
|
||||
const isSelected = this.selectedTags.includes(tag);
|
||||
if (isSelected) {
|
||||
// 如果已选中,则移除
|
||||
this.selectedTags = this.selectedTags.filter(item => item !== tag);
|
||||
} else {
|
||||
// 如果未选中,则添加
|
||||
this.selectedTags.push(tag);
|
||||
}
|
||||
// 这里可以添加根据标签筛选数据的逻辑
|
||||
console.log('标签点击:', tag);
|
||||
console.log('当前选中的标签:', this.selectedTags);
|
||||
// 可以调用findHouseList方法重新加载数据,根据选中的标签进行筛选
|
||||
// this.pageNum = 1;
|
||||
// this.flowList = [];
|
||||
// this.findHouseList(1);
|
||||
},
|
||||
|
||||
findHouseList(type = 0) {
|
||||
if (type == 1) {
|
||||
this.pageNum = 1
|
||||
this.flowList = []
|
||||
this.$refs.uWaterfall.clear();
|
||||
}
|
||||
// 隐藏接口请求,使用前端写死的测试数据
|
||||
// let url = "/assets/findAssetList";
|
||||
// this.$u.post(url, {
|
||||
// state:1,
|
||||
// villageCity:uni.getStorageSync('lifeData').vuex_city,
|
||||
// pageNum: this.pageNum,
|
||||
// pageSize: this.pageSize,
|
||||
// orderByColumn: 'update_time,create_time',
|
||||
// isAsc: 'desc'
|
||||
// }).then(result => {
|
||||
// const data = result.data.result;
|
||||
|
||||
// 前端写死的测试数据
|
||||
const data = [{
|
||||
id: 1,
|
||||
name: '景秀天成保租房景秀天成保租房',
|
||||
footPrint: 105,
|
||||
rentFee: 1500,
|
||||
coverImgUrl: '/static/img/index/swiper/swiper3.jpg',
|
||||
houseType: '3室2厅',
|
||||
orientation: '南',
|
||||
tags: ['全套家具', '全套家电']
|
||||
},
|
||||
{
|
||||
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) {
|
||||
this.$u.route({
|
||||
url: '/pages/detail/detail',
|
||||
params: {
|
||||
houseId: houseId
|
||||
}
|
||||
})
|
||||
this.$u.route({
|
||||
url: '/pages/detail/detail',
|
||||
params: {
|
||||
houseId: houseId
|
||||
}
|
||||
})
|
||||
},
|
||||
//接收菜单结果
|
||||
confirm(e) {
|
||||
@@ -165,22 +312,22 @@
|
||||
let decoration = combo[1]
|
||||
let feature = combo[2]
|
||||
this.searchData = {}
|
||||
if(type){
|
||||
if (type) {
|
||||
this.searchData.type = type
|
||||
}
|
||||
if(villageName){
|
||||
if (villageName) {
|
||||
this.searchData.villageName = villageName
|
||||
}
|
||||
if(price){
|
||||
if (price) {
|
||||
this.searchData.price = price
|
||||
}
|
||||
if(houseNum && houseNum.length>0){
|
||||
if (houseNum && houseNum.length > 0) {
|
||||
this.searchData.houseNum = houseNum.toString()
|
||||
}
|
||||
if(decoration && decoration.length>0){
|
||||
if (decoration && decoration.length > 0) {
|
||||
this.searchData.decoration = decoration.toString()
|
||||
}
|
||||
if(feature && feature.length>0){
|
||||
if (feature && feature.length > 0) {
|
||||
this.searchData.feature = feature.toString()
|
||||
}
|
||||
this.pageNum = 1
|
||||
@@ -189,93 +336,215 @@
|
||||
this.$refs.uWaterfall.clear();
|
||||
this.findHouseList()
|
||||
},
|
||||
code(){
|
||||
code() {
|
||||
this.$mytip.toast('请咨询技术支持')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.search-list-page{
|
||||
padding-top: 175rpx;
|
||||
.search-list-page {
|
||||
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 {
|
||||
background-color: $u-bg-color;
|
||||
}
|
||||
|
||||
.search{
|
||||
|
||||
.search {
|
||||
width: 54px;
|
||||
height: 44px;
|
||||
|
||||
&:active{
|
||||
|
||||
&:active {
|
||||
background-color: $u-bg-color;
|
||||
}
|
||||
}
|
||||
|
||||
.rowClass{
|
||||
|
||||
.rowClass {
|
||||
border-radius: 8px;
|
||||
background-color: rgb(255, 255, 255);
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
.hoverClass{
|
||||
|
||||
.hoverClass {
|
||||
background-color: #E4E7ED;
|
||||
}
|
||||
|
||||
.tabName{
|
||||
|
||||
.tabName {
|
||||
font-size: 28rpx;
|
||||
color: $u-main-color;
|
||||
}
|
||||
|
||||
|
||||
.demo-warter {
|
||||
border-radius: 8px;
|
||||
margin-top: 3px;
|
||||
background-color: #ffffff;
|
||||
padding: 3px;
|
||||
position: relative;
|
||||
border-radius: 8px;
|
||||
margin-top: 15rpx;
|
||||
margin-right: 10rpx;
|
||||
margin-left: 10rpx;
|
||||
background-color: #ffffff;
|
||||
padding: 0rpx;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
.u-close {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
// 图片样式
|
||||
.u-lazy-load {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
}
|
||||
|
||||
.item-cover {
|
||||
font-size: 55rpx;
|
||||
color: $u-type-warning;
|
||||
font-size: 55rpx;
|
||||
color: $u-type-warning;
|
||||
}
|
||||
|
||||
|
||||
.item-title {
|
||||
font-size: 28rpx;
|
||||
color: $u-main-color;
|
||||
font-weight: bold;
|
||||
padding-top: 5rpx;
|
||||
padding-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
padding: 12rpx 15rpx 8rpx 15rpx;
|
||||
line-height: 40rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
|
||||
.item-price {
|
||||
font-weight: normal;
|
||||
font-size: 32rpx;
|
||||
color: $u-type-warning;
|
||||
font-size: 32rpx;
|
||||
color: #FF2F31;
|
||||
padding: 0 15rpx 15rpx 15rpx;
|
||||
}
|
||||
|
||||
|
||||
.item-price text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.item-desc {
|
||||
font-weight: normal;
|
||||
font-size: 26rpx;
|
||||
color: $u-tips-color;
|
||||
padding-bottom: 5rpx;
|
||||
padding-left: 10rpx;
|
||||
font-weight: normal;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
padding: 0 15rpx 8rpx 15rpx;
|
||||
}
|
||||
|
||||
|
||||
// 标签样式
|
||||
.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 {
|
||||
font-size: 24rpx;
|
||||
color: $u-tips-color;
|
||||
margin-top: 3px;
|
||||
font-size: 24rpx;
|
||||
color: $u-tips-color;
|
||||
margin-top: 3px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user