mirror of
http://36.133.248.69:3088/admin/RentWeAppFront.git
synced 2026-03-07 17:32:25 +08:00
需求变更进行调整
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="u-margin-left-20 u-margin-right-20">
|
||||
<u-navbar :is-back="true" title="搜索" :border-bottom="false"></u-navbar>
|
||||
<u-search placeholder="请输入资产名称/街道/位置等信息" v-model="keyword" @search="clickSearch(value)"
|
||||
<u-search placeholder="请输入资产名称/位置等信息" v-model="keyword" @search="clickSearch(value)"
|
||||
:focus="true" action-text="取消" @custom="cancelSearch"></u-search>
|
||||
<!-- 搜索记录 -->
|
||||
<template v-if="historyList.length > 0">
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<!-- 搜索栏 -->
|
||||
<view class="search-bar-wrapper">
|
||||
<view class="search-bar">
|
||||
<view class="city-select" @click="location()">{{ city ||'宜昌'}} <text class="icon-down"></text>
|
||||
<view class="city-select" @click="location()">{{ city ||'宜昌市'}} <text class="icon-down"></text>
|
||||
</view>
|
||||
<view class="search-input" @click="search">
|
||||
<text class="icon-search"></text>
|
||||
@@ -42,12 +42,12 @@
|
||||
<u-lazy-load threshold="750" border-radius="8" :image="item.coverImgUrl" :index="index"
|
||||
@click="clickImage(item.assetsNo)" mode="aspectFill"></u-lazy-load>
|
||||
<view class="item-title">{{ item.assetsName }}</view>
|
||||
<view class="item-desc">{{ item.assetsType }} {{ item.footPrint }}㎡ {{ item.orientation }}
|
||||
<view class="item-desc">{{ item.assetsType }} {{ 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 class="item-price">¥{{ item.rentFee || '未知'}}/<text>月</text></view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-slot:right="{ rightList }">
|
||||
@@ -55,11 +55,11 @@
|
||||
<u-lazy-load threshold="750" border-radius="8" :image="item.coverImgUrl" :index="index"
|
||||
@click="clickImage(item.assetsNo)" mode="aspectFill"></u-lazy-load>
|
||||
<view class="item-title">{{ item.assetsName }}</view>
|
||||
<view class="item-desc">{{ item.assetsType}} {{ item.footPrint }}㎡ {{ item.orientation }}</view>
|
||||
<view class="item-desc">{{ item.assetsType}} {{ 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 class="item-price">¥{{ item.rentFee || '未知'}}/<text>月</text></view>
|
||||
</view>
|
||||
</template>
|
||||
</u-waterfall>
|
||||
@@ -81,9 +81,11 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyWord: null,
|
||||
city: null,
|
||||
streetList: [],
|
||||
selectedBizZone: null,
|
||||
selectedLayout: null,
|
||||
selectedDecorationStatus: null,
|
||||
selectedFeatures:[],
|
||||
indexArr: [],
|
||||
valueArr: [],
|
||||
defaultSelected: [],
|
||||
@@ -109,9 +111,6 @@
|
||||
let villageName = option.villageName
|
||||
let lifeData = uni.getStorageSync('lifeData');
|
||||
let vuex_city = lifeData.vuex_city
|
||||
if (option.keyword) {
|
||||
this.keyWord = option.keyword
|
||||
}
|
||||
this.city = vuex_city
|
||||
this.searchData = {}
|
||||
if (type) {
|
||||
@@ -120,9 +119,9 @@
|
||||
if (villageName) {
|
||||
this.searchData.villageName = villageName
|
||||
}
|
||||
this.resetAndLoad()
|
||||
// 获取小区数据
|
||||
this.findVillageList()
|
||||
// 获取街道数据
|
||||
this.findFilterTabData()
|
||||
this.findHouseList(null,option.keyword)
|
||||
},
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
@@ -167,13 +166,12 @@
|
||||
this.pageNo = 1;
|
||||
this.flowList = [];
|
||||
this.loadStatus = 'loadmore';
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs.uWaterfall && this.$refs.uWaterfall.clear();
|
||||
this.findHouseList();
|
||||
});
|
||||
},
|
||||
findHouseList(type = null) {
|
||||
findHouseList(type = null,keyWord = null) {
|
||||
if (this.loadStatus !== 'loadmore') return;
|
||||
|
||||
this.loadStatus = 'loading';
|
||||
@@ -183,18 +181,16 @@
|
||||
assetsType: type,
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
keyWord: this.keyWord
|
||||
keyWord: this.keyWord,
|
||||
bizZone: this.searchData.bizZone
|
||||
}).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
|
||||
@@ -204,7 +200,6 @@
|
||||
})
|
||||
// 追加数据
|
||||
this.flowList = this.flowList.concat(rows);
|
||||
|
||||
// 判断是否还有下一页(核心)
|
||||
if (rows.length < this.pageSize) {
|
||||
this.loadStatus = 'nomore';
|
||||
@@ -212,6 +207,7 @@
|
||||
this.pageNo++; // ✅ 只有这里能 +1
|
||||
this.loadStatus = 'loadmore';
|
||||
}
|
||||
this.keyWord = null
|
||||
|
||||
}).catch(err => {
|
||||
console.log("获取资产信息失败:", err);
|
||||
@@ -226,40 +222,48 @@
|
||||
// 调用接口获取下一页
|
||||
this.findHouseList();
|
||||
},
|
||||
findStreet() {
|
||||
|
||||
async findFilterTabData() {
|
||||
// 填充商圈数据到筛选菜单
|
||||
const bizZones = await this.getBizZone();
|
||||
const features = await this.getFeatures();
|
||||
let featureSubMenu = [];
|
||||
for (let i = 0; i < bizZones.length; i++) {
|
||||
searchData[0].submenu.push({
|
||||
name: bizZones[i],
|
||||
value: bizZones[i]
|
||||
});
|
||||
|
||||
}
|
||||
for (let i = 0; i < features.length; i++) {
|
||||
featureSubMenu.push({
|
||||
name: features[i],
|
||||
value: features[i]
|
||||
})
|
||||
}
|
||||
searchData[2].submenu.push({
|
||||
name:"基础配套",
|
||||
type:"radio-multi",
|
||||
submenu: featureSubMenu
|
||||
})
|
||||
this.filterData = searchData;
|
||||
},
|
||||
findVillageList() {
|
||||
// 前端写死的测试小区数据
|
||||
// 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;
|
||||
async getFeatures(){
|
||||
const res = await this.$u.get('/assets/getFeatures');
|
||||
if (res.flag) {
|
||||
return res.data;
|
||||
}
|
||||
return [];
|
||||
},
|
||||
async getBizZone(){
|
||||
const res = await this.$u.get('/assets/getBizZones');
|
||||
if (res.flag) {
|
||||
return res.data;
|
||||
}
|
||||
return [];
|
||||
},
|
||||
clickImage(houseId) {
|
||||
this.$u.route({
|
||||
url: '/pages-assets/assets/detail',
|
||||
url: '/pages-assets/assets/assetsDetail',
|
||||
params: {
|
||||
assetsNo: houseId
|
||||
}
|
||||
@@ -267,25 +271,21 @@
|
||||
},
|
||||
//接收菜单结果
|
||||
confirm(e) {
|
||||
let type = e.value[1][0]
|
||||
let villageName = e.value[0][0]
|
||||
let price = e.value[2][0]
|
||||
let combo = e.value[3]
|
||||
let houseNum = combo[0]
|
||||
let bizZone = e.value[0][0]
|
||||
let price = e.value[1][0]
|
||||
let combo = e.value[2]
|
||||
let layout = combo[0]
|
||||
let decoration = combo[1]
|
||||
let feature = combo[2]
|
||||
this.searchData = {}
|
||||
if (type) {
|
||||
this.searchData.type = type
|
||||
}
|
||||
if (villageName) {
|
||||
this.searchData.villageName = villageName
|
||||
if (bizZone) {
|
||||
this.searchData.bizZone = bizZone
|
||||
}
|
||||
if (price) {
|
||||
this.searchData.price = price
|
||||
}
|
||||
if (houseNum && houseNum.length > 0) {
|
||||
this.searchData.houseNum = houseNum.toString()
|
||||
if (layout && layout.length > 0) {
|
||||
this.searchData.layout = layout.toString()
|
||||
}
|
||||
if (decoration && decoration.length > 0) {
|
||||
this.searchData.decoration = decoration.toString()
|
||||
|
||||
Reference in New Issue
Block a user