求房源筛选修改全局

This commit is contained in:
A1300399510 2024-03-14 19:08:03 +08:00
parent 3a61ca91cb
commit 3991cb2ec7
10 changed files with 75 additions and 48 deletions

View File

@ -92,6 +92,7 @@
</cover-view>
</map>
</view>
<!-- 地图轮播模块 -->
<view class="place-info-box">
<scroll-view scroll-x style="height:380rpx" enhanced="true" id='apartmentView' enable-flex='true' scroll-into-view="{{personListId}}" scroll-with-animation scroll-left="{{mapSelectScrollTop}}" class="place-list dis-f al-item" wx:if="{{headerObjTab!=='apartment'&&showPlace&&selectPlacePrice.id}}">

View File

@ -64,6 +64,7 @@ Page({
initState: false,
topTitle: "",
consultState: false, // 咨询弹窗状态
schoolScrollLeft: 100,
},
headerSearchTopHeight: 10,
@ -128,7 +129,10 @@ Page({
}
})
console.log("brandSelectionObj1", brandSelectionObj);
// brandSelectionObj['school'] = 6
// console.log("brandSelectionObj1", brandSelectionObj);
// this.data.roomtype.value = options.roomtype || '';
// this.data.roomlistings.value = options.roomlistings || '';
@ -321,6 +325,20 @@ Page({
roomlistings: that.data.roomlistings
})
// 公寓列表 学校筛选的获取对应位置。并计算是否横向滚动
wx.nextTick(() => {
let index = this.data.school || 0
if (index == 0) return
wx.createSelectorQuery().select('#annex-school').boundingClientRect((parentRect) => {
wx.createSelectorQuery().select(`.annex-school-item.item${index}`).boundingClientRect((childRect) => {
const distance = childRect.left - parentRect.left - parentRect.width + childRect.width + 10
if (distance <= 0) return
this.setData({
schoolScrollLeft: distance
})
}).exec();
}).exec();
})
}
}).catch(res => {})
},

View File

@ -25,9 +25,9 @@
<view id="annex-school" class="annex-school flexacenter">
<view class="annex-school-name flexacenter">学校附近</view>
<scroll-view scroll-x="{{ true }}" style=" width: 60%; white-space: nowrap;" class="flex1">
<view class="annex-school-item flexcenter {{ school == '' ? 'pitch' : '' }}" bindtap="chooseSchool" data-id="">不限</view>
<view class="annex-school-item flexcenter {{ school == item.id ? 'pitch' : '' }}" bindtap="chooseSchool" wx:for="{{ schoolList }}" wx:key="index" data-id="{{ item.id }}">{{ item.name }}</view>
<scroll-view scroll-x="{{ true }}" style=" width: 60%; white-space: nowrap;" class="flex1" scroll-left="{{ schoolScrollLeft }}">
<view class="annex-school-item flexcenter item0 {{ school == '' ? 'pitch' : '' }}" bindtap="chooseSchool" data-id="">不限</view>
<view class="annex-school-item flexcenter item{{ item.id }} {{ school == item.id ? 'pitch' : '' }}" bindtap="chooseSchool" wx:for="{{ schoolList }}" wx:key="index" data-id="{{ item.id }}">{{ item.name }}</view>
</scroll-view>
</view>

View File

