工单 告警 报事 修改
This commit is contained in:
@@ -7,28 +7,38 @@
|
||||
{{ tab }}
|
||||
<view v-if="idx === activeTab" class="tab-underline"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="empty-content" v-if="list.length ===0">
|
||||
<image src="/static/ic_meet_01.png" class="empty-img"></image>
|
||||
<view class="empty-txt">暂无预约</view>
|
||||
<button class="empty-btn" @click="createMeet">发起预约</button>
|
||||
</view>
|
||||
<!-- 列表区 -->
|
||||
<view v-else class="meet-list">
|
||||
<view v-for="(item, idx) in list" :key="idx" class="meet-card" @click="showVisitorDetail(item)">
|
||||
<view class="card-row">
|
||||
<view class="card-type">{{ item.visitorUnit }}</view>
|
||||
<view class="card-status" :class="getStatusColor(item.serveStatus)">
|
||||
{{ getStatusLabel(item.serveStatus) }}</view>
|
||||
|
||||
<view class="meet-list-container">
|
||||
<scroll-view
|
||||
v-for="(tab, idx) in tabs"
|
||||
:key="idx"
|
||||
v-show="idx === activeTab"
|
||||
class="meet-list-scroll"
|
||||
scroll-y
|
||||
:refresher-enabled="false">
|
||||
<view class="empty-content" v-if="tabData[idx].length ===0">
|
||||
<image src="/static/ic_meet_01.png" class="empty-img"></image>
|
||||
<view class="empty-txt">暂无预约</view>
|
||||
<button class="empty-btn" @click="createMeet">发起预约</button>
|
||||
</view>
|
||||
<view class="card-info">{{ item.visitorName }}
|
||||
<text class="card-phone">{{ item.visitorPhone }}</text>
|
||||
<text class="card-divider"></text>
|
||||
<text class="card-address">{{ item.visitorUnit }}</text>
|
||||
<!-- 列表区 -->
|
||||
<view v-else class="meet-list">
|
||||
<view v-for="(item, index) in tabData[idx]" :key="index" class="meet-card" @click="showVisitorDetail(item)">
|
||||
<view class="card-row">
|
||||
<view class="card-type">{{ item.visitorUnit }}</view>
|
||||
<view class="card-status" :class="getStatusColor(item.serveStatus)">
|
||||
{{ getStatusLabel(item.serveStatus) }}</view>
|
||||
</view>
|
||||
<view class="card-info">{{ item.visitorName }}
|
||||
<text class="card-phone">{{ item.visitorPhone }}</text>
|
||||
<text class="card-divider"></text>
|
||||
<text class="card-address">{{ item.visitorUnit }}</text>
|
||||
</view>
|
||||
<view class="card-time">{{ item.createTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-time">{{ item.createTime }}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -53,22 +63,25 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadTabData(this.activeTab); // 初始化加载当前tab数据
|
||||
this.loadAllTabsData(); // 预加载所有标签页数据
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
createMeet(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/sys/workbench/meet/createMeet'
|
||||
});
|
||||
createMeet(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/sys/workbench/meet/createMeet'
|
||||
});
|
||||
},
|
||||
async changeTab(idx) {
|
||||
this.activeTab = idx;
|
||||
// 移除切换标签时的加载逻辑,避免重复调用接口
|
||||
/*
|
||||
if (!this.tabLoaded[idx]) {
|
||||
await this.loadTabData(idx);
|
||||
}
|
||||
*/
|
||||
},
|
||||
async loadTabData(idx) {
|
||||
this.loading = true;
|
||||
@@ -90,7 +103,6 @@
|
||||
this.$set(this.tabLoaded, idx, true);
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
getStatusLabel(status) {
|
||||
const statusMap = {
|
||||
0: '待确认',
|
||||
@@ -108,6 +120,19 @@
|
||||
3: '已完成'
|
||||
};
|
||||
return statusMap[status] || '';
|
||||
},
|
||||
|
||||
// 添加预加载所有标签页数据的方法
|
||||
async loadAllTabsData() {
|
||||
// 并行加载所有标签页数据,提高加载速度
|
||||
const loadPromises = [0, 1].map((index) => {
|
||||
return this.loadTabData(index);
|
||||
});
|
||||
|
||||
await Promise.all(loadPromises);
|
||||
|
||||
// 标记所有标签页已加载
|
||||
this.tabLoaded = [true, true];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,36 +144,37 @@
|
||||
background: #f7f7f7;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.empty-content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 168rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
.empty-img{
|
||||
width: 440rpx;
|
||||
height: 398rpx;
|
||||
}
|
||||
.empty-txt{
|
||||
color: #737373;
|
||||
font-size: 28rpx;
|
||||
margin-top: 64rpx;
|
||||
}
|
||||
|
||||
.empty-btn {
|
||||
width: 70vw;
|
||||
height: 80rpx;
|
||||
background: #0090FF;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
border: none;
|
||||
border-radius: 40rpx;
|
||||
margin: 140rpx auto 0 auto;
|
||||
display: block;
|
||||
box-shadow: 0 18rpx 24rpx rgba(0, 0, 0, 0.18);
|
||||
font-weight: bold;
|
||||
.empty-content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 168rpx;
|
||||
}
|
||||
.empty-img{
|
||||
width: 440rpx;
|
||||
height: 398rpx;
|
||||
}
|
||||
.empty-txt{
|
||||
color: #737373;
|
||||
font-size: 28rpx;
|
||||
margin-top: 64rpx;
|
||||
}
|
||||
|
||||
.empty-btn {
|
||||
width: 70vw;
|
||||
height: 80rpx;
|
||||
background: #0090FF;
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
border: none;
|
||||
border-radius: 40rpx;
|
||||
margin: 140rpx auto 0 auto;
|
||||
display: block;
|
||||
box-shadow: 0 18rpx 24rpx rgba(0, 0, 0, 0.18);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.meet-tabs {
|
||||
@@ -187,6 +213,29 @@
|
||||
margin: 0 auto;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.meet-list-container {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
margin: 25rpx 0 0 0;
|
||||
padding: 0 35rpx;
|
||||
padding-bottom: 200rpx;
|
||||
/* 为底部按钮留出空间 */
|
||||
}
|
||||
|
||||
.meet-list-scroll {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 0 35rpx;
|
||||
overflow-y: auto;
|
||||
padding-bottom: 200rpx;
|
||||
/* 为底部按钮留出空间 */
|
||||
height: calc(100vh - 80rpx - 32rpx - 80rpx); /* 减去顶部tab区域和底部按钮高度 */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.meet-list {
|
||||
margin: 25rpx 0 0 0;
|
||||
|
Reference in New Issue
Block a user