暂时提交

This commit is contained in:
2026-07-24 10:46:00 +08:00
parent 070f3bab4f
commit 9bf70e785e
15 changed files with 1133 additions and 630 deletions

View File

@@ -4,25 +4,29 @@
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" @click="location()">{{ city ||'宜昌市'}} <text class="icon-down"></text>
</view>
<view class="search-input" @click="search">
<text class="icon-search"></text>
<input type="text" placeholder="搜索商铺/住房/土地" />
</view>
<view class="search-bar-wrapper">
<view class="search-bar">
<view class="city-select" @click="location()">{{ city ||'宜昌市'}} <text class="icon-down"></text>
</view>
<view class="search-input" @click="search">
<text class="icon-search"></text>
<input type="text" placeholder="搜索商铺/住房/土地" />
</view>
</view>
<view class="tag-group">
</view>
<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"
navBgGradient="linear-gradient(-90deg, rgb(207,240,255), rgb(179,217,255) 0% 99%)"
activeColor="#0088FE"
submitBtnBg="#0088FE"
resetBtnColor="#0088FE"></filterDropdown>
</view>
</u-sticky>
</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 }}
@@ -96,7 +100,7 @@
tagGroupList: [],
selectedTags: [],
background: {
backgroundImage: 'linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);'
backgroundImage: 'linear-gradient(-90deg, rgb(207,240,255),rgb(179,217,255) 0% 99%);'
},
}
},
@@ -167,49 +171,93 @@
this.loadStatus = 'loading';
this.$u.post('/assets/queryPage', {
assetsStatus:'闲置中',
assetsType: type,
pageNo: this.pageNo,
pageSize: this.pageSize,
keyWord: keyword,
bizZone: this.searchData.bizZone,
layout: this.searchData.layout,
renovationStatus: this.searchData.decoration,
features: this.searchData.feature
}).then(result => {
const rows = result.data.result || [];
if (this.pageNo === 1 && rows.length === 0) {
this.flowList = [];
this.loadStatus = 'nomore';
return;
}
rows.forEach(row => {
if (row.coverImgUrl) {
row.coverImgUrl = this.$config.staticUrl + row.coverImgUrl
} else {
row.coverImgUrl = this.$config.staticUrl + this.defaultImgUrl
}
})
this.flowList = this.flowList.concat(rows);
if (rows.length < this.pageSize) {
this.loadStatus = 'nomore';
} else {
this.pageNo++;
this.loadStatus = 'more'; // ✅ 恢复
}
this.keyWord = null
// TODO: 接口联调时取消注释,删除 mock 数据
// this.$u.post('/assets/queryPage', {
// assetsStatus:'闲置中',
// assetsType: type,
// pageNo: this.pageNo,
// pageSize: this.pageSize,
// keyWord: keyword,
// bizZone: this.searchData.bizZone,
// layout: this.searchData.layout,
// renovationStatus: this.searchData.decoration,
// features: this.searchData.feature
// }).then(result => {
// const rows = result.data.result || [];
// if (this.pageNo === 1 && rows.length === 0) {
// this.flowList = [];
// this.loadStatus = 'nomore';
// return;
// }
// rows.forEach(row => {
// if (row.coverImgUrl) {
// row.coverImgUrl = this.$config.staticUrl + row.coverImgUrl
// } else {
// row.coverImgUrl = this.$config.staticUrl + this.defaultImgUrl
// }
// })
// this.flowList = this.flowList.concat(rows);
// if (rows.length < this.pageSize) {
// this.loadStatus = 'nomore';
// } else {
// this.pageNo++;
// this.loadStatus = 'more';
// }
// this.keyWord = null
// }).catch(err => {
// console.log("获取资产信息失败:", err);
// this.loadStatus = 'more';
// }).finally(() => {
// uni.stopPullDownRefresh();
// });
}).catch(err => {
console.log("获取资产信息失败:", err);
this.loadStatus = 'more'; // ✅ 恢复
}).finally(() => {
// Mock 静态数据
const mockData = [
{
assetsNo: 'ASSET-001',
assetsName: '东山大道435-2-1-104号',
assetsType: '住宅',
footPrint: 120,
orientation: '南',
coverImgUrl: this.$config.staticUrl + this.defaultImgUrl,
tags: ['近地铁', '精装修']
},
{
assetsNo: 'ASSET-002',
assetsName: '夷陵大道418号商铺',
assetsType: '商铺',
footPrint: 85,
orientation: '东',
coverImgUrl: this.$config.staticUrl + this.defaultImgUrl,
tags: ['临街', '人流量大']
},
{
assetsNo: 'ASSET-003',
assetsName: '解放路88号写字楼',
assetsType: '写字楼',
footPrint: 200,
orientation: '南',
coverImgUrl: this.$config.staticUrl + this.defaultImgUrl,
tags: ['交通便利', '配套齐全']
},
{
assetsNo: 'ASSET-004',
assetsName: '沿江大道168号住房',
assetsType: '住宅',
footPrint: 95,
orientation: '南',
coverImgUrl: this.$config.staticUrl + this.defaultImgUrl,
tags: ['拎包入住', '采光好']
}
];
setTimeout(() => {
if (this.pageNo === 1) this.flowList = [];
this.flowList = this.flowList.concat(mockData);
this.loadStatus = 'nomore';
this.keyWord = null;
uni.stopPullDownRefresh();
});
}, 500);
},
loadMore() {
if (this.loadStatus !== 'more') return;
@@ -239,18 +287,26 @@
this.filterData = searchData;
},
async getFeatures(){
const res = await this.$u.get('/assets/getFeatures');
if (res.flag) {
return res.data;
}
return [];
// TODO: 接口联调时取消注释,删除 mock 数据
// const res = await this.$u.get('/assets/getFeatures');
// if (res.flag) {
// return res.data;
// }
// return [];
// Mock 静态数据
return ['近地铁', '精装修', '拎包入住', '采光好', '临街', '配套齐全', '交通便利'];
},
async getBizZone(){
const res = await this.$u.get('/assets/getBizZones');
if (res.flag) {
return res.data;
}
return [];
// TODO: 接口联调时取消注释,删除 mock 数据
// const res = await this.$u.get('/assets/getBizZones');
// if (res.flag) {
// return res.data;
// }
// return [];
// Mock 静态数据
return ['CBD商圈', '解放路商圈', '沿江大道', '东山大道', '夷陵大道'];
},
getImageSize(url, index) {
uni.getImageInfo({
@@ -306,13 +362,14 @@
}
.search-list-content {
background: linear-gradient(-90deg, #F9DED9 0%, #F8DFC0 99%);
background: linear-gradient(-90deg, rgb(207,240,255),rgb(179,217,255) 0% 99%);
border-radius: 0rpx;
padding-bottom: 20rpx;
padding-bottom: 0;
padding-top: var(--window-top, 0);
}
.search-bar-wrapper {
padding: 10rpx 20rpx;
padding: 10rpx 20rpx 0;
}
.search-bar {
@@ -361,7 +418,7 @@
}
.filter-dropdown-wrapper {
margin-bottom: 20rpx;
margin-bottom: 0;
}
.tag-group {