Dining_Hall/pages/sendACarSystem/details.vue

86 lines
2.2 KiB
Vue
Raw Normal View History

2024-12-24 13:02:43 +08:00
<template>
<view>
<Navbar :title="navbarTitle" />
2024-12-24 17:26:08 +08:00
<div class="tabs" v-if="opt.isDetail">
2024-12-24 13:02:43 +08:00
<div class="item" :class="{ active: active == 1 }" @click="handleTab(1)">计划详情</div>
<div class="item" :class="{ active: active == 2 }" @click="handleTab(2)">派车详情</div>
2024-12-24 17:26:08 +08:00
<div class="item" :class="{ active: active == 3 }" @click="handleTab(3)" v-if="!opt.isArrival">审核记录</div>
2024-12-24 13:02:43 +08:00
</div>
2024-12-26 18:00:44 +08:00
<!-- <div v-if="opt.isDetail" style="height: 45px"></div> -->
2024-12-24 13:02:43 +08:00
2024-12-24 17:26:08 +08:00
<PlanDetails v-if="active == 1" :opt="opt" />
<PlanAuditDetails v-if="active == 2" :opt="opt" />
<AuditRecord v-if="active == 3" :opt="opt" />
2024-12-24 13:02:43 +08:00
</view>
</template>
<script>
import AuditRecord from './components/AuditRecord'
import PlanDetails from './components/PlanDetails'
2024-12-24 17:26:08 +08:00
import PlanAuditDetails from './components/PlanAuditDetails'
2024-12-24 13:02:43 +08:00
export default {
2024-12-24 17:26:08 +08:00
components: { AuditRecord, PlanDetails, PlanAuditDetails },
2024-12-24 13:02:43 +08:00
data() {
return {
opt: {},
navbarTitle: '详情',
2024-12-24 17:26:08 +08:00
active: 1
2024-12-24 13:02:43 +08:00
}
},
onLoad(opt) {
this.opt = JSON.parse(opt.params)
console.log('🚀 ~ onLoad ~ this.opt', this.opt)
2024-12-24 17:26:08 +08:00
this.active = this.opt.active
if (this.opt.isPlan) {
this.navbarTitle = '计划详情'
} else if (this.opt.isAudit) {
this.navbarTitle = '派车详情'
} else if (this.opt.isDetail && !this.opt.isArrival) {
this.navbarTitle = '派车详情'
} else {
this.navbarTitle = '详情'
}
2024-12-24 13:02:43 +08:00
},
methods: {
handleTab(index) {
this.active = index
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f8f8f8;
}
.tabs {
2024-12-24 17:26:08 +08:00
width: 100%;
2024-12-26 18:00:44 +08:00
/* position: fixed;
2024-12-24 17:26:08 +08:00
top: 44px;
2024-12-26 18:00:44 +08:00
left: 0; */
2024-12-24 17:26:08 +08:00
background-color: #fff;
z-index: 99;
2024-12-24 13:02:43 +08:00
display: flex;
justify-content: space-between;
background-color: #fff;
.item {
flex: 1;
text-align: center;
padding: 10px 0;
color: #666;
font-size: 16px;
font-weight: 500;
2024-12-24 17:26:08 +08:00
border-bottom: 2px solid #dcdcdc; // 添加透明边框
2024-12-24 13:02:43 +08:00
transition: color 0.3s ease, border-bottom 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
// 激活状态
&.active {
color: $u-primary;
border-bottom: 2px solid $u-primary;
background-color: #f8f8f8;
}
}
}
</style>