zhouwenxuan
2023-08-02 9461caf2a459a7ed1eb16f8f439c02cfbcf1930b
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
<template>
    <view>
        <!-- 自定义导航栏 -->
        <view class="navBarBox fix">
            <!-- 状态栏占位 -->
            <view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
            <!-- 真正的导航栏内容 -->
            <view class="navBar">
                <view class="barText">首页</view>
            </view>
        </view>
        <view  class="list">
            <view class="first" @click="goExamine" v-if="role == '审核领导'">
                <view class="icon">
                    <image src="../../../static/examine.png" class="img"></image>预警审核
                </view>
            </view>
            <view class="first" 
                @click="goCurrent"
                style="background-color:rgb(249, 130, 180) ;"
            >
                <view class="icon">
                    <image src="../../../static/look.png" class="img"></image>信息查看
                </view>
            </view>
            <view class="first" 
                style="background-color: rgb(41, 203, 280);"
                @click="goWeather"
            >
                <view class="icon">
                    <image src="../../../static/we.png" class="img"></image>实时气象
                </view>
            </view>
            <view class="first" 
                style="background-color: rgb(11, 246, 158) ;margin-bottom: 35px;"
                @click="goCount"
            >
                <view class="icon">
                    <image src="../../../static/count.png" class="img"></image>统计分析
                </view>
            </view>
            
        </view>
        <tabBar :currentPagePath="page"></tabBar>
    </view>
</template>
 
<script>
    import tabBar from '../tabBarIndex.vue'
    export default {
        components:{
            tabBar
        },
        data() {
            return {
                page: 'pages/tabBar/firstPage/firstPage',
                statusBarHeight: '',
                leaderType: 'da'
            }
            
        },
        onLoad() {
            //获取手机状态栏高度
            this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
            uni.hideTabBar();
            this.role = uni.getStorageSync('roleName');
            console.log("role",this.role)
        },
        methods: {
            goExamine() {
                uni.switchTab({
                  url: '/pages/tabBar/examine/examine'
                })
            },
            goCurrent() {
                uni.switchTab({
                  url: '/pages/tabBar/current/current'
                })
            },
            goCount() {
                uni.switchTab({
                  url: '/pages/tabBar/count/count'
                })
            },
            goWeather(){
                uni.switchTab({
                  url: '/pages/tabBar/weather/weather'
                })
            }
        }
    }
 
</script>
 
<style>
.navBarBox .navBar {
    background-color:#fff;
      height: 50px;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    
}
.fix{
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1;
}
.statusBar{
    background-color:lightgrey;
}
.list{
  margin: 12px 12px 0;
  padding: 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: calc(100% - 24px);
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    
}
.first{
    width: 100%;
    height: 110px;
    background-color: red;
    text-align: center;
    line-height: 110px;
    border-radius: 20px;
    background-color: rgb(246,191,170);
    border: 1px solid lightgrey;
    font-size: 18px;
    margin-top: 40px;
    color: #2c2c2c;
    font-weight: 600;
}
.icon{
    display: flex;
    align-items: center;
    justify-content: center;
}
.barText{
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}
.img{
    width: 20px;
    height: 20px;
    margin-right: 6px;
}
</style>