提交
This commit is contained in:
parent
86523cff25
commit
6ead2fce44
@ -35,6 +35,7 @@ Page({
|
||||
getLocationList: [], // 地区选项 配置数据
|
||||
|
||||
listData: [], // 列表数据
|
||||
listPage: 1, // 列表数据 页数
|
||||
listDataLeft: [], // 列表数据
|
||||
listDataRight: [], // 列表数据
|
||||
},
|
||||
@ -398,16 +399,20 @@ Page({
|
||||
// 获取列表数据
|
||||
getListData() {
|
||||
miucms.wxget(app.globalData.baseURL + "/tenement/v2/api/home/recommendList", {
|
||||
page: 1
|
||||
page: this.data.listPage,
|
||||
limit: 10
|
||||
}).then(res => {
|
||||
if (res.code != 200) return
|
||||
let data = res.data.data
|
||||
|
||||
let listData = this.data.listData
|
||||
listData.push(...data)
|
||||
this.setData({
|
||||
listPage: this.data.listPage + 1,
|
||||
listData: data
|
||||
})
|
||||
|
||||
this.query = wx.createSelectorQuery();
|
||||
this.listDataIndex = 0
|
||||
this.calculateProcessingCenter()
|
||||
})
|
||||
},
|
||||
@ -416,38 +421,26 @@ Page({
|
||||
leftHeight: 0, // px 单位
|
||||
rightHeight: 0,
|
||||
ratio: 0,
|
||||
query: null,
|
||||
|
||||
// 计算
|
||||
calculateProcessingCenter() {
|
||||
if (this.listDataIndex >= this.data.listData.length) {
|
||||
|
||||
this.setData({
|
||||
listDataLeft: this.data.listDataLeft,
|
||||
listDataRight: this.data.listDataRight
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
let type = targetData['type']
|
||||
if (type == 'adv') {
|
||||
this.getPictureHeight(targetData.image).then(res => {
|
||||
this.whichSide(res, targetData)
|
||||
return
|
||||
})
|
||||
} else {
|
||||
let altitude = 0 // rpx
|
||||
|
||||
if (type == 'apartment') {
|
||||
altitude = 105
|
||||
if (targetData['specifications'].length > 2) altitude += 100
|
||||
else altitude += 64 * targetData['specifications'].length
|
||||
} else {
|
||||
altitude = 141
|
||||
}
|
||||
} else altitude = 141
|
||||
|
||||
altitude = altitude * ratio // 转 px
|
||||
|
||||
@ -459,21 +452,22 @@ Page({
|
||||
altitude += res
|
||||
let select = type == 'apartment' ? '#apartment' : '#general'
|
||||
|
||||
this.query.select(select).boundingClientRect(rect => {
|
||||
let query = wx.createSelectorQuery();
|
||||
query.select(select).boundingClientRect(rect => {
|
||||
let height = rect.height;
|
||||
altitude += height
|
||||
this.whichSide(altitude, targetData)
|
||||
return
|
||||
}).exec();
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
console.log(this.data.listDataLeft, this.data.listDataRight);
|
||||
},
|
||||
|
||||
// 判断在哪边的
|
||||
whichSide(res, targetData) {
|
||||
console.log(this.leftHeight <= this.rightHeight, this.leftHeight, this.rightHeight);
|
||||
console.log(this.leftHeight, this.rightHeight, this.leftHeight <= this.rightHeight);
|
||||
if (this.leftHeight <= this.rightHeight) {
|
||||
this.leftHeight = this.leftHeight + res
|
||||
this.data.listDataLeft.push(targetData)
|
||||
@ -483,10 +477,14 @@ Page({
|
||||
}
|
||||
|
||||
this.setData({
|
||||
targetData: null
|
||||
listDataLeft: this.data.listDataLeft,
|
||||
listDataRight: this.data.listDataRight
|
||||
})
|
||||
this.listDataIndex++
|
||||
this.calculateProcessingCenter()
|
||||
|
||||
if (this.data.listData[this.listDataIndex]) {
|
||||
this.listDataIndex++
|
||||
this.calculateProcessingCenter()
|
||||
}
|
||||
},
|
||||
|
||||
// 获取图片高度
|
||||
@ -504,6 +502,9 @@ Page({
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
onReachBottom() {
|
||||
this.getListData()
|
||||
},
|
||||
|
||||
})
|
@ -10,9 +10,6 @@
|
||||
"card-person": "./cardPerson/cardPerson",
|
||||
"card-brands": "./cardBrands/cardBrands",
|
||||
"fix-footer": "../../template/fixFooter/fixFooter",
|
||||
"announcement-popup": "../../template/announcementPopup/announcementPopup",
|
||||
"me-waterfall": "/lib/waterfall/index",
|
||||
"me-waterfall-item": "/lib/waterfall-item/index"
|
||||
|
||||
"announcement-popup": "../../template/announcementPopup/announcementPopup"
|
||||
}
|
||||
}
|
@ -1,18 +1,16 @@
|
||||
<view class="container" wx:if="{{ !loding }}">
|
||||
<view class="">
|
||||
|
||||
<view class="" style="position: fixed;top: 0;right: 0;">
|
||||
<view id="apartment">
|
||||
<view class="apartment1-name">{{ targetData['title'] }}</view>
|
||||
<view class="apartment1-introduce">{{ targetData['propaganda'] }}</view>
|
||||
</view>
|
||||
<view class="general-name1 flexacenter" id="general">{{ targetData['title'] }}</view>
|
||||
</view>
|
||||
<view class="" id="apartment">
|
||||
<view class="apartment1-name">{{ targetData['title'] }}</view>
|
||||
<view class="apartment1-introduce">{{ targetData['propaganda'] }}</view>
|
||||
</view>
|
||||
<view class="general-name flexacenter" id="general">{{ targetData['title'] }}</view>
|
||||
|
||||
<!-- <header-nav inner-text="Some text" isIndexPage="index">寄托港校租房</header-nav> -->
|
||||
<header-nav inner-text="Some text" isIndexPage="index">{{ topTitle }}</header-nav>
|
||||
|
||||
<!-- 新的 首页轮播图 -->
|
||||
<block wx:if="{{ envVersionState && false }}">
|
||||
<block wx:if="{{ envVersionState && true }}">
|
||||
<!-- 搜索框 -->
|
||||
<view class="search-box flexacenter">
|
||||
<image mode="widthFix" class="search-img" src="/img/search-icon.png"></image>
|
||||
@ -93,7 +91,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 区域选择 新 -->
|
||||
<view class="area-selection" wx:if="{{ envVersionState && false }}">
|
||||
<view class="area-selection" wx:if="{{ envVersionState && true }}">
|
||||
<view class="head flexacenter shadow">
|
||||
<!-- <view class="head-item flexcenter flex1 {{ index == areaIndex ? 'pitch' : '' }}" wx:for="{{ combination }}" wx:key="index" bindtap="setValue" data-key="areaIndex" data-value="{{ index }}"> -->
|
||||
<view class="head-item flexflex flex1 {{ index == areaIndex ? 'pitch' : '' }}" wx:for="{{ combination }}" wx:key="index" bindtap="setValue" data-key="areaIndex" data-value="{{ index }}">
|
||||
@ -185,126 +183,128 @@
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 个人房源 -->
|
||||
<view class="house-block">
|
||||
<navigator url="/pages/personList/personList" hover-class="hover" class="title">
|
||||
<view>个人房源</view>
|
||||
<view class="more">
|
||||
more
|
||||
<image src="/img/more-yellow.png"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
<scroll-view scroll-x="true" class="scroll">
|
||||
<view class="inner-scroll">
|
||||
<block wx:for="{{ HKhousing }}" wx:key="index">
|
||||
<block wx:if="{{ index<HKhousing.length-1 }}">
|
||||
<!-- 非广告 -->
|
||||
<navigator class="item" hover-class="hover" url="/pages/show/show?tid={{ item.tid }}&uniqid={{ item.uniqid }}&cityid=1" wx:if="{{ !advListHKhousing[index+1] }}">
|
||||
<view class="card">
|
||||
<card-person isads="{{false}}" item="{{ item }}"></card-person>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 广告 -->
|
||||
<navigator class="item" hover-class="hover" url="/{{ advListHKhousing[index+1].path }}" wx:if="{{ advListHKhousing[index+1] }}">
|
||||
<view class="card">
|
||||
<card-person bindcloseAd="closeAd" bindclickAD="clickAD" isads="true" item="{{ advListHKhousing[index+1] }}"></card-person>
|
||||
</view>
|
||||
</navigator>
|
||||
<block wx:if="{{ false }}">
|
||||
<!-- 个人房源 -->
|
||||
<view class="house-block">
|
||||
<navigator url="/pages/personList/personList" hover-class="hover" class="title">
|
||||
<view>个人房源</view>
|
||||
<view class="more">
|
||||
more
|
||||
<image src="/img/more-yellow.png"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
<scroll-view scroll-x="true" class="scroll">
|
||||
<view class="inner-scroll">
|
||||
<block wx:for="{{ HKhousing }}" wx:key="index">
|
||||
<block wx:if="{{ index<HKhousing.length-1 }}">
|
||||
<!-- 非广告 -->
|
||||
<navigator class="item" hover-class="hover" url="/pages/show/show?tid={{ item.tid }}&uniqid={{ item.uniqid }}&cityid=1" wx:if="{{ !advListHKhousing[index+1] }}">
|
||||
<view class="card">
|
||||
<card-person isads="{{false}}" item="{{ item }}"></card-person>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 广告 -->
|
||||
<navigator class="item" hover-class="hover" url="/{{ advListHKhousing[index+1].path }}" wx:if="{{ advListHKhousing[index+1] }}">
|
||||
<view class="card">
|
||||
<card-person bindcloseAd="closeAd" bindclickAD="clickAD" isads="true" item="{{ advListHKhousing[index+1] }}"></card-person>
|
||||
</view>
|
||||
</navigator>
|
||||
</block>
|
||||
|
||||
</block>
|
||||
|
||||
</block>
|
||||
<navigator class="item" hover-class="hover" url="/pages/personList/personList" wx:if="{{ HKhousing.length>0}}">
|
||||
<view class="card">
|
||||
<card-person item="{{ HKhousing[HKhousing.length-1] }}"></card-person>
|
||||
</view>
|
||||
<view class="last-child">
|
||||
<view class="btn">查看更多
|
||||
<image src="/img/more-white.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="right"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 品牌公寓 -->
|
||||
<view class="house-block house-brands">
|
||||
<navigator url="/pages/irentList/irentList" hover-class="hover" class="title">
|
||||
<view>品牌公寓</view>
|
||||
<view class="more">
|
||||
more
|
||||
<image src="/img/more-blue.png"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
<scroll-view scroll-x="true" class="scroll">
|
||||
<view class="inner-scroll">
|
||||
<block wx:for="{{ HKapartment }}" wx:key="index">
|
||||
<navigator class="item" hover-class="hover" url="/pages/irentDetail/irentDetail?uniqid={{item.uniqid}}" wx:if="{{ index<HKapartment.length-1 }}">
|
||||
<navigator class="item" hover-class="hover" url="/pages/personList/personList" wx:if="{{ HKhousing.length>0}}">
|
||||
<view class="card">
|
||||
<card-brands bindplay="play" item="{{ item }}" index="{{ index }}"></card-brands>
|
||||
<card-person item="{{ HKhousing[HKhousing.length-1] }}"></card-person>
|
||||
</view>
|
||||
<view class="last-child">
|
||||
<view class="btn">查看更多
|
||||
<image src="/img/more-white.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</block>
|
||||
<navigator class="item" hover-class="hover" url="/pages/irentList/irentList" wx:if="{{ HKapartment.length>0}}">
|
||||
<view class="card">
|
||||
<card-brands bindplay="play" item="{{ HKapartment[HKapartment.length-1] }}"></card-brands>
|
||||
</view>
|
||||
<view class="last-child">
|
||||
<view class="btn">查看更多
|
||||
<image src="/img/more-white.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="right"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="right"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 世界各地房源 -->
|
||||
<view wx:if="{{ otherHousing.length>0 }}" class="house-block world-block">
|
||||
<navigator url="/pages/restOfWorld/restOfWorld" hover-class="hover" class="title">
|
||||
<!-- <view>世界各地房源</view> -->
|
||||
<view>求房源</view>
|
||||
<view class="more">
|
||||
more
|
||||
<image src="/img/more-green.png"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
<scroll-view scroll-x="true" class="scroll">
|
||||
<view class="inner-scroll">
|
||||
<!-- <block wx:for="{{ otherHousing }}" wx:key="index"> -->
|
||||
<block wx:for="{{ findHouseSource }}" wx:key="index">
|
||||
<block wx:if="{{ index<otherHousing.length-1 }}">
|
||||
<!-- 非广告 -->
|
||||
<navigator class="item" hover-class="hover" url="/pages/show/show?tid={{ item.tid }}&uniqid={{ item.uniqid }}" wx:if="{{ !advListotherHousing[index+1] }}">
|
||||
<!-- 品牌公寓 -->
|
||||
<view class="house-block house-brands">
|
||||
<navigator url="/pages/irentList/irentList" hover-class="hover" class="title">
|
||||
<view>品牌公寓</view>
|
||||
<view class="more">
|
||||
more
|
||||
<image src="/img/more-blue.png"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
<scroll-view scroll-x="true" class="scroll">
|
||||
<view class="inner-scroll">
|
||||
<block wx:for="{{ HKapartment }}" wx:key="index">
|
||||
<navigator class="item" hover-class="hover" url="/pages/irentDetail/irentDetail?uniqid={{item.uniqid}}" wx:if="{{ index<HKapartment.length-1 }}">
|
||||
<view class="card">
|
||||
<card-person world="true" bindclickAD="clickAD" bindcloseAd="closeAd" isads="{{ false }}" item="{{ item }}"></card-person>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 广告 -->
|
||||
<navigator class="item" hover-class="hover" url="/{{ advListotherHousing[index+1].path}}" wx:if="{{ advListotherHousing[index+1] }}">
|
||||
<view class="card">
|
||||
<card-person world="true" bindclickAD="clickAD" bindcloseAd="closeAd" isads="{{ true }}" item="{{ advListotherHousing[index+1] }}"></card-person>
|
||||
<card-brands bindplay="play" item="{{ item }}" index="{{ index }}"></card-brands>
|
||||
</view>
|
||||
</navigator>
|
||||
</block>
|
||||
|
||||
</block>
|
||||
<navigator class="item" hover-class="hover" url="/pages/restOfWorld/restOfWorld" wx:if="{{ otherHousing.length>0}}">
|
||||
<view class="card">
|
||||
<card-person world="true" item="{{ otherHousing[otherHousing.length-1] }}"></card-person>
|
||||
</view>
|
||||
<view class="last-child">
|
||||
<view class="btn">查看更多
|
||||
<image src="/img/more-white.png"></image>
|
||||
<navigator class="item" hover-class="hover" url="/pages/irentList/irentList" wx:if="{{ HKapartment.length>0}}">
|
||||
<view class="card">
|
||||
<card-brands bindplay="play" item="{{ HKapartment[HKapartment.length-1] }}"></card-brands>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="right"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="last-child">
|
||||
<view class="btn">查看更多
|
||||
<image src="/img/more-white.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="right"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 世界各地房源 -->
|
||||
<view wx:if="{{ otherHousing.length>0 }}" class="house-block world-block">
|
||||
<navigator url="/pages/restOfWorld/restOfWorld" hover-class="hover" class="title">
|
||||
<!-- <view>世界各地房源</view> -->
|
||||
<view>求房源</view>
|
||||
<view class="more">
|
||||
more
|
||||
<image src="/img/more-green.png"></image>
|
||||
</view>
|
||||
</navigator>
|
||||
<scroll-view scroll-x="true" class="scroll">
|
||||
<view class="inner-scroll">
|
||||
<!-- <block wx:for="{{ otherHousing }}" wx:key="index"> -->
|
||||
<block wx:for="{{ findHouseSource }}" wx:key="index">
|
||||
<block wx:if="{{ index<otherHousing.length-1 }}">
|
||||
<!-- 非广告 -->
|
||||
<navigator class="item" hover-class="hover" url="/pages/show/show?tid={{ item.tid }}&uniqid={{ item.uniqid }}" wx:if="{{ !advListotherHousing[index+1] }}">
|
||||
<view class="card">
|
||||
<card-person world="true" bindclickAD="clickAD" bindcloseAd="closeAd" isads="{{ false }}" item="{{ item }}"></card-person>
|
||||
</view>
|
||||
</navigator>
|
||||
<!-- 广告 -->
|
||||
<navigator class="item" hover-class="hover" url="/{{ advListotherHousing[index+1].path}}" wx:if="{{ advListotherHousing[index+1] }}">
|
||||
<view class="card">
|
||||
<card-person world="true" bindclickAD="clickAD" bindcloseAd="closeAd" isads="{{ true }}" item="{{ advListotherHousing[index+1] }}"></card-person>
|
||||
</view>
|
||||
</navigator>
|
||||
</block>
|
||||
|
||||
</block>
|
||||
<navigator class="item" hover-class="hover" url="/pages/restOfWorld/restOfWorld" wx:if="{{ otherHousing.length>0}}">
|
||||
<view class="card">
|
||||
<card-person world="true" item="{{ otherHousing[otherHousing.length-1] }}"></card-person>
|
||||
</view>
|
||||
<view class="last-child">
|
||||
<view class="btn">查看更多
|
||||
<image src="/img/more-white.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
<view class="right"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 服务号推广 -->
|
||||
<image mode='widthFix' show-menu-by-longpress class="popularize" src="{{ service }}" bindtap="copy"></image>
|
||||
|
@ -954,20 +954,20 @@
|
||||
|
||||
.apartment1-name {
|
||||
font-size: 27rpx;
|
||||
color: #000000;
|
||||
color: transparent;
|
||||
font-weight: 650;
|
||||
padding: 13.5rpx 15rpx;
|
||||
}
|
||||
|
||||
.apartment1-introduce {
|
||||
color: #aaaaaa;
|
||||
color: transparent;
|
||||
font-size: 21rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
|
||||
.general-name1 {
|
||||
font-size: 27rpx;
|
||||
color: #000000;
|
||||
color: transparent;
|
||||
line-height: 48rpx;
|
||||
padding: 0 15rpx;
|
||||
display: -webkit-box;
|
||||
|
Loading…
x
Reference in New Issue
Block a user