companyHome.vue
6.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<template>
<view class="company_container">
<up-navbar placeholder :leftIconSize="0" bgColor="transparent" />
<view class="work_box">
<!-- 头部导航 -->
<view class="nav_header">
<view class="nav_item" :class="{ active: expertActive === 0 }" @click="expertActive = 0">待办事项</view>
<view class="colLine"></view>
<view class="nav_item" :class="{ active: expertActive === 1 }" @click="expertActive = 1">车主信息</view>
</view>
<!-- 内容模块 -->
<view class="expert_content">
<swiper class="swiper" circular :current="expertActive" @animationfinish="toggleSwiper">
<swiper-item>
<view class="swiper-item">
<scroll-view scroll-y="true" class="scroll-history">
<view class="work_list">
<carCard v-for="carItem in carList" :key="carItem.carId" tipContent="待办" :carInfo="carItem">
<template #header>
<navTop :carNum="carItem.carNum" />
</template>
<template #center>
<wordInfo :carType="carItem.carType" :userName="carItem.name" :applyTime="carItem.createTime" />
</template>
<template #footer>
<centerLine></centerLine>
</template>
</carCard>
</view>
</scroll-view>
</view>
</swiper-item>
<swiper-item>
<view class="swiper-item">
<scroll-view scroll-y="true" class="scroll-history">
<view class="work_list">
<carCard v-for="carItem in carList" :key="carItem.carId" tipContent="查看详情" :carInfo="carItem" @onSkip="goCarDetail">
<template #header>
<navTop :carNum="carItem.carNum" />
</template>
<template #center>
<ownerInfo />
</template>
<template #footer>
<view class="delInfo">
<text @click="delOwnerInfo(carItem.carId)">删除车主信息</text>
</view>
</template>
</carCard>
</view>
</scroll-view>
</view>
</swiper-item>
</swiper>
</view>
</view>
<!-- 底部导航栏 -->
<up-tabbar
:value="useTabbar.employeeCurrent"
activeColor="#3680FE"
inactiveColor="#707070"
>
<up-tabbar-item text="主页" icon="home" badge="11"></up-tabbar-item>
<up-tabbar-item text="我的" icon="account" @click="goRouter">
<template #active-icon>
<image style="width: 48rpx;" class="u-page__item__slot-icon" src="@/static/tabbarIcon/my-active.png" mode="widthFix"></image>
</template>
<template #inactive-icon>
<image style="width: 48rpx;" class="u-page__item__slot-icon" src="@/static/tabbarIcon/my.png" mode="widthFix"></image>
</template>
</up-tabbar-item>
</up-tabbar>
</view>
</template>
<script setup>
import { ref } from 'vue';
import carCard from '@/components/carCard.vue';
import centerLine from '@/components/centerLine.vue';
import wordInfo from '@/components/wordInfo.vue';
import navTop from '@/components/navTop.vue';
import ownerInfo from '@/components/ownerInfo.vue';
import useTabbarStore from '@/store/modules/tabbar.js'
const useTabbar = useTabbarStore()
const carList = ref([
{ carId: 1, carNum: '桂A·66666', carType: '奔驰C级', name: '张三', createTime: '2024-09-08 10:12' },
{ carId: 2, carNum: '桂A·77777', carType: '奔驰C级', name: '李四', createTime: '2024-09-08 10:12' },
{ carId: 3, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 4, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 5, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 6, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 7, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 8, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 9, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 10, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
{ carId: 11, carNum: '桂A·77777', carType: '梅赛德斯奔驰', name: '王五', createTime: '2024-09-08 10:12' },
])
const expertActive = ref(0)
// 检测手机滑动
const toggleSwiper = (event) => {
expertActive.value = event.detail?.current
}
// 删除车主信息
const delOwnerInfo = (id) => {
uni.showModal({
title: '删除车主信息',
content: '是否删除车主信息,该操作不可逆?',
success: function (res) {
if (res.confirm) {
uni.$u.toast('删除成功')
} else if (res.cancel) {
console.log('用户点击取消');
}
}
})
}
const goRouter = (index) => {
useTabbar.employeeCurrent = index
uni.redirectTo({
url: '/pages/companyMy/companyMy'
})
}
// 车主详情
const goCarDetail = () => {
uni.navigateTo({
url: '/pages/ownerDetail/ownerDetail'
})
}
</script>
<style lang="scss" scoped>
.company_container{
width: 100%;
height: 100vh;
background: url('http://bxhd.crgx.net/profile/avatar/2024/09/25/bg-index_20240925113012A004.png') no-repeat;
background-size: 100% 100%;
overflow: hidden;
.work_box{
height: calc(100vh - 88rpx);
background-color: #F8F9FF;
.nav_header{
display: flex;
align-items: center;
width: 100%;
height: 80rpx;
background: #FFFFFF;
.nav_item{
flex: 1;
text-align: center;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #999;
&.active{
font-weight: 500;
color: #333;
}
}
.colLine{
width: 2rpx;
height: 40rpx;
background: #D8D8D8;
}
}
.work_list{
padding: 20rpx 30rpx 200rpx;
display: flex;
flex-direction: column;
gap: 20rpx;
}
}
}
.delInfo{
font-size: 20rpx;
line-height: 26rpx;
color: #3680FE;
}
.scroll-history {
height: calc(100vh - 256rpx);
}
.swiper {
height: calc(100vh - 256rpx);
}
</style>