Commit faf1656a by liangjianmin

feat(tallyReceive): 添加骨架屏加载效果

- 新增骨架屏样式,包含渐变动画效果和按钮占位样式
- 在列表加载时显示骨架屏,提升用户体验
- 添加loading状态控制,确保骨架屏仅在首次加载且无数据时显示
- 优化列表显示逻辑,使用v-else-if避免骨架屏与列表同时显示
parent e8b89802
......@@ -239,6 +239,37 @@
padding-bottom: 150rpx;
flex-wrap: wrap;
// 骨架屏样式
.skeleton-box {
.skeleton-item {
background: linear-gradient(90deg, #f0f0f2 25%, #e8e8e8 50%, #f0f0f2 75%);
background-size: 200% 100%;
animation: skeleton-loading 1.5s infinite;
border-radius: 6rpx;
}
.skeleton-btn {
width: 68rpx;
height: 30rpx;
background: linear-gradient(90deg, #f0f0f2 25%, #e8e8e8 50%, #f0f0f2 75%);
background-size: 200% 100%;
animation: skeleton-loading 1.5s infinite;
border-radius: 8rpx;
position: absolute;
right: 17rpx;
bottom: 13rpx;
}
}
@keyframes skeleton-loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
.box {
position: relative;
padding: 15rpx 17rpx 17rpx 17rpx;
......
......@@ -58,8 +58,22 @@
</view>
</view>
</view>
<!-- 骨架屏 -->
<view class="list row bothSide" v-if="loading && list.length === 0">
<view class="box skeleton-box" v-for="i in 4" :key="'skeleton-' + i">
<view class="skeleton-item" style="width: 60%; height: 32rpx; margin-bottom: 20rpx;"></view>
<view class="skeleton-item" style="width: 80%; height: 32rpx; margin-bottom: 20rpx;"></view>
<view class="bor row"></view>
<view class="skeleton-item" style="width: 50%; height: 28rpx; margin-bottom: 16rpx;"></view>
<view class="skeleton-item" style="width: 70%; height: 28rpx; margin-bottom: 16rpx;"></view>
<view class="skeleton-item" style="width: 65%; height: 28rpx; margin-bottom: 16rpx;"></view>
<view class="skeleton-item" style="width: 55%; height: 28rpx; margin-bottom: 16rpx;"></view>
<view class="skeleton-item" style="width: 40%; height: 28rpx; margin-bottom: 16rpx;"></view>
<view class="skeleton-btn"></view>
</view>
</view>
<!-- 列表 -->
<view class="list row bothSide" v-if="list.length > 0">
<view class="list row bothSide" v-else-if="list.length > 0">
<view class="box" v-for="(item, index) in list" :key="index" :class="{ curr: filter_list[index] }">
<view class="is-watch row rowCenter verCenter" v-if="item.is_watch == 1">看货</view>
<view class="is-watch row rowCenter verCenter" v-if="item.is_apart == 1" :style="{ top: item.is_watch == 1 ? '136rpx' : '89rpx' }">拆货</view>
......@@ -287,6 +301,7 @@
indexContainer: -1,
array: ['全量搜索', '入仓号', '箱号', 'FedEx', 'DigiKey', 'Rochester', 'TME', 'Chip1stop', 'Mouser'],
list: [],
loading: true, //加载状态
filter_list: [], //筛选已选中的列表
filter_id: [], //入库单列表的入库登记
detail: {}, //详情的数据
......@@ -785,6 +800,7 @@
* 获取列表数据 支持分页
*/
getData(callback, type) {
this.loading = true;
this.request(API.waitTallyReceiveList, 'POST', { page: this.page, limit: this.limit, ...this.searchParams }, false).then(res => {
if (res.code === 0) {
if (res.data.total > 0) {
......@@ -801,6 +817,7 @@
icon: 'error'
});
}
this.loading = false;
});
},
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment