From 0b2357a173a2bc52f3532bfcf93ff31daf226231 Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期三, 06 九月 2023 14:44:23 +0800 Subject: [PATCH] 导航栏退出登录 --- pages/tabBar/firstPage/firstPage.vue | 157 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 138 insertions(+), 19 deletions(-) diff --git a/pages/tabBar/firstPage/firstPage.vue b/pages/tabBar/firstPage/firstPage.vue index 4087820..aa771bc 100644 --- a/pages/tabBar/firstPage/firstPage.vue +++ b/pages/tabBar/firstPage/firstPage.vue @@ -7,29 +7,56 @@ <!-- 真正的导航栏内容 --> <view class="navBar"> <view class="barText">首页</view> + <view > + <u-button type="text" @click="loginOut" style="color: blue;margin-right: 5px;">退出</u-button> + </view> </view> </view> <view class="list"> - <view class="first" @click="goExamine"> - 预警审核 + <view class="first" @click="goExamine" v-if="role == '审核领导'"> + <view class="badge"> + <u-badge type="error" :absolute="true" :offset="[90 + statusBarHeight ,65]" max="99" :value="examineNum" style="line-height: 40px;font-size: 14px;width: 30px;height: 40px;"> + </u-badge> + </view> + <view class="text">预警审核</view> + <view class="eng">WARNING REVIEW</view> + <view class="icon"> + <view class="heng"></view> + <image src="../../../static/examine.png" class="img"></image> + </view> </view> <view class="first" @click="goCurrent" - style="background-color:rgb(249, 130, 180) ;" + style="background-color:rgb(255, 160, 235) ;" > - 信息查看 + <view class="text">信息查看</view> + <view class="eng">INFORMATION VIEWING</view> + <view class="icon"> + <view class="heng"></view> + <image src="../../../static/look.png" class="img"></image> + </view> </view> <view class="first" - style="background-color: rgb(41, 203, 280);" + style="background-color: rgb(112,179, 224);" @click="goWeather" > - 实时气象 + <view class="text">实时气象</view> + <view class="eng">RWAL TIME WEATHER</view> + <view class="icon"> + <view class="heng"></view> + <image src="../../../static/we.png" class="img"></image> + </view> </view> <view class="first" - style="background-color: rgb(11, 246, 158) ;" + style="background-color: rgb(134, 204, 170) ;margin-bottom: 35px;" @click="goCount" > - 统计分析 + <view class="text">统计分析</view> + <view class="eng">STATISTIC ANALYSIS</view> + <view class="icon"> + <view class="heng"></view> + <image src="../../../static/count1.png" class="img"></image> + </view> </view> </view> @@ -39,15 +66,35 @@ <script> import tabBar from '../tabBarIndex.vue' + import {getExamine} from '../../../api/examine.js' +import { Value } from 'sass'; export default { components:{ tabBar }, data() { return { + titleList:[ + { + label: '默认排序', + value: 1, + } + ], page: 'pages/tabBar/firstPage/firstPage', statusBarHeight: '', - leaderType: 'da' + leaderType: 'da', + examineNum: 0, + data: { + pageIndex: 1, + pageSize: 9999, + searchParams: { + emergType: null,//1-紧急;2-常规 + warningLevel: null,//1-红色预警;2-橙色预警;3-黄色预警;4-蓝色预警 + reviewStatus: null//1:未审核,2:已审核,3:审核已驳回 + } + }, + role: '', + realname:'' } }, @@ -55,8 +102,38 @@ //获取手机状态栏高度 this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight']; uni.hideTabBar(); + this.realname = uni + + + }, + onShow(){ + this.role = uni.getStorageSync('roleName'); + this.realname = uni.getStorageSync('user').realName + console.log("role",uni.getStorageSync('user')) + this.getNum(); }, methods: { + loginOut() { + uni.clearStorageSync(); + uni.clearStorage(); + uni.navigateTo({ + url: '/pages/index/index' + }) + }, + getNum(){ + this.data.searchParams.reviewStatus = 1; + getExamine(this.data).then(res => { + if(res.code == 100) { + if(res.data && res.data.length > 0){ + this.examineNum = res.data.length; + }else { + this.examineNum = 0; + } + }else{ + uni.$u.toast(res.msg) + } + }) + }, goExamine() { uni.switchTab({ url: '/pages/tabBar/examine/examine' @@ -105,26 +182,68 @@ background-color:lightgrey; } .list{ - display: flex; - flex-direction: column; - padding: 10px 15px; + 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-radius: 15px; + background-color: rgb(241,161,108); border: 1px solid lightgrey; - font-size: 18px; + margin-top: 40px; + +} +.text{ + font-size: 18px; + padding-top: 15px; + padding-left: 15px; + color: #faf9f4; + font-family: '宋体'; + font-weight: 600; +} +.eng{ + font-size: 14px; + padding-left: 15px; + color: rgba(250,249,244,0.5); +} +.icon{ + display: flex; + align-items: baseline; + justify-content: space-between; } .barText{ - text-align: center; + /* text-align: center; */ font-size: 16px; font-weight: 600; + flex: 2; + margin-left: 45%; +} +.img{ + width: 45px; + height: 45px; + margin-right: 16px; + margin-bottom: 5px; + +} +.badge span{ + text-align: center; + width: 100%; +} +.heng{ + width: 30px; + height: 3px; + background-color: rgba(230,230,230,0.5); + margin-left: 15px; } </style> \ No newline at end of file -- Gitblit v1.9.2