@ -200,7 +200,7 @@
height: 96rpx;
border-radius: 50%;
box-shadow: 0px 0px 12rpx rgba(0, 0, 0, 0.0784313725490196);
z-index: 100;
z-index: 1000;
}
.consult-btn .consult-inside {

View File

@ -29,7 +29,7 @@
<view></view>
</view>
<template wx:if="{{ lists.length == 0 && !loading }}" data="{{ hint: '暂无数据' }}" is="empty-icon"></template>
<view class="totalSum flexcenter" wx:if="{{ totalSum == 0 }}">- 共 <view class="num">{{ totalSum }}</view> 条{{ intermediaryObj[intermediary] }}房源 -</view>
<view class="totalSum flexcenter" wx:if="{{ totalSum !== 0 }}">- 共 <view class="num">{{ totalSum }}</view> 条{{ intermediaryObj[intermediary] }}房源 -</view>
<block wx:for="{{ lists }}" wx:key="index">
<common-list item="{{ item }}"></common-list>
</block>

View File

@ -115,30 +115,39 @@ Page({
// 获取全局筛选的值
let selectionObj = {}
selectionObj = app.globalData.restSelectionObj
// console.log("selectionObj", selectionObj);
// options.location = "1.1,1.2"
// options.money = "5000~5100"
// options.types = "1.3"
// options.gender = 2
// options.leaseterm = 2
// options.publish = "triduum"
// options.iselevator = 1
// options.issunshinearea = 1
var location = [];
const locationArr = miucms.updateProperty('location', options, selectionObj)
if (locationArr) this.data.requestData['location'] = locationArr.split(',')
// this.requestData['location'] = locationArr
this.data.location.value = location;
this.data.types.value = miucms.updateProperty('types', options, selectionObj)
this.data.moreCondition.data.gender = miucms.updateProperty('gender', options, selectionObj)
this.data.moreCondition.data.leaseterm = miucms.updateProperty('leaseterm', options, selectionObj)
this.data.moreCondition.data.publish = miucms.updateProperty('publish', options, selectionObj)
this.data.moreCondition.data.iselevator = miucms.updateProperty('iselevator', options, selectionObj)
this.data.moreCondition.data.issunshinearea = miucms.updateProperty('issunshinearea', options, selectionObj)
const orderby = miucms.updateProperty('orderby', options, selectionObj)
if (orderby) this.data.orderby.value = orderby
const types = miucms.updateProperty('types', options, selectionObj) || 0
this.data.types.value = types
this.data.requestData['types'] = types
const gender = miucms.updateProperty('gender', options, selectionObj) || 0
this.data.moreCondition.data.gender = gender
this.data.requestData['gender'] = gender
const leaseterm = miucms.updateProperty('leaseterm', options, selectionObj) || 0
this.data.moreCondition.data.leaseterm = leaseterm
this.data.requestData['leaseterm'] = leaseterm
const publish = miucms.updateProperty('publish', options, selectionObj) || 0
this.data.moreCondition.data.publish = publish
this.data.requestData['publish'] = publish
const iselevator = miucms.updateProperty('iselevator', options, selectionObj) || 0
this.data.moreCondition.data.iselevator = iselevator
this.data.requestData['iselevator'] = iselevator
const issunshinearea = miucms.updateProperty('issunshinearea', options, selectionObj) || 0
this.data.moreCondition.data.issunshinearea = issunshinearea
this.data.requestData['issunshinearea'] = issunshinearea
const orderby = miucms.updateProperty('orderby', options, selectionObj) || 'timestamp'
this.data.orderby.value = orderby
this.data.requestData['orderby'] = orderby
const oMoney = miucms.updateProperty('money', options, selectionObj)
if (oMoney) {
@ -155,6 +164,7 @@ Page({
location: this.data.location,
moreCondition: this.data.moreCondition,
requestData: this.data.requestData,
orderby: this.data.orderby,
city: {
uniqid: options.cityid || '',
name: options.name || '',
@ -169,11 +179,9 @@ Page({
})
this.get_config()
this.firstInpage = false;
setTimeout(() => {
this.setData({
money: this.data.money,
})
}, 1200)
this.setData({
money: this.data.money,
})
},
firstInpage: true,
onShow() {
@ -222,8 +230,8 @@ Page({
status: app.globalData.status,
StudentapartmentNew: app.globalData.StudentapartmentNew,
intermediary: app.globalData.user.intermediary,
// identity: app.globalData.user.identity || 1,
identity: 1,
identity: app.globalData.user.identity || 1,
// identity: 1,
})
let screen_data = this.data.screen_data
@ -345,7 +353,6 @@ Page({
that.setData({
totalSum: data.count,
// list: that.data.list.concat(list),
loading: false,
page
})
@ -355,10 +362,11 @@ Page({
})
let selectionObj = {
...this.data.requestData,
location: this.data.requestData.location && this.data.requestData.location.join(','),
}
if (this.data.requestData['rent_min'] > 0) selectionObj['money'] = `${this.data.requestData['rent_min']}~${this.data.requestData['rent_max']}`
app.globalData.restSelectionObj = selectionObj
},
// 获取地域列表
@ -373,7 +381,7 @@ Page({
types: this.data.types,
property: data.data.property,
cityList: data.data.cityList,
allowsearch: data.data.allowsearch || true
allowsearch: data.data.allowsearch
})
wx.setStorage({
key: 'countryList',

View File

@ -15,7 +15,7 @@
<view wx:if="{{ identity == 1 }}" id="list-operations" class="list-operations {{ operationsTop ? 'list-operations-top' : '' }}" style="top: {{ screen_data.totalTopHeight }}px;">
<view wx:if="{{ !allowsearch }}" class="mengcheng" bindtap="setValue" data-key="authenticationPopState" data-value="{{ true }}"></view>
<!-- <list-operations tabTitle="求房源" property="{{ property }}" school="{{ school }}" types="{{ types }}" location="{{ location }}" operationstype="askinghousing" money="{{ money }}" screen_data="{{ screen_data }}" roomtype="{{ roomtype }}" roomlistings="{{ roomlistings }}" bindsubmit="submitOperations"></list-operations> -->
<list-operations tabTitle="求房源" property="{{ property }}" school="{{ school }}" types="{{ types }}" location="{{ {value: requestData.location, data:langs.location} }}" operationstype="askinghousing" money="{{ money }}" screen_data="{{ screen_data }}" roomtype="{{ roomtype }}" roomlistings="{{ roomlistings }}" bindsubmit="submitOperations" moreCondition="{{ moreCondition }}"></list-operations>
<list-operations operationstype="askinghousing" tabTitle="求房源" property="{{ property }}" school="{{ school }}" types="{{ types }}" location="{{ {value: requestData.location, data:langs.location} }}" money="{{ money }}" screen_data="{{ screen_data }}" roomtype="{{ roomtype }}" roomlistings="{{ roomlistings }}" bindsubmit="submitOperations" moreCondition="{{ moreCondition }}" orderbyy="{{ orderby }}"></list-operations>
</view>
<to-top wx:if="{{ showTOTOP }}"></to-top>

View File

@ -18,7 +18,8 @@ Page({
},
publish: {
page: 1,
data: []
data: [],
loading: false,
},
fav_list: [],
fav_page: {
@ -897,7 +898,11 @@ Page({
// 获取 发布数据 V4的
getPublishData() {
let publish = this.data.publish
if (publish['page'] == 0) return
if (publish['page'] == 0 || publish.loading) return
publish.loading = true
this.setData({
publish
})
wx.showLoading({
title: '加载中...',
})
@ -920,6 +925,9 @@ Page({
})
}).finally(() => {
wx.hideLoading()
this.setData({
['publish.loading']: false
})
})
},

View File

@ -78,9 +78,9 @@
<template wx:else is="empty-icon" data="{{ hint: '暂无内容' }}"></template>
<image class="service flexflex" mode="widthFix" wx:if="{{ wechat['service'] }}" show-menu-by-longpress src="{{ wechat['service'] }}"></image>
</view>
<view wx:else style="border-radius: 15rpx 0 0 0;" class="list-new-content list-new-content-issue">
<block wx:if="{{ publish.count != 0 }}">
<template wx:if="{{ publish.count == 0 && !publish.loading }}" is="empty-icon" data="{{ hint: '暂无内容' }}"></template>
<block wx:else>
<view class="list-new-content-total flexacenter">共 <view class="list-new-content-total-num">{{ publish.count }}</view> 条房源(上架 {{ stat.listing }} <view class="list-new-content-vertical"></view> 草稿 {{ stat.draft }} <view class="list-new-content-vertical"></view> 下架 {{ stat.offshelf }} </view>
<view class="list-new-content-list">
<view class="list-new-content-item" wx:for="{{ publish.data }}" wx:key="index">
@ -88,7 +88,6 @@
</view>
</view>
</block>
<template wx:else is="empty-icon" data="{{ hint: '暂无内容' }}"></template>
<!-- 疑问 -->
<view class="query-box flexcenter" wx:if="{{ data.length != 0 }}">
<view class="query-text flexacenter">有疑问?来找<image class="query-img" mode="widthFix" src="/img/smiling-face.png"></image>{{ wechat.nickname }}</view>

View File

@ -119,7 +119,6 @@ Component({
let areaPitchValueOne = this.data.areaPitchValueOne
let conditionObj = this.data.conditionObj
let areaPitchValueTwo = this.data.areaPitchValueTwo
console.log("value", value);
if (value) {
let obj = {}
areaPitchValueOne = parseInt(value[0]) || 0
@ -183,11 +182,7 @@ Component({
orderbyy: {
type: Object,
observer(res) {
// console.log(this.data.orderby);
console.log("res", res);
this.data.orderby.value = res.value
console.log(this.data.orderby, "111111");
let conditionObj = this.data.conditionObj
conditionObj.orderby['valueText'] = this.data.orderby.obj[res.value]
@ -195,7 +190,6 @@ Component({
orderby: this.data.orderby,
conditionObj,
})
console.log("conditionObj", conditionObj);
}
}
},
@ -647,7 +641,6 @@ Component({
...moreOtherValue
})
this.setData({
conditionState: "",
})