Browse Source

Merge branch '815' into dev

dev
wangyx 1 week ago
parent
commit
cfc0ed7f79
  1. 28
      pagesA/kfPage/list.vue

28
pagesA/kfPage/list.vue

@ -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;

Loading…
Cancel
Save