From 4eef04aa662cf4f8fbde60ca99c0011b6203c558 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期三, 11 九月 2024 14:26:44 +0800
Subject: [PATCH] 增加管理员等功能

---
 src/pages/mine/index.vue |   54 ++++++++++++++++++++++++++++++------------------------
 1 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue
index 6e7e3ed..9eccc21 100644
--- a/src/pages/mine/index.vue
+++ b/src/pages/mine/index.vue
@@ -80,18 +80,21 @@
             </view>
         </view> -->
 		<view class="nav-box" v-if="identity=='enterprise'">
-			<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
-				v-for="(item, index) in navList" :key="item.name">
-				<view class="nav-title">
-					<view :class="'iconfont ' + item.icon"></view>
-					{{ item.name }}
-				</view>
-
-				<view class="nav-icon">
-					<view v-if="item.num || item.num === 0">{{ item.num }}</view>
-					<view class="iconfont iconarrow"></view>
+			<view class="" v-if="isAdmin">
+				<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
+					v-for="(item, index) in navList" :key="item.name">
+					<view class="nav-title">
+						<view :class="'iconfont ' + item.icon"></view>
+						{{ item.name }}
+					</view>
+				
+					<view class="nav-icon">
+						<view v-if="item.num || item.num === 0">{{ item.num }}</view>
+						<view class="iconfont iconarrow"></view>
+					</view>
 				</view>
 			</view>
+			
 		</view>
 		<view class="nav-box" v-else>
 			<view @tap="item.cb" class="nav-item" :data-index="index" data-ptpid="58ac-1481-a7d3-b98e"
@@ -119,17 +122,15 @@
 		data() {
 			return {
 				identity: '',
-				navList: [
-					// 	{
-					// 	icon: 'icon-huabanfuben',
-					// 	name: '宸ヤ汉鎵撳崱璁板綍',
-					// 	cb: function() {
-					// 		uni.navigateTo({
-					// 			url: '/pages/company/index'
-					// 		});
-					// 	}
-					// },
-				],
+				navList: [{
+					icon: 'icon-huabanfuben',
+					name: '鍛樺伐绠$悊',
+					cb: function() {
+						uni.navigateTo({
+							url: '/pages/company/staff'
+						});
+					}
+				}, ],
 				navList1: [{
 						icon: 'icon-wanshanxinxi',
 						name: '瀹屽杽璧勬枡',
@@ -152,7 +153,8 @@
 				],
 				isLogin: false,
 				userInfo: {},
-				balance: '0.00'
+				balance: '0.00',
+				isAdmin: false
 			};
 		},
 		onLoad: function() {
@@ -183,19 +185,23 @@
 			// this.userInfo = this.$db.get('userInfo') ? JSON.parse(this.$db.get('userInfo')) : {}
 			// this.token = this.$db.get('userToken') ? this.$db.get('userToken') : ''
 			this.isLogin = this.token ? true : false;
+			this.isAdmin = this.userInfo.userCompany ? this.userInfo.userCompany.isAdmin : false
 		},
 		onPullDownRefresh() {
 			this.$api.getUser().then(res => {
 				this.$db.set('userInfo', JSON.stringify(res.data))
 				this.userInfo = res.data
+				this.isAdmin = this.userInfo.userCompany ? this.userInfo.userCompany.isAdmin : false
 				if (this.identity == 'worker') {
 					if (this.userInfo.userWorker) {
-						this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo.userWorker
+						this.balance = this.$common.moneySub(this.userInfo.userWorker.tiXianZonge, this.userInfo
+							.userWorker
 							.yiTiXianJine)
 					}
 				} else {
 					if (this.userInfo.userCompany) {
-						this.balance = this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany.chongZhiYue :
+						this.balance = this.userInfo.userCompany.chongZhiYue ? this.userInfo.userCompany
+							.chongZhiYue :
 							'0.00'
 					}
 				}

--
Gitblit v1.9.1