|
@ -55,14 +55,17 @@ |
|
|
<view class="ant-page-span">品质保障</view> |
|
|
<view class="ant-page-span">品质保障</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="ant-flex-line"> |
|
|
|
|
|
<view class="ant-page-image-item" v-for="(item,index) in hotList"> |
|
|
|
|
|
<image class="ant-page-image-item" mode="aspectFill" :src="item.image === null? image:item.image"/> |
|
|
|
|
|
<view class="ant-img-tags"> |
|
|
|
|
|
<!-- <view class="ant-tags-title">{{item.title}}</view> --> |
|
|
|
|
|
<view class="ant-tags-text">{{item.price}}元起</view> |
|
|
|
|
|
|
|
|
<view class="ant-flex-line scroll-view_H_x"> |
|
|
|
|
|
<scroll-view class="scroll-view_H" scroll-x="true" lower-threshold="51" @scrolltolower="scrollTolowerHotList" > |
|
|
|
|
|
<view class="ant-page-image-item" v-for="(item,index) in hotList"> |
|
|
|
|
|
<image class="ant-page-image-item" mode="aspectFill" :src="item.image === null? image:item.image"/> |
|
|
|
|
|
<view class="ant-img-tags"> |
|
|
|
|
|
<!-- <view class="ant-tags-title">{{item.title}}</view> --> |
|
|
|
|
|
<view class="ant-tags-text">{{item.price}}元起</view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</scroll-view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
@ -114,6 +117,9 @@ |
|
|
page: 1, |
|
|
page: 1, |
|
|
total: null, |
|
|
total: null, |
|
|
is_pull: 1, // 1是下拉刷新 2是上拉加载 |
|
|
is_pull: 1, // 1是下拉刷新 2是上拉加载 |
|
|
|
|
|
scrollPage: 1, //横向滚动 |
|
|
|
|
|
scrollSize:20, |
|
|
|
|
|
scrollTotal:null, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
@ -131,9 +137,18 @@ |
|
|
// 上拉加载 |
|
|
// 上拉加载 |
|
|
onReachBottom() { |
|
|
onReachBottom() { |
|
|
this.is_pull = 2; |
|
|
this.is_pull = 2; |
|
|
|
|
|
const page = this.page; |
|
|
|
|
|
const size = this.size; |
|
|
|
|
|
const total = this.total; |
|
|
// 写下限制重复发 以及最后一页 |
|
|
// 写下限制重复发 以及最后一页 |
|
|
|
|
|
if(page * size > total) { |
|
|
|
|
|
this.$functions.showToast('没有更多了') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
this.getHouseListPage() |
|
|
this.getHouseListPage() |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 好房源 向右加载 |
|
|
|
|
|
|
|
|
// 隐藏微信h5的标题栏 |
|
|
// 隐藏微信h5的标题栏 |
|
|
onReady() { |
|
|
onReady() { |
|
|
|
|
|
|
|
@ -178,10 +193,35 @@ |
|
|
// console.log(res.records) |
|
|
// console.log(res.records) |
|
|
// }) |
|
|
// }) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 向右滚动加载好房源 |
|
|
|
|
|
scrollTolowerHotList () { |
|
|
|
|
|
// 是否已经是最后 |
|
|
|
|
|
const scrollPage = this.scrollPage; |
|
|
|
|
|
const scrollSize = this.scrollSize; |
|
|
|
|
|
const scrollTotal = this.scrollTotal; |
|
|
|
|
|
if(scrollPage* scrollSize > scrollTotal) { |
|
|
|
|
|
this.$functions.showToast('没有更多了'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
this.$functions.showLoading(); |
|
|
|
|
|
this.getHotList(); |
|
|
|
|
|
}, |
|
|
//获取好房源 |
|
|
//获取好房源 |
|
|
getHotList(){ |
|
|
getHotList(){ |
|
|
|
|
|
|
|
|
this.$api.getHotList().then(res => { |
|
|
this.$api.getHotList().then(res => { |
|
|
|
|
|
if(this.scrollTotal !== null){ |
|
|
|
|
|
this.scrollPage+=1; |
|
|
|
|
|
const hotList = this.hotList; |
|
|
|
|
|
this.hotList = hotList.concat(res.result.records); |
|
|
|
|
|
this.$functions.hideLoading(); |
|
|
|
|
|
}else if(this.scrollTotal === null) { |
|
|
|
|
|
this.scrollSize = res.result.size; |
|
|
|
|
|
this.scrollTotal = res.result.total; |
|
|
this.hotList = res.result.records; |
|
|
this.hotList = res.result.records; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
console.log(err,"错误信息") |
|
|
console.log(err,"错误信息") |
|
|
}); |
|
|
}); |
|
@ -194,10 +234,17 @@ |
|
|
getHouseListPage() { |
|
|
getHouseListPage() { |
|
|
// 区分上拉加载和下拉刷新 is_pull 下拉 1 上拉 2 |
|
|
// 区分上拉加载和下拉刷新 is_pull 下拉 1 上拉 2 |
|
|
const is_pull = this.is_pull; |
|
|
const is_pull = this.is_pull; |
|
|
|
|
|
this.$functions.showLoading(); |
|
|
this.$api.getHouseListPage().then(res => { |
|
|
this.$api.getHouseListPage().then(res => { |
|
|
this.list = res.result; |
|
|
|
|
|
|
|
|
// this.list = res.result; |
|
|
|
|
|
if(this.page === 1 || this.total == null || is_pull === 1) { |
|
|
|
|
|
this.total = res.result.total; |
|
|
|
|
|
this.size = res.result.size; |
|
|
|
|
|
} |
|
|
|
|
|
console.log(is_pull) |
|
|
if(is_pull === 1) { |
|
|
if(is_pull === 1) { |
|
|
// 下拉 |
|
|
// 下拉 |
|
|
|
|
|
console.log(123132) |
|
|
this.page = 1; |
|
|
this.page = 1; |
|
|
this.list = res.result.records; |
|
|
this.list = res.result.records; |
|
|
}else { |
|
|
}else { |
|
@ -205,7 +252,9 @@ |
|
|
this.page +=1; |
|
|
this.page +=1; |
|
|
this.list = this.list.concat(res.result.records); |
|
|
this.list = this.list.concat(res.result.records); |
|
|
} |
|
|
} |
|
|
|
|
|
this.$functions.hideLoading(); |
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
|
|
|
this.$functions.hideLoading(); |
|
|
console.log(err,"错误信息") |
|
|
console.log(err,"错误信息") |
|
|
}); |
|
|
}); |
|
|
// this.$request('/job-dev/house/applet/indexListPage',{},'GET', (res) => { |
|
|
// this.$request('/job-dev/house/applet/indexListPage',{},'GET', (res) => { |
|
@ -361,6 +410,12 @@ |
|
|
padding: 24rpx 0; |
|
|
padding: 24rpx 0; |
|
|
margin-bottom: 24rpx; |
|
|
margin-bottom: 24rpx; |
|
|
|
|
|
|
|
|
|
|
|
.scroll-view_H{ |
|
|
|
|
|
// width: 100%; |
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 300rpx; |
|
|
|
|
|
} |
|
|
.ant-page-title{ |
|
|
.ant-page-title{ |
|
|
color: #000; |
|
|
color: #000; |
|
|
font-size: 32rpx; |
|
|
font-size: 32rpx; |
|
@ -382,6 +437,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.ant-page-image-item{ |
|
|
.ant-page-image-item{ |
|
|
|
|
|
display: inline-block; |
|
|
border-radius: 4rpx; |
|
|
border-radius: 4rpx; |
|
|
width: 240rpx; |
|
|
width: 240rpx; |
|
|
height: 300rpx; |
|
|
height: 300rpx; |
|
@ -476,7 +532,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
</style> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|