From 856e7ac04edd98e79cc969af262db0b508b76139 Mon Sep 17 00:00:00 2001
From: zhouwenxuan <1175765986@qq.com>
Date: Fri, 04 Aug 2023 15:50:48 +0800
Subject: [PATCH] 文件预览
---
pages/tabBar/firstPage/firstPage.vue | 84 +++++++++++++++++++++++++++++++++++++----
1 files changed, 75 insertions(+), 9 deletions(-)
diff --git a/pages/tabBar/firstPage/firstPage.vue b/pages/tabBar/firstPage/firstPage.vue
index 2d7b90d..5bc44b0 100644
--- a/pages/tabBar/firstPage/firstPage.vue
+++ b/pages/tabBar/firstPage/firstPage.vue
@@ -11,25 +11,37 @@
</view>
<view class="list">
<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="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) ;"
+ 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>
@@ -39,6 +51,7 @@
<script>
import tabBar from '../tabBarIndex.vue'
+ import {getExamine} from '../../../api/examine.js'
export default {
components:{
tabBar
@@ -47,7 +60,18 @@
return {
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: ''
}
},
@@ -55,10 +79,29 @@
//获取手机状态栏高度
this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
uni.hideTabBar();
+
+
+ },
+ onShow(){
this.role = uni.getStorageSync('roleName');
console.log("role",this.role)
+ this.getNum();
},
methods: {
+ 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'
@@ -107,9 +150,16 @@
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{
@@ -123,10 +173,26 @@
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;
+}
+.badge span{
+ text-align: center;
+ width: 100%;
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.2