11
This commit is contained in:
parent
a5178d64f6
commit
e55fe17bcf
@ -32,7 +32,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view> <Copyright/><Footer></Footer></view>
|
<Copyright/>
|
||||||
|
<Footer></Footer>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -109,15 +110,17 @@
|
|||||||
$transition: all 0.3s ease; // 过渡效果
|
$transition: all 0.3s ease; // 过渡效果
|
||||||
|
|
||||||
.activity-list-page {
|
.activity-list-page {
|
||||||
|
background-color: #f5f7fa;
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
background-color: $secondary-color;
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
display: flex; /* 新增 */
|
||||||
|
flex-direction: column; /* 新增 */
|
||||||
|
padding-bottom: calc(100rpx + 80rpx); /* 调整为footer高度 + copyright高度 */
|
||||||
|
|
||||||
.activity-container {
|
.activity-container {
|
||||||
// display: grid;
|
flex: 1; /* 新增 - 让内容区域占据剩余空间 */
|
||||||
// grid-template-columns: repeat(2, 1fr);
|
margin-bottom: 20rpx; /* 新增 - 与版权组件保持间距 */
|
||||||
// gap: 20rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-item {
|
.activity-item {
|
||||||
|
|||||||
@ -378,21 +378,21 @@
|
|||||||
$tag-radius: 8rpx;
|
$tag-radius: 8rpx;
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
position: relative; // 添加相对定位
|
|
||||||
min-height: 100vh;
|
|
||||||
padding-bottom: 120rpx; // 为copyright留出空间
|
|
||||||
box-sizing: border-box; // 确保padding计算在高度内
|
|
||||||
padding: 0;
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: $bg-color;
|
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 {
|
// .copyright-fixed {
|
||||||
position: fixed;
|
// position: fixed;
|
||||||
bottom: 0;
|
// bottom: 0;
|
||||||
left: 0;
|
// left: 0;
|
||||||
right: 0;
|
// right: 0;
|
||||||
z-index: 10; /* 防止被其他元素遮挡 */
|
// z-index: 10; /* 防止被其他元素遮挡 */
|
||||||
}
|
// }
|
||||||
|
|
||||||
.nav-bar {
|
.nav-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -51,7 +51,6 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="order-description">{{ order.content }}</view>
|
<view class="order-description">{{ order.content }}</view>
|
||||||
<view class="order-meta">
|
<view class="order-meta">
|
||||||
<!-- <text class="meta-item">{{ order.label || '通用问题' }}</text> -->
|
|
||||||
<button
|
<button
|
||||||
@click.stop="handleAction(order, $event)"
|
@click.stop="handleAction(order, $event)"
|
||||||
class="order-action"
|
class="order-action"
|
||||||
@ -61,19 +60,28 @@
|
|||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 加载更多提示 -->
|
||||||
|
<view class="load-more" v-if="loading">
|
||||||
|
<u-loading-icon mode="circle" size="24"></u-loading-icon>
|
||||||
|
<text class="load-text">加载中...</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 空状态提示 -->
|
<!-- 空状态提示 -->
|
||||||
<u-empty
|
<u-empty
|
||||||
textSize="24"
|
textSize="24"
|
||||||
width="180px"
|
width="180px"
|
||||||
height="780px"
|
height="780px"
|
||||||
v-if="filteredOrders.length === 0"
|
v-if="filteredOrders.length === 0 && !loading"
|
||||||
mode="data"
|
mode="data"
|
||||||
icon="/static/imgs/noData.jpeg"
|
icon="/static/imgs/noData.png"
|
||||||
></u-empty>
|
></u-empty>
|
||||||
|
<!-- 没有更多数据提示 -->
|
||||||
|
<view class="no-more" v-if="noMoreData && orders.length > 0 && filteredOrders.length != 0">
|
||||||
|
<text>没有更多数据了</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <Footer></Footer> -->
|
</view>
|
||||||
|
|
||||||
<!-- 发布工单按钮 -->
|
<!-- 发布工单按钮 -->
|
||||||
<view class="fab-container">
|
<view class="fab-container">
|
||||||
@ -88,6 +96,7 @@
|
|||||||
import Footer from '@/components/footer_common.vue';
|
import Footer from '@/components/footer_common.vue';
|
||||||
import { IMAGE_BASE_URL,BASE_URL } from '@/utils/config';
|
import { IMAGE_BASE_URL,BASE_URL } from '@/utils/config';
|
||||||
import { formatTime, formatRelativeTime } from '@/utils/timeFormat';
|
import { formatTime, formatRelativeTime } from '@/utils/timeFormat';
|
||||||
|
import { get, post,put } from '@/utils/request';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -104,6 +113,10 @@
|
|||||||
currentTab: '', // 默认显示全部
|
currentTab: '', // 默认显示全部
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
formatTime,
|
formatTime,
|
||||||
|
currentPage: 1, // 当前页码
|
||||||
|
pageSize: 10, // 每页数量
|
||||||
|
loading: false, // 加载状态
|
||||||
|
noMoreData: false, // 是否没有更多数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -115,6 +128,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
// 触底加载更多
|
||||||
|
this.loadMore();
|
||||||
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
this.getReciprocitiesList();
|
this.getReciprocitiesList();
|
||||||
},
|
},
|
||||||
@ -175,6 +192,15 @@
|
|||||||
// 切换tabs
|
// 切换tabs
|
||||||
handleTabChange(index) {
|
handleTabChange(index) {
|
||||||
this.currentTab = index.value;
|
this.currentTab = index.value;
|
||||||
|
this.resetList(); // 切换标签时重置列表
|
||||||
|
},
|
||||||
|
|
||||||
|
// 重置列表
|
||||||
|
resetList() {
|
||||||
|
this.currentPage = 1;
|
||||||
|
this.orders = [];
|
||||||
|
this.noMoreData = false;
|
||||||
|
this.getReciprocitiesList();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 打开发布工单功能
|
// 打开发布工单功能
|
||||||
@ -221,19 +247,35 @@
|
|||||||
uni.navigateTo({ url: '/pages/mySeekHelpDetail/index' });
|
uni.navigateTo({ url: '/pages/mySeekHelpDetail/index' });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 加载更多数据
|
||||||
|
loadMore() {
|
||||||
|
if (this.loading || this.noMoreData) return;
|
||||||
|
this.currentPage += 1;
|
||||||
|
this.getReciprocitiesList();
|
||||||
|
},
|
||||||
|
|
||||||
// 获取列表接口
|
// 获取列表接口
|
||||||
async getReciprocitiesList() {
|
async getReciprocitiesList() {
|
||||||
if (this.isLoading) return;
|
if (this.loading) return;
|
||||||
this.isLoading = true;
|
this.loading = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await get('/api/v1/app_auth/my/reciprocities', {
|
const res = await get('/api/v1/app_auth/my/reciprocities', {
|
||||||
current: 1,
|
current: this.currentPage,
|
||||||
pageSize: 10,
|
pageSize: this.pageSize,
|
||||||
});
|
});
|
||||||
|
console.log("res",res)
|
||||||
|
|
||||||
if (res?.success) {
|
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) {
|
} catch (err) {
|
||||||
console.error('获取我的求助失败:', err);
|
console.error('获取我的求助失败:', err);
|
||||||
@ -241,8 +283,12 @@
|
|||||||
title: '加载列表失败',
|
title: '加载列表失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
|
// 加载失败时回退页码
|
||||||
|
if (this.currentPage > 1) {
|
||||||
|
this.currentPage -= 1;
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.isLoading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -388,6 +434,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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,8 +467,8 @@
|
|||||||
z-index: 100;
|
z-index: 100;
|
||||||
|
|
||||||
.fab-button {
|
.fab-button {
|
||||||
width: 130rpx;
|
width: 90rpx;
|
||||||
height: 130rpx;
|
height: 90rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: $gradient-primary;
|
background: $gradient-primary;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -61,19 +61,32 @@
|
|||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 加载状态提示 -->
|
||||||
|
<view class="load-more" v-if="loading">
|
||||||
|
<u-loading-icon mode="circle" size="24"></u-loading-icon>
|
||||||
|
<text class="load-text">加载中...</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 空状态提示 -->
|
<!-- 空状态提示 -->
|
||||||
<u-empty
|
<u-empty
|
||||||
textSize="24"
|
textSize="24"
|
||||||
width="180px"
|
width="180px"
|
||||||
height="780px"
|
height="780px"
|
||||||
v-if="filteredOrders.length === 0"
|
v-if="filteredOrders.length === 0 && !loading"
|
||||||
mode="data"
|
mode="data"
|
||||||
icon="/static/imgs/noData.jpeg"
|
icon="/static/imgs/noData.png"
|
||||||
></u-empty>
|
></u-empty>
|
||||||
|
|
||||||
|
<!-- 没有更多数据提示 -->
|
||||||
|
<view class="no-more" v-if="noMoreData && orders.length > 0 && filteredOrders.length != 0">
|
||||||
|
|
||||||
|
<text>没有更多数据了</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<Footer></Footer>
|
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 发布工单按钮 -->
|
<!-- 发布工单按钮 -->
|
||||||
<view class="fab-container">
|
<view class="fab-container">
|
||||||
@ -104,10 +117,20 @@
|
|||||||
currentTab: '', // 默认显示全部
|
currentTab: '', // 默认显示全部
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
formatTime,
|
formatTime,
|
||||||
|
currentPage: 1, // 当前页码
|
||||||
|
pageSize: 10, // 每页数量
|
||||||
|
loading: false, // 加载状态
|
||||||
|
noMoreData: false, // 是否没有更多数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
this.getWorkOrderList();
|
this.getWorkOrderList();
|
||||||
|
// 绑定上拉加载事件
|
||||||
|
uni.$on('scrollToLower', this.loadMore);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// 移除事件监听
|
||||||
|
uni.$off('scrollToLower', this.loadMore);
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
filteredOrders() {
|
filteredOrders() {
|
||||||
@ -172,6 +195,15 @@
|
|||||||
|
|
||||||
handleTabChange(index) {
|
handleTabChange(index) {
|
||||||
this.currentTab = index.value;
|
this.currentTab = index.value;
|
||||||
|
this.resetList(); // 切换标签时重置列表
|
||||||
|
},
|
||||||
|
|
||||||
|
// 重置列表数据
|
||||||
|
resetList() {
|
||||||
|
this.currentPage = 1;
|
||||||
|
this.orders = [];
|
||||||
|
this.noMoreData = false;
|
||||||
|
this.getWorkOrderList();
|
||||||
},
|
},
|
||||||
|
|
||||||
showPublishForm() {
|
showPublishForm() {
|
||||||
@ -202,7 +234,7 @@
|
|||||||
const res = await put(`/api/v1/app_auth/work-order/${orderId}`, {status:98});
|
const res = await put(`/api/v1/app_auth/work-order/${orderId}`, {status:98});
|
||||||
if (res?.success) {
|
if (res?.success) {
|
||||||
uni.showToast({ title: '工单已撤回', icon: 'success' });
|
uni.showToast({ title: '工单已撤回', icon: 'success' });
|
||||||
this.getWorkOrderList();
|
this.resetList(); // 撤回后重新加载列表
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('撤回工单失败:', err);
|
console.error('撤回工单失败:', err);
|
||||||
@ -215,22 +247,43 @@
|
|||||||
uni.navigateTo({ url: '/pages/myTicketsDetail/index' });
|
uni.navigateTo({ url: '/pages/myTicketsDetail/index' });
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 加载更多数据
|
||||||
|
loadMore() {
|
||||||
|
if (this.loading || this.noMoreData) return;
|
||||||
|
this.currentPage += 1;
|
||||||
|
this.getWorkOrderList();
|
||||||
|
},
|
||||||
|
|
||||||
async getWorkOrderList(){
|
async getWorkOrderList(){
|
||||||
if (this.isLoading) return;
|
if (this.loading) return;
|
||||||
this.isLoading = true;
|
this.loading = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await get('/api/v1/app_auth/my/work-order', {
|
const res = await get('/api/v1/app_auth/my/work-order', {
|
||||||
current: 1,
|
current: this.currentPage,
|
||||||
pageSize: 10,
|
pageSize: this.pageSize,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res?.success) {
|
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) {
|
} catch (err) {
|
||||||
console.error('获取我的求助失败:', err);
|
console.error('获取工单列表失败:', err);
|
||||||
uni.showToast({ title: '加载列表失败', icon: 'none' });
|
uni.showToast({ title: '加载列表失败', icon: 'none' });
|
||||||
|
// 加载失败时回退页码
|
||||||
|
if (this.currentPage > 1) {
|
||||||
|
this.currentPage -= 1;
|
||||||
|
}
|
||||||
} finally {
|
} 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;
|
z-index: 100;
|
||||||
|
|
||||||
.fab-button {
|
.fab-button {
|
||||||
width: 130rpx;
|
width: 90rpx;
|
||||||
height: 130rpx;
|
height: 90rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: $gradient-primary;
|
background: $gradient-primary;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user