提交
This commit is contained in:
parent
397ef17b2a
commit
f7ed029d79
@ -458,17 +458,14 @@ Page({
|
||||
type: this.data.listType,
|
||||
pagevalue: this.data.pagevalue || 0,
|
||||
}).then(res => {
|
||||
this.getListDataState = false
|
||||
// this.getListDataState = false
|
||||
|
||||
if (res.code != 200) return
|
||||
let data = res.data.data
|
||||
|
||||
let pagevalue = res.data.pagevalue
|
||||
let listType = this.data.listType
|
||||
let recommendedTab = this.data.recommendedTab
|
||||
recommendedTab.forEach(el => {
|
||||
// if (el.type == listType) el['pagevalue'] = pagevalue
|
||||
})
|
||||
|
||||
|
||||
this.setData({
|
||||
listPage: this.data.listPage + 1,
|
||||
@ -480,8 +477,9 @@ Page({
|
||||
this.listDataIndex = 0
|
||||
this.calculateProcessingCenter()
|
||||
|
||||
}).finally(() => {
|
||||
}).catch(() => {
|
||||
this.getListDataState = false
|
||||
}).finally(() => {
|
||||
wx.hideLoading()
|
||||
})
|
||||
},
|
||||
@ -496,7 +494,10 @@ Page({
|
||||
let ratio = this.ratio
|
||||
if (this.ratio) this.ratio = this.data.screen_data['windowWidth'] / 750
|
||||
let targetData = this.data.listData[this.listDataIndex]
|
||||
if (!targetData) return
|
||||
if (!targetData) {
|
||||
this.getListDataState = false
|
||||
return
|
||||
}
|
||||
let type = targetData['type']
|
||||
if (type == 'adv') {
|
||||
this.getPictureHeight(targetData.image).then(res => {
|
||||
@ -548,6 +549,7 @@ Page({
|
||||
listDataRight: this.data.listDataRight
|
||||
})
|
||||
|
||||
|
||||
if (this.data.listData[this.listDataIndex]) {
|
||||
this.listDataIndex++
|
||||
this.calculateProcessingCenter()
|
||||
|
@ -391,7 +391,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</page-container>
|
||||
|
||||
|
||||
<announcement-popup interface="home" init="{{ initState }}"></announcement-popup>
|
||||
</view>
|
||||
|
||||
|
@ -64,7 +64,8 @@ Page({
|
||||
initState: false,
|
||||
topTitle: "",
|
||||
|
||||
isNewVersions: false,
|
||||
|
||||
isNewVersions: true,
|
||||
},
|
||||
onPageScroll(e) {
|
||||
if (e.scrollTop > 1000 && !this.data.showTOTOP) {
|
||||
@ -361,7 +362,9 @@ Page({
|
||||
},
|
||||
// 租金条件筛选提交
|
||||
submitMoney(e) {
|
||||
console.log(e);
|
||||
this.data.money = Object.assign({}, e.detail);
|
||||
|
||||
this.setData({
|
||||
selectGroupIndex: null,
|
||||
money: this.data.money
|
||||
@ -469,13 +472,10 @@ Page({
|
||||
submitOperations(e) {
|
||||
console.log("e", e);
|
||||
let type = e.detail.type
|
||||
console.log(type, "type");
|
||||
if (type == 'brand') this.submitBrands(e)
|
||||
if (type == 'rent') this.submitMoney(e)
|
||||
if (type == 'house') this.submitRoomtype(e)
|
||||
if (type == 'floor') this.submitRoomlistings(e)
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
@ -31,8 +31,8 @@
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block wx:if="{{ false }}">
|
||||
<list-operations brands="{{ brands }}" screen_data="{{ screen_data }}" roomtype="{{ roomtype }}" roomlistings="{{ roomlistings }}" bindsubmit="submitOperations"></list-operations>
|
||||
<block wx:if="{{ true }}">
|
||||
<list-operations operationstype="student" money="{{ money }}" brands="{{ brands }}" screen_data="{{ screen_data }}" roomtype="{{ roomtype }}" roomlistings="{{ roomlistings }}" bindsubmit="submitOperations"></list-operations>
|
||||
</block>
|
||||
|
||||
<!-- 条件框 -->
|
||||
|
@ -366,7 +366,6 @@ Page({
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
console.log(groupSearch[i].where[j], "j", j);
|
||||
if (groupSearch[i].where[j] != that.data[j].value) {
|
||||
ishere = false;
|
||||
break;
|
||||
|
@ -15,6 +15,7 @@
|
||||
"ads": "../show/ads/ads",
|
||||
"tab": "./tab/tab",
|
||||
"announcement-popup": "/template/announcementPopup/announcementPopup",
|
||||
"common-list":"/template/commonList/commonList"
|
||||
"common-list": "/template/commonList/commonList",
|
||||
"list-operations": "/template/listOperations/listOperations"
|
||||
}
|
||||
}
|
@ -15,6 +15,11 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 新的 -->
|
||||
<block wx:if="{{ true }}">
|
||||
<list-operations location="{{ location }}" operationstype="housing" money="{{ money }}" brands="{{ brands }}" screen_data="{{ screen_data }}" roomtype="{{ roomtype }}" roomlistings="{{ roomlistings }}" bindsubmit="submitOperations"></list-operations>
|
||||
</block>
|
||||
|
||||
<!-- 条件框 -->
|
||||
<view class="condition-box" style="top:{{screen_data.totalTopHeight}}px">
|
||||
<view class="tab">
|
||||
|
@ -5,10 +5,25 @@ Component({
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
brands: Object,
|
||||
roomtype: Object,
|
||||
roomlistings: Object,
|
||||
brands: Object,
|
||||
screen_data: Object,
|
||||
money: Object,
|
||||
|
||||
operationstype: {
|
||||
type: String,
|
||||
observer(res) {
|
||||
let conditionAllConfig = this.data.conditionAllConfig
|
||||
|
||||
this.setData({
|
||||
conditionObj: conditionAllConfig[res]
|
||||
})
|
||||
|
||||
console.log("conditionObj", this.data.conditionObj);
|
||||
}
|
||||
},
|
||||
location: Object,
|
||||
|
||||
},
|
||||
|
||||
@ -16,24 +31,63 @@ Component({
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
conditionState: "rent", // brand rent house floor
|
||||
conditionObj: {
|
||||
brand: {
|
||||
name: "品牌",
|
||||
valueText: "brands"
|
||||
},
|
||||
rent: {
|
||||
name: "租金",
|
||||
},
|
||||
house: {
|
||||
name: "房型",
|
||||
valueText: "roomtype"
|
||||
},
|
||||
floor: {
|
||||
name: "楼型",
|
||||
valueText: "roomlistings"
|
||||
conditionState: "school", // brand rent house floor school
|
||||
conditionAllConfig: {
|
||||
student: {
|
||||
brand: {
|
||||
name: "品牌",
|
||||
valueKey: "brands"
|
||||
},
|
||||
rent: {
|
||||
name: "租金",
|
||||
},
|
||||
house: {
|
||||
name: "房型",
|
||||
valueKey: "roomtype"
|
||||
},
|
||||
floor: {
|
||||
name: "楼型",
|
||||
valueKey: "roomlistings"
|
||||
},
|
||||
},
|
||||
housing: {
|
||||
school: {
|
||||
name: "区域",
|
||||
valueKey: "brands"
|
||||
},
|
||||
types: {
|
||||
name: "出租方式",
|
||||
valueKey: "types"
|
||||
},
|
||||
rent: {
|
||||
name: "租金",
|
||||
},
|
||||
moreCondition: {
|
||||
name: "更多",
|
||||
valueKey: "brands"
|
||||
},
|
||||
orderby: {
|
||||
name: "最新",
|
||||
valueKey: "brands"
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
conditionObj: {},
|
||||
|
||||
rent: {
|
||||
min: 1000,
|
||||
max: 50000,
|
||||
rate: 490,
|
||||
defaultMin: 50, //
|
||||
defaultMax: 80,
|
||||
step: 100,
|
||||
for: 491
|
||||
},
|
||||
|
||||
rentValue: [40, 80],
|
||||
|
||||
areaState: "area", // area school
|
||||
},
|
||||
|
||||
/**
|
||||
@ -52,18 +106,59 @@ Component({
|
||||
|
||||
changeItem(e) {
|
||||
let conditionState = this.data.conditionState
|
||||
console.log(e, conditionState);
|
||||
let {
|
||||
value,
|
||||
} = e.currentTarget.dataset
|
||||
|
||||
let conditionObj = this.data.conditionObj
|
||||
let valueKey = conditionObj[conditionState].valueKey
|
||||
let obj = this.data[valueKey].obj
|
||||
conditionObj[conditionState]['valueText'] = obj[value]
|
||||
|
||||
this.triggerEvent('submit', {
|
||||
type: conditionState,
|
||||
value
|
||||
})
|
||||
|
||||
this.setData({
|
||||
conditionState: ""
|
||||
conditionState: "",
|
||||
conditionObj
|
||||
})
|
||||
},
|
||||
|
||||
// 滑动租金数据 事件
|
||||
bindChangeRent(e) {
|
||||
let value = e.detail.value
|
||||
this.setData({
|
||||
rentValue: value
|
||||
})
|
||||
},
|
||||
|
||||
// 处理 租金的 事件
|
||||
handleRant(e) {
|
||||
let type = e.currentTarget.dataset.type
|
||||
let conditionState = this.data.conditionState
|
||||
let rentValue = this.data.rentValue
|
||||
let rent = this.data.rent
|
||||
rentValue.sort()
|
||||
let rent_min = 0
|
||||
let rent_max = 0
|
||||
let conditionObj = this.data.conditionObj
|
||||
if (type != 'unlimited') {
|
||||
rent_min = (rentValue[0] * rent['step']) + rent['min']
|
||||
rent_max = (rentValue[1] * rent['step']) + rent['min']
|
||||
conditionObj[conditionState]['valueText'] = `${rent_min} ~ ${rent_max}`
|
||||
}
|
||||
|
||||
this.triggerEvent('submit', {
|
||||
type: conditionState,
|
||||
rent_min,
|
||||
rent_max,
|
||||
})
|
||||
|
||||
this.setData({
|
||||
conditionState: "",
|
||||
conditionObj
|
||||
})
|
||||
},
|
||||
}
|
||||
|
@ -1,20 +1,26 @@
|
||||
<!--template/listOperations/listOperations.wxml-->
|
||||
<view class="page-action-bar flexacenter">
|
||||
<view class="page-action-item flex1 flexcenter bold" bindtap="setValue" data-key="conditionState" data-value="{{ index }}" wx:for="{{ conditionObj }}" wx:key="index">
|
||||
<block wx:if="{{ index == 'brand' && brands.value }}">{{ brands.obj[brands.value] }}</block>
|
||||
<block wx:elif="{{ index == 'rent' && brands.value }}">{{ brands.obj[brands.value] }}</block>
|
||||
<block wx:for="{{ conditionObj }}" wx:key="index">
|
||||
<view class="page-action-item flexcenter bold" bindtap="setValue" data-key="conditionState" data-value="{{ index }}">
|
||||
<!-- <block wx:if="{{ index == 'brand' && brands.value }}">{{ brands.obj[brands.value] }}</block>
|
||||
<block wx:elif="{{ index == 'rent' && money.rent_min }}">{{ (money.rent_min || '') + '~' + (money.rent_max || '') }}</block>
|
||||
<block wx:elif="{{ index == 'house' && roomtype.value }}">{{ roomtype.obj[roomtype.value] }}</block>
|
||||
<block wx:elif="{{ index == 'floor' && roomlistings.value }}">{{ roomlistings.obj[roomlistings.value] }}</block>
|
||||
<view wx:else class="unselected">{{ item.name }}</view>
|
||||
<block wx:elif="{{ index == 'floor' && roomlistings.value }}">{{ roomlistings.obj[roomlistings.value] }}</block> -->
|
||||
|
||||
<block wx:if="{{ item['valueText'] }}">
|
||||
{{ item['valueText'] }}
|
||||
</block>
|
||||
<view wx:else class="unselected">{{ item.name }}</view>
|
||||
|
||||
<view class="page-action-circle flexcenter">
|
||||
<image class="page-action-circle-icon" mode="widthFix" src="/img/arrow-gray.png"></image>
|
||||
</view>
|
||||
|
||||
<view class="page-action-circle flexcenter">
|
||||
<image class="page-action-circle-icon" mode="widthFix" src="/img/arrow-gray.png"></image>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="longString" wx:if="{{ index != 'floor' && index != 'orderby' }}"></view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
|
||||
<page-container show="{{ conditionState }}" z-index="{{ 2000 }}" class="page-container" position="{{ 'top' }}" bind:clickoverlay="setValue" data-key="conditionState" data-value="">
|
||||
<view class="page-header flexacenter" style="height: {{ screen_data.totalTopHeight}}px;">
|
||||
<view class="page-statusBar" style="height: {{ screen_data.statusBarHeight }}px;"></view>
|
||||
@ -44,7 +50,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="page-title flexcenter">{{ conditionObj[conditionState].name }}</view>
|
||||
<view class="page-title flexcenter" wx:if="{{ conditionState != 'school' }}">{{ conditionObj[conditionState].name }}</view>
|
||||
|
||||
<block wx:if="{{ conditionState == 'brand' }}">
|
||||
<view class="page-list two-rows-list flexflex">
|
||||
@ -53,22 +59,26 @@
|
||||
</block>
|
||||
|
||||
<block wx:elif="{{ conditionState == 'rent' }}">
|
||||
<picker-view indicator-class="rent-budget-picker" indicator-style="height: 50px;" style="width: 100%; height: 670rpx;margin: 0 0 100rpx;" immediate-change="{{ true }}" bindchange="bindChangeRent">
|
||||
<picker-view-column class="picker-view-column">
|
||||
<!-- <view wx:for="{{ 10 }}" wx:for-item="it" wx:key="key" class="{{ index == item['value'][0] ? 'pickerpitch' : ''}}">{{ item }}</view> -->
|
||||
<view class="pickerpitch" wx:for="{{ 100 }}" wx:for-item="it" wx:key="key">{{ it }}</view>
|
||||
</picker-view-column>
|
||||
<view class="rent-budget-tilde flexcenter">
|
||||
<view class="flexcenter">~</view>
|
||||
</view>
|
||||
<picker-view-column class="picker-view-column">
|
||||
<view class="pickerpitch" wx:for="{{ 10 }}" wx:for-item="it" wx:key="key">{{ it }}</view>
|
||||
</picker-view-column>
|
||||
</picker-view>
|
||||
<view class="" style="position: relative;">
|
||||
<view class="rent-unit flexcenter">HK$/月</view>
|
||||
|
||||
<picker-view indicator-class="rent-budget-picker" indicator-style="height: 50px;" style="width: 100%; height: 670rpx;margin: 0 0 100rpx;position: relative;" immediate-change="{{ true }}" value="{{ rentValue }}" bindchange="bindChangeRent">
|
||||
<picker-view-column class="picker-view-column">
|
||||
<view class="pickerpitch" wx:for="{{ rent['for'] }}" wx:for-item="it" wx:key="key">{{ rent.min + (it * rent.step) }}</view>
|
||||
</picker-view-column>
|
||||
<view class="rent-budget-tilde flexcenter">
|
||||
<view class="flexcenter">~</view>
|
||||
</view>
|
||||
<picker-view-column class="picker-view-column">
|
||||
<view class="pickerpitch" wx:for="{{ rent['for'] }}" wx:for-item="it" wx:key="key">{{ rent.min + (it * rent.step) }}</view>
|
||||
</picker-view-column>
|
||||
|
||||
</picker-view>
|
||||
</view>
|
||||
|
||||
<view class="rent-budget-bottom flexacenter">
|
||||
<view class="rent-budget-bottom-item flexcenter">不限</view>
|
||||
<view class="rent-budget-bottom-item flexcenter">确定</view>
|
||||
<view class="rent-budget-bottom-item flexcenter" bindtap="handleRant" data-type="unlimited">不限</view>
|
||||
<view class="rent-budget-bottom-item confirm flexcenter" bindtap="handleRant">确定</view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
@ -84,4 +94,23 @@
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block wx:elif="{{ conditionState == 'school' }}">
|
||||
<view class="area-box flexflex">
|
||||
<view class="area-left">
|
||||
<view class="area-item flexcenter {{ areaState == 'area' ? 'pitch' : '' }}">按区域</view>
|
||||
<view class="area-item flexcenter {{ areaState == 'school' ? 'pitch' : '' }}">按学校</view>
|
||||
</view>
|
||||
<view class="area-centre">
|
||||
<scroll-view>
|
||||
|
||||
</scroll-view>
|
||||
<view wx:for="{{ location.data }}" wx:key="index" class="area-item flexcenter">{{ item }}</view>
|
||||
</view>
|
||||
<view class="area-right flex1">
|
||||
<view wx:for="{{ 3 }}" wx:key="index" class="area-item flexcenter">-1</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
|
||||
</page-container>
|
@ -38,15 +38,36 @@
|
||||
height: 96rpx;
|
||||
border-bottom: 1rpx solid #ebebeb;
|
||||
position: relative;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.page-action-bar .longString {
|
||||
width: 1rpx;
|
||||
height: 24rpx;
|
||||
background-color: #ebebeb;
|
||||
}
|
||||
|
||||
.page-action-bar .page-action-item {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
color: #000;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* .page-action-bar .page-action-item:not(:last-of-type):after {
|
||||
width: 1rpx;
|
||||
height: 24rpx;
|
||||
background-color: #ebebeb;
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
transform: translateY(-50%);
|
||||
} */
|
||||
|
||||
.page-action-bar .page-action-item .unselected {
|
||||
font-weight: normal;
|
||||
color: #7F7F7F;
|
||||
}
|
||||
|
||||
.page-action-bar .page-action-circle.pitch {
|
||||
@ -157,6 +178,19 @@
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.rent-unit {
|
||||
width: 108rpx;
|
||||
height: 36rpx;
|
||||
border-radius: 8rpx;
|
||||
background-color: #000;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 30rpx;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
|
||||
.picker-view-column {
|
||||
text-align: center;
|
||||
@ -179,13 +213,44 @@
|
||||
}
|
||||
|
||||
.rent-budget-bottom {
|
||||
justify-content: space-between
|
||||
justify-content: space-between;
|
||||
padding: 36rpx 30rpx;
|
||||
border-top: 1rpx solid #ebebeb;
|
||||
}
|
||||
|
||||
.rent-budget-bottom .rent-budget-bottom-item {
|
||||
/* background-color: ; */
|
||||
width: 330rpx;
|
||||
height: 96rpx;
|
||||
border-radius: 82.5rpx;
|
||||
border: 1rpx solid rgba(215, 215, 215, 1);
|
||||
font-size: 36rpx;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.rent-budget-bottom .rent-budget-bottom-item.confirm {
|
||||
border: none;
|
||||
background-color: rgba(98, 177, 255, 1);
|
||||
font-weight: 650;
|
||||
font-size: 36rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.area-box {}
|
||||
|
||||
.area-box .area-item {
|
||||
/* background-color: #50E3C2; */
|
||||
height: 120rpx;
|
||||
}
|
||||
|
||||
.area-box .area-left {
|
||||
background-color: rgba(215, 215, 215, 0.501960784313725);
|
||||
}
|
||||
|
||||
.area-box .area-left .area-item.pitch {
|
||||
background-color: rgba(246, 246, 246, 1);
|
||||
}
|
||||
|
||||
.area-box .area-left .area-item,
|
||||
.area-box .area-centre .area-item {
|
||||
width: 150rpx;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user