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
| <template>
| <view>
| <!-- 自定义导航栏 -->
| <view class="navBarBox fix">
| <!-- 状态栏占位 -->
| <view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
| <!-- 真正的导航栏内容 -->
| <view class="navBar">
| <view class="barText"></view>
| </view>
| </view>
| <text>信息统计模块待呈现</text>
| <tabBar :currentPagePath="page"></tabBar>
| </view>
| </template>
|
| <script>
| import tabBar from '../tabBarIndex.vue'
| export default {
| components:{
| tabBar
| },
| data() {
| return {
| page: 'pages/tabBar/count/count',
| statusBarHeight: ''
| }
|
| },
| onLoad() {
| //获取手机状态栏高度
| this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
| uni.hideTabBar();
| }
| }
|
| </script>
|
| <style>
| .navBarBox .navBar {
| background-color:lightgrey;
| height: 15px;
| display: flex;
| flex-direction: row;
| justify-content: center;
| align-items: center;
| }
| .fix{
| position: sticky;
| top: 0;
| left: 0;
| right: 0;
| width: 100%;
| z-index: 1;
| }
| .statusBar{
| background-color:lightgrey;
| }
| </style>
|
|