data.vue
1.5 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
<template>
<view class="data_container">
<!-- 头部模块 -->
<u-sticky >
<view class="nav-header">
<view class="nav_box" :class="{active: currentData === 0}" @click="currentData = 0">总览</view>
<view class="nav_box" :class="{active: currentData === 1}" @click="currentData = 1">收入明细</view>
</view>
</u-sticky>
<!-- 内容模块 -->
<view class="content">
<!-- 数据总览 -->
<DataPandect v-show="currentData === 0" />
<!-- 数据明细 -->
<DataDetail v-show="currentData === 1" />
</view>
</view>
</template>
<script>
import DataPandect from '@/components/data/dataPandect.vue'
import DataDetail from '@/components/data/dataDetail.vue'
export default {
components: { DataPandect, DataDetail },
data(){
return {
currentData: 0, // 切换数据
}
}
}
</script>
<style lang="scss" scoped>
.data_container {
background-color: #F6F7FB;
padding-bottom: 180rpx;
min-height: 100vh;
// 头部模块
.nav-header{
display: flex;
align-items: center;
justify-content: center;
height: 80rpx;
background-color: #fff;
.nav_box{
position: relative;
flex: 1;
height: 100%;
color: #BBBBBB;
font-size: 32rpx;
text-align: center;
line-height: 80rpx;
&.active{
font-weight: 500;
color: #333;
&::after{
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
content: '';
width: 40rpx;
height: 8rpx;
background-color: #FFA100;
border-radius: 20rpx;
}
}
}
}
}
</style>