From bb6aebd55fc9a8039e1c199ae1ea8af4eb547b1b Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Wed, 30 Dec 2020 10:32:41 +0800
Subject: [PATCH] gx

---
 hive-app/pages/workbench/index.vue |  193 ++++++++++++++++++++++++++++++------------------
 1 files changed, 121 insertions(+), 72 deletions(-)

diff --git a/hive-app/pages/workbench/index.vue b/hive-app/pages/workbench/index.vue
index 81bcfcd..fbfe475 100644
--- a/hive-app/pages/workbench/index.vue
+++ b/hive-app/pages/workbench/index.vue
@@ -1,41 +1,47 @@
 <template>
 	<!-- 工作台 -->
-	<view class="container">
+	<view class="container" @click="isShow=false">
 		<!-- #ifndef H5 -->
 		<view class="status_bar"></view>
 		<!-- #endif -->
-		<view class="header flex align-center justify-between">
-			<text class="font-18 dark-gray">HIVE</text>
-			<view>
-				<text class="icon gray iconfont iconsousuo mr-15"></text>
+		<view class="header">
+			<text class="font-16 dark-gray">{{userInfo.shopName}}</text>
+			<view class="flex align-center">
+				<navigator url="../member/index" open-type="switchTab" hover-class="none">
+					<text class="icon gray iconfont iconsousuo mr-15"></text>
+				</navigator>
 				<text class="icon gray iconfont iconjia" @click.stop="isShow=!isShow"></text>
 			</view>
+			<popover class="popup-content" v-show="isShow">
+				<view class="popup-content-item">
+					<navigator url="../member/editMember" hover-class="none">
+						<text class="icon iconfont iconjia"></text>
+						<text class="text">新增会员</text>
+					</navigator>
+				</view>
+				<view class="popup-content-item">
+					<text class="icon iconfont iconsaomiao"></text>
+					<text class="text">扫一扫</text>
+				</view>
+			</popover>
 		</view>
-		<popover class="popup-content" v-show="isShow">
-			<view class="popup-item flex align-center">
-				<text class="icon white iconfont iconjia mr-5"></text>
-				<text class="white font-14 popup-content-text">新增会员</text>
-			</view>
-			<view class="popup-item flex align-center">
-				<text class="icon white iconfont iconsaomiao mr-5"></text>
-				<text class="white font-14 popup-content-text">扫一扫</text>
-			</view>
-		</popover>
 		<view class="condition flex justify-around">
 			<view class="eyes">
-				<text class="iconfont iconyanjing2"></text>
-				<!-- <text class="iconfont iconbiyan"></text> -->
+				<text class="iconfont" 
+					:class="isShowAssets?'iconyanjing2':'iconbiyan'" 
+					@click="toggleAssets">
+				</text>
 			</view>
 			<view class="flex flex-v align-center">
-				<text class="font-17">¥ 1000</text>
+				<text class="font-17">¥ {{handleAssets(userAchieve.orderCash)}}</text>
 				<text>今日订单</text>
 			</view>
 			<view class="flex flex-v align-center">
-				<text class="font-17">¥ 100</text>
+				<text class="font-17">¥ {{handleAssets(userAchieve.hisConsume)}}</text>
 				<text>今日消耗</text>
 			</view>
 			<view class="flex flex-v align-center">
-				<text class="font-17">¥ 90</text>
+				<text class="font-17">¥ {{handleAssets(userAchieve.projCommission)}}</text>
 				<text>手工提成</text>
 			</view>
 			
@@ -45,26 +51,26 @@
 			<view class="flex align-center mt-10">
 				<view class="list-item">
 					<navigator url="./selectCustomer" hover-class="none">
-						<image class="content-icon" src="../../static/images/order1.png"></image>
-						<text class="font-12 font-dark">新建订单</text>
+						<image class="icon" src="../../static/images/order1.png"></image>
+						<text>新建订单</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./orderList?status=1"  hover-class="none">
-						<image class="content-icon" src="../../static/images/order2.png"></image>
-						<text class="font-12 font-dark">待付款</text>
+						<image class="icon" src="../../static/images/order2.png"></image>
+						<text>待付款</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./orderList?status=2"  hover-class="none">
-						<image class="content-icon" src="../../static/images/order3.png"></image>
-						<text class="font-12 font-dark">已付款</text>
+						<image class="icon" src="../../static/images/order3.png"></image>
+						<text>已付款</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./"  hover-class="none">
-						<image class="content-icon" src="../../static/images/order4.png"></image>
-						<text class="font-12 font-dark">领用</text>
+						<image class="icon" src="../../static/images/order4.png"></image>
+						<text>领用</text>
 					</navigator>
 				</view>
 			</view>
@@ -74,26 +80,26 @@
 			<view class="flex align-center mt-10">
 				<view class="list-item">
 					<navigator url="./selectCustomer?type=2"  hover-class="none">
-						<image class="content-icon" src="../../static/images/order1.png"></image>
-						<text class="font-12 font-dark">新建服务单</text>
+						<image class="icon" src="../../static/images/order1.png"></image>
+						<text>新建服务单</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./serviceOrderList?status=3"  hover-class="none">
-						<image class="content-icon" src="../../static/images/sever2.png"></image>
-						<text class="font-12 font-dark">待服务</text>
+						<image class="icon" src="../../static/images/sever2.png"></image>
+						<text>待服务</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./serviceOrderList?status=4"  hover-class="none">
-						<image class="content-icon" src="../../static/images/sever3.png"></image>
-						<text class="font-12 font-dark">服务中</text>
+						<image class="icon" src="../../static/images/sever3.png"></image>
+						<text>服务中</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./serviceOrderList?status=5"  hover-class="none">
-						<image class="content-icon" src="../../static/images/sever4.png"></image>
-						<text class="font-12 font-dark">服务完成</text>
+						<image class="icon" src="../../static/images/sever4.png"></image>
+						<text>服务完成</text>
 					</navigator>
 				</view>
 			</view>
