This commit is contained in:
A1300399510 2023-05-10 17:18:19 +08:00
parent 226ea40de9
commit d79fdc9fec
9 changed files with 443 additions and 34 deletions

View File

@ -238,7 +238,6 @@ Page({
// 新 轮播图 点击事件
handleSwiper(e) {
console.log(e);
let {
appid,
url,
@ -500,6 +499,7 @@ Page({
// 判断在哪边的
whichSide(res, targetData) {
console.log("leftHeight", this.leftHeight, "rightHeight", this.rightHeight);
if (this.leftHeight <= this.rightHeight) {
this.leftHeight = this.leftHeight + res
this.data.listDataLeft.push(targetData)

View File

@ -10,6 +10,7 @@
"card-person": "./cardPerson/cardPerson",
"card-brands": "./cardBrands/cardBrands",
"fix-footer": "../../template/fixFooter/fixFooter",
"announcement-popup": "../../template/announcementPopup/announcementPopup"
"announcement-popup": "../../template/announcementPopup/announcementPopup",
"to-top": "/template/toTop/toTop"
}
}

View File

@ -373,7 +373,7 @@ Page({
}
}
}
if (ishere) {
searchindex = i;
this.setData({
@ -400,6 +400,7 @@ Page({
location: that.data.location.value,
school: that.data.school.value,
page: this.data.page,
intermediarytype: 2,
})
var that = this;
@ -432,13 +433,11 @@ Page({
// 清空数组
clear_data: function () {
this.setData({
page: 1,
lists: []
})
this.get_list()
},
setSelectData(title) {
@ -709,7 +708,6 @@ Page({
},
// 提交出租方式
submittype(e) {
this.data.types.value = e.detail.data;
this.setData({
types: this.data.types,
@ -719,7 +717,6 @@ Page({
},
// 提交排序
submitOrderby(e) {
this.data.orderby.value = e.detail.value;
this.setData({
orderby: this.data.orderby
@ -769,5 +766,4 @@ Page({
miucms.closeAD(e.detail.id)
},
})

View File

@ -30,6 +30,57 @@ Page({
},
listTab: {},
topTitle: "",
groupSearch: [], //组合最热
location: {
value: [],
data: null
},
types: {
value: '',
data: null
}, //6.24删除
money: {
rent_min: 0,
rent_max: ''
},
moreCondition: {
show: false,
data: {
gender: "0",
leaseterm: "0",
publish: "twomonth",
}
},
school: {
list: {},
value: ''
},
orderby: {
value: 'timestamp',
list: [{
name: "最新发布",
value: 'timestamp'
},
{
name: "热门",
value: 'hotnum'
},
{
name: "价格从低到高",
value: 'rentasc'
},
{
name: "价格从高到低",
value: 'rentdesc'
},
]
},
selectGroupIndex: null,
},
/**
@ -119,7 +170,8 @@ Page({
})
this.get_content();
this.getList();
this.getgroupSearch();
this.getLocationList();
} else {
setTimeout(function () {
@ -127,23 +179,104 @@ Page({
}, 200)
}
},
getgroupSearch() {
var that = this;
miucms.request(app.globalData.config.lists.groupsearch, {}).then(data => {
this.setData({
groupSearch: data.data
}, function () {
that.caclulatesearchIndex()
})
wx.hideLoading()
}).catch(res => {})
},
// 是否选中关键词
caclulatesearchIndex() {
let groupSearch = this.data.groupSearch;
console.log("groupSearch", groupSearch);
let that = this;
let searchindex = null;
for (let i = 0; i < groupSearch.length; i++) {
let ishere = true;
for (let j in groupSearch[i].where) {
let moreCondition = ['gender', 'leaseterm', 'publish'];
let money = ['rent_min', 'rent_max'];
if (moreCondition.indexOf(j) > -1) {
if (j != 'publish') {
if (groupSearch[i].where[j] * 1 != that.data.moreCondition.data[j] * 1) {
ishere = false;
break;
}
} else {
if (groupSearch[i].where[j] != that.data.moreCondition.data[j]) {
ishere = false;
break;
}
}
} else if (money.indexOf(j) > -1) {
if (groupSearch[i].where[j] != that.data.money[j]) {
ishere = false;
break;
}
} else if (j == 'location') {
if (groupSearch[i].where[j].sort().toString() != that.data[j].value.sort().toString()) {
ishere = false;
break;
}
} else if (j == 'type') {
if (groupSearch[i].where[j] != that.data['types'].value) {
ishere = false;
break;
}
} else {
console.log(groupSearch[i].where[j], "j", j);
if (groupSearch[i].where[j] != that.data[j].value) {
ishere = false;
break;
}
}
}
if (ishere) {
searchindex = i;
this.setData({
selectGroupIndex: searchindex
})
break;
}
}
},
getList: function () {
let that = this;
if (this.data.page.next_page === 0) {
return false
}
if (this.data.loading) {
return false
}
if (this.data.loading || this.data.page.next_page === 0) return false
this.setData({
loading: true
})
// miucms.request(app.globalData.config.studentapartment.quarantineLists, {
miucms.request(app.globalData.baseURL + '/tenement/housingresources/lists', {
this.caclulatesearchIndex()
var sendData = Object.assign({}, this.data.options, this.data.moreCondition.data, this.data.money, {
session: wx.getStorageSync('session'),
orderby: this.data.orderby.value,
'type': this.data.types.value,
location: that.data.location.value,
school: that.data.school.value,
// page: this.data.page,
page: this.data.page.next_page,
intermediarytype: 1
}).then(data => {
intermediarytype: 1,
})
// miucms.request(app.globalData.config.studentapartment.quarantineLists, {
miucms.request(app.globalData.baseURL + '/tenement/housingresources/lists', sendData).then(data => {
if (data.extraparam) {
wx.showModal({
title: '提示',
@ -202,4 +335,136 @@ Page({
})
},
// 提交更多
myEventSelectSubmit(e) {
this.setData({
moreCondition: {
show: false,
data: e.detail
},
selectGroupIndex: null
})
this.hasMoreCondition()
this.clear_data()
},
// 判断‘更多’是否加粗
hasMoreCondition() {
let hascondition = false;
for (let i in this.data.moreCondition.data) {
// 存在一个就加粗
if (this.data.moreCondition.data[i] != 0) hascondition = true;
}
this.setData({
hascondition,
})
},
// 租金条件筛选提交
submitMoney(e) {
this.data.money = Object.assign({}, e.detail);
this.setData({
selectGroupIndex: null,
money: this.data.money
})
this.clear_data()
},
// 提交排序
submitOrderby(e) {
this.data.orderby.value = e.detail.value;
this.setData({
orderby: this.data.orderby
})
this.clear_data()
},
// 选择热词
selectGroup(e) {
let index = e.currentTarget.dataset.index;
let obj = this.data.groupSearch[index].where;
this.data.school.value = obj.school || ''; //学校
this.data.location.value = Array.isArray(obj.location) ? [...obj.location] : []; //区域
this.data.types.value = obj['type']; //出租方式
this.data.money.rent_min = obj.rent_min;
this.data.money.rent_max = obj.rent_max; //租金
this.data.orderby.value = obj.orderby; //排序
this.data.moreCondition.data = {
gender: obj.gender,
leaseterm: obj.leaseterm,
publish: obj.publish,
}
this.setData({
selectGroupIndex: index,
school: this.data.school,
location: this.data.location,
types: this.data.types,
money: this.data.money,
orderby: this.data.orderby,
moreCondition: this.data.moreCondition
})
this.hasMoreCondition()
this.clear_data()
},
// 清空数组
clear_data: function () {
this.setData({
page: {
next_page: 1
},
data: []
})
this.getList()
},
// 获取地域列表
getLocationList() {
let that = this;
miucms.request(app.globalData.config.lists.region, {}).then(data => {
this.data.location.data = data.data.location;
this.data.types.data = data.data['type'];
this.data.school.list = data.data.school
that.setData({
location: that.data.location,
types: that.data.types,
property: data.data.property,
school: that.data.school
})
wx.hideLoading()
}).catch(res => {})
},
// 提交出租方式
submittype(e) {
this.data.types.value = e.detail.data;
this.setData({
types: this.data.types,
selectGroupIndex: null
})
this.clear_data()
},
// 提交区域
submitarea(e) {
let {
school,
location
} = e.detail;
this.data.school.value = school;
this.data.location.value = location;
this.setData({
location: this.data.location,
school: this.data.school,
selectGroupIndex: null
})
this.clear_data()
},
})

View File

@ -14,6 +14,8 @@
"ads": "../show/ads/ads",
"tab": "../personList/tab/tab",
"list-item": "../irentList/listItem/listItem",
"house-item": "/pages/restOfWorld/houseItem/houseItem"
"house-item": "/pages/restOfWorld/houseItem/houseItem",
"area-select": "/pages/personList/areaSelect/areaSelect"
}
}

View File

@ -7,7 +7,48 @@
<head-swiper attachment="{{ imgUrls }}"></head-swiper>
<tab StudentapartmentNew="{{ StudentapartmentNew}}" page="quarantineLists" listTab="{{ listTab }}"></tab>
<!-- 热词 -->
<view class="hot-text-box">
<view class="hot-text" wx:if="{{ groupSearch.length>0 }}">
<view class="{{ index===selectGroupIndex ? 'active item' :'item'}}" bindtap="selectGroup" data-index="{{ index }}" wx:for="{{ groupSearch }}" wx:key="index">{{ item['keyword'] }}</view>
</view>
</view>
<!-- 条件框 -->
<view class="condition-box" style="top:{{screen_data.totalTopHeight}}px">
<view class="tab">
<area-select title="区域" verifiedList="{{ verifiedList }}" school="{{ school.list }}" locationValue="{{ location.value }}" schoolValue="{{ school.value}}" img="tobottom" list="{{ location.data }}" bindsubmit="submitarea">
<view></view>
</area-select>
</view>
<view class="tab">
<select-more title="出租方式" img="tobottom" propertyValue="{{ types.value }}" list="{{ types.data }}" bindsubmit="submittype"></select-more>
</view>
<view class="tab">
<range-box title="租金区间(港元)" img="tobottom" bindsubmit="submitMoney" value1="{{ money.rent_min }}" value2="{{ money.rent_max }}">
<view wx:if="{{ money.rent_min || money.rent_max }}" class="bold">
{{ (money.rent_min || '') + '~' + (money.rent_max || '') }}
</view>
<block wx:if="{{ !money.rent_min && !money.rent_max}}">租金</block>
<image src="/img/tobottom-c.png" class="tobottom"></image>
</range-box>
</view>
<view class="tab" data-tab="timestamp">
<filtrate-box bindselectSubmit="myEventSelectSubmit" property="{{ property }}" value="{{ moreCondition.data }}">
<view class="{{ hascondition ? 'bold':''}}">
更多<image src="/img/filtrate.png" class="filtrate"></image>
</view>
</filtrate-box>
</view>
<view class="tab">
<select-single title="请选择排序方式" list="{{ orderby.list }}" value="{{ orderby.value }}" bindsubmit="submitOrderby"></select-single>
</view>
</view>
<!-- 列表数据 -->
<view class='house-list'>
<block wx:for="{{ data }}" wx:key="index">
<navigator wx:if="{{ !item.isad }}" url="/pages/show/show?tid={{ item.tid }}&uniqid={{ item.uniqid }}">
@ -17,6 +58,13 @@
<banner-ad wx:if="{{ item.isad && item.banner }}" index="{{ index }}" item="{{ item }}"></banner-ad>
<!-- <list-item item="{{ item }}" listTab="{{ listTab }}"></list-item> -->
</block>
<block wx:if="{{ data.length==0 && !loading }}">
<view class='nocontent'>
<image src="../../img/file.png" class='file'></image>
暂无数据
</view>
</block>
</view>
<view class="loading" hidden="{{ !loading }}">
<view></view>

View File

@ -1,5 +1,5 @@
/* pages/quarantineLists/quarantineLists.wxss */
.irent-list-box{
.irent-list-box {
/* background: #f2f2f2; */
min-height: 100vh;
padding-bottom: 80rpx;
@ -7,26 +7,30 @@
}
.house-list{
.house-list {
/* padding: 40rpx 30rpx 0; */
color: #333;
}
.hover{
.hover {
background: transparent
}
.bottom-already{
.bottom-already {
/* padding: 68rpx 0 0rpx; */
padding: 0;
text-align: center;
}
.bottom-already .text{
.bottom-already .text {
color: #999;
font-size: 24rpx;
}
.bottom-already .text::before,.bottom-already .text::after{
.bottom-already .text::before,
.bottom-already .text::after {
display: inline-block;
content: "";
width: 64rpx;
@ -35,18 +39,21 @@
vertical-align: middle;
margin: 0 32rpx;
}
.bottom-already .more{
.bottom-already .more {
padding: 52rpx 0 0;
color: #333;
font-size: 26rpx;
line-height: 42rpx;
}
.bottom-already .more .name{
.bottom-already .more .name {
display: inline-block;
margin-left: 6rpx;
font-weight: bold;
}
.bottom-already .more .btn{
.bottom-already .more .btn {
margin: 28rpx auto 0;
width: 192rpx;
height: 60rpx;
@ -55,7 +62,98 @@
background: #a8bed9;
color: #FFF;
}
.bottom-already .more .btn-a{
.bottom-already .more .btn-a {
background: #669bd0;
}
.hot-text-box {
min-height: 1px;
}
.hot-text {
padding: 18rpx 22rpx 38rpx;
display: flex;
flex-wrap: wrap;
background-color: #f5f5f5;
}
.hot-text .item {
display: inline-flex;
padding: 20rpx 26rpx;
margin: 20rpx 15rpx 0 0;
box-sizing: border-box;
border-radius: 15rpx;
background: #fff;
border: 2rpx solid #e4e4e4;
font-size: 22rpx;
color: #7a7a7a;
align-items: center;
justify-content: center;
height: 65rpx;
}
.hot-text .item.active {
color: #ffc05f;
border-color: #ffc05f;
background: #fff;
}
.condition-box {
display: flex;
padding: 0 30rpx;
justify-content: space-between;
align-items: center;
border-bottom: 15rpx solid #eee;
height: 113rpx;
background: #fff;
position: sticky;
z-index: 1002;
}
.condition-box .tab {
display: inline-flex;
position: relative;
justify-content: center;
align-items: center;
color: #666;
font-size: 24rpx;
box-sizing: border-box;
}
.bold {
font-weight: bold;
}
.condition-box .tab .filtrate {
width: 16rpx;
height: 18rpx;
margin-left: 8rpx;
}
.condition-box .tab .tobottom {
width: 12rpx;
height: 7rpx;
margin-left: 8rpx;
}
.tobottom {
width: 12rpx;
height: 7rpx;
display: inline-block;
vertical-align: middle;
}
.nocontent {
text-align: center;
font-size: 28rpx;
padding: 200rpx 0 0;
color: #999
}
.nocontent .file {
width: 40rpx;
height: 46rpx;
display: block;
margin: 0 auto 20rpx;
}

View File

@ -38,7 +38,7 @@
<view class="price">{{ item.rent }}</view>
<view class="unit">/{{ item.rentalperiod || '月' }}</view>
</view>
<view class="agent">
<view class="agent" wx:if="{{ item.intermediary_text }}">
{{ item.intermediary_text }}
</view>
<view class="r">

View File

@ -165,7 +165,6 @@ Component({
this.setData({
show:false
})
console.log('myEventDetail:', myEventDetail)
this.triggerEvent('selectSubmit', myEventDetail, myEventOption)
}