From e55fe17bcfb18c5c2637ecd86e0a2236ef17195f Mon Sep 17 00:00:00 2001 From: qiuyuan Date: Tue, 12 Aug 2025 17:44:54 +0800 Subject: [PATCH] 11 --- pages/activeList/index.vue | 19 +++--- pages/meetingList/index.vue | 30 ++++----- pages/mySeekHelp/index.vue | 108 +++++++++++++++++++++++++++------ pages/myTickets/index.vue | 117 +++++++++++++++++++++++++++++------- 4 files changed, 210 insertions(+), 64 deletions(-) diff --git a/pages/activeList/index.vue b/pages/activeList/index.vue index 49361ae..25fee86 100644 --- a/pages/activeList/index.vue +++ b/pages/activeList/index.vue @@ -32,7 +32,8 @@ -
+ +
@@ -109,15 +110,17 @@ $transition: all 0.3s ease; // 过渡效果 .activity-list-page { - padding: 20rpx; - background-color: $secondary-color; - min-height: 100vh; - box-sizing: border-box; + background-color: #f5f7fa; + padding: 20rpx; + min-height: 100vh; + box-sizing: border-box; + display: flex; /* 新增 */ + flex-direction: column; /* 新增 */ + padding-bottom: calc(100rpx + 80rpx); /* 调整为footer高度 + copyright高度 */ .activity-container { - // display: grid; - // grid-template-columns: repeat(2, 1fr); - // gap: 20rpx; + flex: 1; /* 新增 - 让内容区域占据剩余空间 */ + margin-bottom: 20rpx; /* 新增 - 与版权组件保持间距 */ } .activity-item { diff --git a/pages/meetingList/index.vue b/pages/meetingList/index.vue index 1462369..1776828 100644 --- a/pages/meetingList/index.vue +++ b/pages/meetingList/index.vue @@ -377,22 +377,22 @@ $card-radius: 24rpx; $tag-radius: 8rpx; - .container { - position: relative; // 添加相对定位 - min-height: 100vh; - padding-bottom: 120rpx; // 为copyright留出空间 - box-sizing: border-box; // 确保padding计算在高度内 - padding: 0; - min-height: 100vh; - background-color: $bg-color; + .container { + background-color: $bg-color; + padding: 20rpx; + min-height: 100vh; + box-sizing: border-box; + display: flex; /* 新增 */ + flex-direction: column; /* 新增 */ + padding-bottom: calc(100rpx + 80rpx); /* 调整为footer高度 + copyright高度 */ - .copyright-fixed { - position: fixed; - bottom: 0; - left: 0; - right: 0; - z-index: 10; /* 防止被其他元素遮挡 */ - } + // .copyright-fixed { + // position: fixed; + // bottom: 0; + // left: 0; + // right: 0; + // z-index: 10; /* 防止被其他元素遮挡 */ + // } .nav-bar { display: flex; diff --git a/pages/mySeekHelp/index.vue b/pages/mySeekHelp/index.vue index b926e52..22e3f4a 100644 --- a/pages/mySeekHelp/index.vue +++ b/pages/mySeekHelp/index.vue @@ -51,7 +51,6 @@ {{ order.content }} - + + + + + 加载中... + + + + + + + + + 没有更多数据了 + - - + + -
- @@ -104,10 +117,20 @@ currentTab: '', // 默认显示全部 isLoading: false, formatTime, + currentPage: 1, // 当前页码 + pageSize: 10, // 每页数量 + loading: false, // 加载状态 + noMoreData: false, // 是否没有更多数据 }; }, mounted(){ this.getWorkOrderList(); + // 绑定上拉加载事件 + uni.$on('scrollToLower', this.loadMore); + }, + beforeDestroy() { + // 移除事件监听 + uni.$off('scrollToLower', this.loadMore); }, computed: { filteredOrders() { @@ -172,6 +195,15 @@ handleTabChange(index) { this.currentTab = index.value; + this.resetList(); // 切换标签时重置列表 + }, + + // 重置列表数据 + resetList() { + this.currentPage = 1; + this.orders = []; + this.noMoreData = false; + this.getWorkOrderList(); }, showPublishForm() { @@ -202,7 +234,7 @@ const res = await put(`/api/v1/app_auth/work-order/${orderId}`, {status:98}); if (res?.success) { uni.showToast({ title: '工单已撤回', icon: 'success' }); - this.getWorkOrderList(); + this.resetList(); // 撤回后重新加载列表 } } catch (err) { console.error('撤回工单失败:', err); @@ -215,22 +247,43 @@ uni.navigateTo({ url: '/pages/myTicketsDetail/index' }); }, + // 加载更多数据 + loadMore() { + if (this.loading || this.noMoreData) return; + this.currentPage += 1; + this.getWorkOrderList(); + }, + async getWorkOrderList(){ - if (this.isLoading) return; - this.isLoading = true; + if (this.loading) return; + this.loading = true; + try { const res = await get('/api/v1/app_auth/my/work-order', { - current: 1, - pageSize: 10, + current: this.currentPage, + pageSize: this.pageSize, }); + if (res?.success) { - this.orders = res.data || []; + const newData = res.data || []; + if (this.currentPage === 1) { + this.orders = newData; + } else { + this.orders = [...this.orders, ...newData]; + } + + // 判断是否还有更多数据 + this.noMoreData = newData.length < this.pageSize; } } catch (err) { - console.error('获取我的求助失败:', err); + console.error('获取工单列表失败:', err); uni.showToast({ title: '加载列表失败', icon: 'none' }); + // 加载失败时回退页码 + if (this.currentPage > 1) { + this.currentPage -= 1; + } } finally { - this.isLoading = false; + this.loading = false; } } } @@ -376,6 +429,28 @@ } } } + + // 加载更多样式 + .load-more { + display: flex; + justify-content: center; + align-items: center; + padding: 20rpx 0; + color: $gray-color; + font-size: 26rpx; + + .load-text { + margin-left: 15rpx; + } + } + + // 没有更多数据样式 + .no-more { + text-align: center; + padding: 20rpx 0; + color: $gray-color; + font-size: 26rpx; + } } } @@ -387,8 +462,8 @@ z-index: 100; .fab-button { - width: 130rpx; - height: 130rpx; + width: 90rpx; + height: 90rpx; border-radius: 50%; background: $gradient-primary; display: flex;