@@ -103,26 +109,26 @@
 			<view class="flex align-center mt-10">
 				<view class="list-item">
 					<navigator url="./"  hover-class="none">
-						<image class="content-icon" src="../../static/images/commission1.png"></image>
-						<text class="font-12 font-dark">看板</text>
+						<image class="icon" src="../../static/images/commission1.png"></image>
+						<text>看板</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./"  hover-class="none">
-						<image class="content-icon" src="../../static/images/sever1.png"></image>
-						<text class="font-12 font-dark">客户预约</text>
+						<image class="icon" src="../../static/images/sever1.png"></image>
+						<text>客户预约</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./"  hover-class="none">
-						<image class="content-icon" src="../../static/images/commission2.png"></image>
-						<text class="font-12 font-dark">跟进记录</text>
+						<image class="icon" src="../../static/images/commission2.png"></image>
+						<text>跟进记录</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./"  hover-class="none">
-						<image class="content-icon" src="../../static/images/commission3.png"></image>
-						<text class="font-12 font-dark">通知</text>
+						<image class="icon" src="../../static/images/commission3.png"></image>
+						<text>通知</text>
 					</navigator>
 				</view>
 			</view>
@@ -131,15 +137,15 @@
 			<text class="title">仓库</text>
 			<view class="flex align-center mt-10">
 				<view class="list-item">
-					<navigator url="./"  hover-class="none">
-						<image class="content-icon" src="../../static/images/warehouse1.png"></image>
-						<text class="font-12 font-dark">库存查询</text>
+					<navigator url="./stockSearch"  hover-class="none">
+						<image class="icon" src="../../static/images/warehouse1.png"></image>
+						<text>库存查询</text>
 					</navigator>
 				</view>
 				<view class="list-item">
 					<navigator url="./"  hover-class="none">
-						<image class="content-icon" src="../../static/images/warehouse2.png"></image>
-						<text class="font-12 font-dark">盘点</text>
+						<image class="icon" src="../../static/images/warehouse2.png"></image>
+						<text>盘点</text>
 					</navigator>
 				</view>
 			</view>
@@ -155,17 +161,43 @@
 		},
 		data(){
 			return{
-				isShow:false
+				userInfo: {},
+				userAchieve: {},
+				isShow:false,
+				isShowAssets: false
 			}
 		},
-		onLoad() {
-			// document.addEventListener('click', () => {
-			// 	this.isShow = false
-			// }, false)
+		onShow() {
+			this.getUserAchieve();
+			this.getUserInfo();
+		},
+		onHide() {
+			this.isShow = false;
 		},
 		methods:{
-			appear(){
-				
+			getUserInfo(){
+				let roleInfo = this.$httpUtils.getRoleInfo();
+				this.userInfo = roleInfo || {};
+			},
+			getUserAchieve(){
+				this.$httpUtils.request('/api/user/findUserAchieve/1').then((res) => {
+					if(res.status == 200){
+						let {achieve} = res.mapInfo;
+						this.userAchieve = achieve || {};
+					}else{
+						this.userAchieve = {};
+					}
+				})
+			},
+			// 显示隐藏业绩
+			toggleAssets(){
+				this.isShowAssets = !this.isShowAssets;
+			},
+			handleAssets(val){
+				if(this.isShowAssets){
+					return this.$filters.formatNum(val);
+				}
+				return '***';
 			},
 			linkTo(val){
 				uni.navigateTo({
@@ -179,17 +211,24 @@
 <style>
 	page{
 		background: #F6F6F8;
+		height: 100%;
 	}
-	.icon {
-		font-size: 18px;
-		text-align: center;
-		font-family: texticons;
-	}
+	
 	.container{
 		padding: 0 10px;
+		min-height: 100%;
 	}
 	.header{
+		position: relative;
 		padding: 0 5px 10px;
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+	}
+	 .header .icon {
+		font-size: 16px;
+		text-align: center;
+		font-family: texticons;
 	}
 	.condition{
 		position: relative;
@@ -223,28 +262,38 @@
 	.list-item{
 		width: 25%;
 		text-align: center;
+		font-size: 12px;
+		color: #111111;
 	}
-	.content-icon{
+	.list-item .icon{
 		width: 26px;
 		height: 26px;
 		display: block;
-		margin: 0 auto 5px;
+		margin: 0 auto 10px;
 	}
 	
 	.popup-content{
 		position: absolute;
-		z-index: 99;
-		right: 9px;
-		top: 48px;
-		padding-left: 10px;
+		z-index: 999;
+		right: 0;
+		top: 32px;
+		padding: 5px 0;
 	}
-	
-	.popup-content-text{
-		width: 100%;
+	.popup-content-item{
+		padding: 0 10px;
+		color: #FFFFFF;
+		font-size: 14px;
+	}
+	.popup-content-item .icon{
+		font-size: 14px;
+		margin-right: 10px;
+	}
+	.popup-content-item .text{
 		border-bottom: 1px solid gray;
-		padding: 10px 10px 10px 0;
+		line-height: 32px;
+		display: inline-block;
 	}
-	.popup-content .popup-item:nth-last-of-type(1) .popup-content-text{
+	.popup-content-item:nth-last-of-type(1) .text{
 		border-bottom: 0;
 	}
 </style>

--
Gitblit v1.9.1