|
@ -19,14 +19,18 @@ |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<!-- 预约列表 --> |
|
|
<!-- 预约列表 --> |
|
|
<view class="appointment-list"> |
|
|
|
|
|
<scroll-view |
|
|
<scroll-view |
|
|
|
|
|
class="appointment-list" |
|
|
scroll-y="true" |
|
|
scroll-y="true" |
|
|
:lower-threshold="80" |
|
|
:lower-threshold="150" |
|
|
@scrolltolower="handleLoadMore" |
|
|
@scrolltolower="handleLoadMore" |
|
|
|
|
|
@scroll="handleScroll" |
|
|
:refresher-enabled="true" |
|
|
:refresher-enabled="true" |
|
|
:refresher-triggered="refreshing" |
|
|
:refresher-triggered="refreshing" |
|
|
@refresherrefresh="handleRefresh" |
|
|
@refresherrefresh="handleRefresh" |
|
|
|
|
|
:scroll-top="scrollTop" |
|
|
|
|
|
:scroll-with-animation="false" |
|
|
|
|
|
:enable-back-to-top="true" |
|
|
> |
|
|
> |
|
|
<view |
|
|
<view |
|
|
class="appointment-card" |
|
|
class="appointment-card" |
|
@ -71,7 +75,6 @@ |
|
|
<view class="list-footer" v-if="loadingMore">加载中...</view> |
|
|
<view class="list-footer" v-if="loadingMore">加载中...</view> |
|
|
<view class="list-footer" v-else-if="!hasMore && appointmentList.length > 0">没有更多了</view> |
|
|
<view class="list-footer" v-else-if="!hasMore && appointmentList.length > 0">没有更多了</view> |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 空状态 --> |
|
|
<!-- 空状态 --> |
|
|
<u-empty |
|
|
<u-empty |
|
@ -226,6 +229,9 @@ export default { |
|
|
hasMore: true, |
|
|
hasMore: true, |
|
|
refreshing: false, |
|
|
refreshing: false, |
|
|
loadingMore: false, |
|
|
loadingMore: false, |
|
|
|
|
|
scrollTop: 0, |
|
|
|
|
|
isScrolling: false, |
|
|
|
|
|
scrollTimer: null, |
|
|
showRegisterPopup: false, // 看房登记弹框显示状态 |
|
|
showRegisterPopup: false, // 看房登记弹框显示状态 |
|
|
currentAppointment: {}, // 当前选中的预约信息 |
|
|
currentAppointment: {}, // 当前选中的预约信息 |
|
|
viewingStatus: "1", // 看房状态 (1: 已看房, 0: 未看房,2: 已取消) |
|
|
viewingStatus: "1", // 看房状态 (1: 已看房, 0: 未看房,2: 已取消) |
|
@ -300,6 +306,7 @@ export default { |
|
|
this.hasMore = true; |
|
|
this.hasMore = true; |
|
|
this.refreshing = false; |
|
|
this.refreshing = false; |
|
|
this.loadingMore = false; |
|
|
this.loadingMore = false; |
|
|
|
|
|
this.scrollTop = 0; // 重置滚动位置 |
|
|
this.loadAppointmentList(); |
|
|
this.loadAppointmentList(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -309,12 +316,23 @@ export default { |
|
|
this.refreshing = true; |
|
|
this.refreshing = true; |
|
|
this.queryParams.pageNum = 1; |
|
|
this.queryParams.pageNum = 1; |
|
|
this.hasMore = true; |
|
|
this.hasMore = true; |
|
|
|
|
|
this.scrollTop = 0; // 重置滚动位置 |
|
|
this.loadAppointmentList(); |
|
|
this.loadAppointmentList(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 滚动事件处理 |
|
|
|
|
|
handleScroll(e) { |
|
|
|
|
|
this.isScrolling = true; |
|
|
|
|
|
// 防抖处理 |
|
|
|
|
|
clearTimeout(this.scrollTimer); |
|
|
|
|
|
this.scrollTimer = setTimeout(() => { |
|
|
|
|
|
this.isScrolling = false; |
|
|
|
|
|
}, 100); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 上拉加载更多 |
|
|
// 上拉加载更多 |
|
|
handleLoadMore() { |
|
|
handleLoadMore() { |
|
|
if (this.loading || this.loadingMore || !this.hasMore) return; |
|
|
if (this.loading || this.loadingMore || !this.hasMore || this.isScrolling) return; |
|
|
this.loadingMore = true; |
|
|
this.loadingMore = true; |
|
|
this.loadAppointmentList(); |
|
|
this.loadAppointmentList(); |
|
|
}, |
|
|
}, |
|
@ -458,6 +476,8 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.appointment-list { |
|
|
.appointment-list { |
|
|
|
|
|
height: calc(100vh - 100rpx); /* 减去搜索框和padding的高度,给滚动留更多空间 */ |
|
|
|
|
|
overflow: hidden; |
|
|
.appointment-card { |
|
|
.appointment-card { |
|
|
background-color: #fff; |
|
|
background-color: #fff; |
|
|
border-radius: 16rpx; |
|
|
border-radius: 16rpx; |
|
|