From e2525e1ed686dc305e562757c3a00b37ac3beec4 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 21 六月 2024 16:24:32 +0800
Subject: [PATCH] time

---
 h5/pages/staff/index.vue |   38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/h5/pages/staff/index.vue b/h5/pages/staff/index.vue
index e92bb5a..c1748bf 100644
--- a/h5/pages/staff/index.vue
+++ b/h5/pages/staff/index.vue
@@ -1,8 +1,9 @@
 <template>
 	<view class="main_app">
 		<view class="title_wrap">
-			<view class="name">{{ userInfo.realname || '' }}锛屾杩庣櫥褰曪綖</view>
-			<view class="btn" @click="loginOut">閫�鍑虹櫥褰�</view>
+			<view class="name" v-if="userInfo.realname">{{ userInfo.realname || '' }}锛屾杩庣櫥褰曪綖</view>
+			<view class="name" v-else>璇峰厛鐧诲綍</view>
+			<view class="btn" @click="loginOut">{{ userInfo.realname ? '閫�鍑虹櫥褰�' : '鍘荤櫥褰�' }}</view>
 		</view>
 		<view class="banner_wrap">
 			<view class="h1">瀹夋嘲鐗╂祦</view>
@@ -48,7 +49,7 @@
 				<image class="img" src="@/static/staff/ic_renwuzhongxin.png"></image>
 				<view class="h1">浠诲姟涓績</view>
 				<view class="h2">TASK CENTER</view>
-				<view class="task_num">99+</view>
+				<view class="task_num">{{ taskNum }}</view>
 			</view>
 			<view class="img_wrap" @click="jump('/pages/staff/meetingCalendar')">
 				<image class="img" src="@/static/staff/ic_wodehuiyi.png"></image>
@@ -74,15 +75,22 @@
 </template>
 
 <script>
-import { logoutPost } from '@/api'
+import { logoutPost, stagingHead } from '@/api'
 export default {
 	data() {
 		return {
-			userInfo: uni.getStorageSync('userInfo')
+			userInfo: uni.getStorageSync('userInfo'),
+			taskNum: 0
 		};
 	},
 	onLoad(){
 		console.log('userInfo', this.userInfo);
+		
+	},
+	onShow() {
+		if(this.userInfo && this.userInfo.name){
+			this.getTaskInfo()
+		}
 	},
 	methods: {
 		jump(path){
@@ -97,6 +105,13 @@
 				url: '/pages/staffLogin/login'
 			})
 		},
+		getTaskInfo() {
+      stagingHead({
+        isDetail: '0'
+      }).then(res => {
+        this.taskNum = res.data.taskNum
+      })
+    },
 	}
 };
 </script>
@@ -116,9 +131,9 @@
 		width: 144rpx;
 		height: 56rpx;
 		border-radius: 36rpx;
-		border: 1rpx solid #279baa;
+		border: 1rpx solid $uni-color-primary;
 		font-size: 26rpx;
-		color: #279baa;
+		color: $uni-color-primary;
 		display: flex;
 		justify-content: center;
 		align-items: center;
@@ -210,11 +225,12 @@
 		}
 		.task_num{
 			position: absolute;
-			left: 164rpx;
-			top: 20rpx;
-			width: 60rpx;
-			height: 48rpx;
+			left: 168rpx;
+			top: 26rpx;
+			width: 52rpx;
+			height: 52rpx;
 			border-radius: 50%;
+			/* border: 1px solid; */
 			background-color: #fff;
 			color: #db534c;
 			display: flex;

--
Gitblit v1.9.3