From a6653e19d20a61e7b8f788037d2a4df3f93a4f32 Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Tue, 12 Jan 2021 16:51:03 +0800
Subject: [PATCH] gx
---
hive-app/pages/mine/index.vue | 100 ++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 77 insertions(+), 23 deletions(-)
diff --git a/hive-app/pages/mine/index.vue b/hive-app/pages/mine/index.vue
index 19cfa5d..fbc8aa7 100644
--- a/hive-app/pages/mine/index.vue
+++ b/hive-app/pages/mine/index.vue
@@ -5,22 +5,24 @@
<view class="status_bar"></view>
<!-- #endif -->
<view class="header">
- <navigator url="./setting" class="icon white iconfont iconshezhi right"></navigator>
+ <view class="right">
+ <text class=" white iconfont iconshezhi icon" @click="toSetting"></text>
+ </view>
<view class="flex align-center">
- <image class="header-img ml-15" src="../../static/images/head-img.jpg"></image>
- <view class="flex flex-v ml-20">
- <view>
- <text class="font-18 white mr-5">222是个帅哥</text>
- <text class="white icon iconfont iconxiugai"></text>
- </view>
+ <image class="header-img ml-10" :src="userInfo.photo?userInfo.photo:'../../static/images/default-avatar.png'"></image>
+ <view class="flex flex-v ml-15">
+ <navigator url="./myInfo" hover-class="none">
+ <text class="font-18 white mr-5">{{userInfo.name}}</text>
+ <text class="white font-16 iconfont iconxiugai"></text>
+ </navigator>
<view class="flex mt-10">
- <view class="mr-20">
+ <view class="mr-20 ellipsis ellipsis-rolename">
<text class="white mr-5 font-14">职位:</text>
- <text class="white font-14">靓仔</text>
+ <text class="white font-14">{{userInfo.roleName}}</text>
</view>
- <view>
+ <view class="ellipsis ellipsis-shopname">
<text class="white mr-5 font-14">门店:</text>
- <text class="white font-14">梅溪湖店</text>
+ <text class="white font-14">{{userInfo.shopName}}</text>
</view>
</view>
</view>
@@ -31,49 +33,54 @@
<view class="tab-box">
<h-tabs
class="tab"
+ :activeIndex="type-1"
:tabData="tabs"
+ @tabClick="tabChange"
:config="{
color: '#abb1cc',
activeColor: '#518EFF',
underLineColor: '#518EFF',
underLineHeight: 4,
- fontSize: '30px',
+ fontSize: 26,
itemWidth: 70,
underLineWidth: 60,
}"
/>
+ <view class="look-more" @click="lookMore">
+ 更多<text class="iconfont iconarrow-backimg light-gray"></text>
+ </view>
<view class="performance-content">
<view class="flex justify-around">
<view class="flex flex-v align-center performance-item">
- <text class="font-16 red">600.00</text>
+ <text class="font-16 red">{{userAchieve.orderCash | formatNum}}</text>
<text class="mt-5">订单业绩</text>
</view>
<view class="flex flex-v align-center performance-item">
- <text class="font-16 green">600.00</text>
+ <text class="font-16 green">{{userAchieve.cash | formatNum}}</text>
<text class="mt-5">现金业绩</text>
</view>
<view class="flex flex-v align-center performance-item">
- <text class="font-16 purple">600.00</text>
+ <text class="font-16 purple">{{userAchieve.cardUse | formatNum}}</text>
<text class="mt-5">划扣业绩</text>
</view>
</view>
<view class="flex justify-around mt-15">
<view class="flex flex-v align-center performance-item">
- <text class="font-16 blueness">600.00</text>
- <text class="mt-5">本金业绩</text>
+ <text class="font-16 blueness">{{userAchieve.hisConsume | formatNum}}</text>
+ <text class="mt-5">本金消耗</text>
</view>
<view class="flex flex-v align-center performance-item">
- <text class="font-16 orange">600.00</text>
+ <text class="font-16 orange">{{userAchieve.freeConsume | formatNum}}</text>
<text class="mt-5">赠送消耗</text>
</view>
<view class="flex flex-v align-center performance-item">
- <text class="font-16 yellow">600.00</text>
+ <text class="font-16 yellow">{{userAchieve.projCommission | formatNum}}</text>
<text class="mt-5">服务提成</text>
</view>
</view>
</view>
</view>
- <navigator url="./knowledge" class="flex align-center justify-between repository mt-10">
+ <navigator url="./knowledge" class="flex align-center justify-between repository mt-10" v-if="$utils.hasPermission('zhishiku')">
<view class="flex align-center">
<image class="title-img mr-10" src="../../static/images/mine2.png"></image>
<text>知识库</text>
@@ -111,17 +118,42 @@
name: '上月'
},
],
+ userAchieve: {},
+ userInfo: {}
}
},
onShow() {
- this.getUserInfo()
+ this.getUserAchieve();
+ this.getUserInfo();
},
methods: {
getUserInfo(){
+ let roleInfo = this.$httpUtils.getRoleInfo();
+ this.userInfo = roleInfo || {};
+ },
+ getUserAchieve(){
this.$httpUtils.request('/api/user/findUserAchieve/'+this.type).then((res) => {
if(res.status == 200){
-
+ let {achieve} = res.mapInfo;
+ this.userAchieve = achieve || {};
+ }else{
+ this.userAchieve = {};
}
+ })
+ },
+ tabChange(e){
+ this.type = e + 1;
+ this.getUserAchieve()
+ },
+ toSetting(){
+ let isLogin = (JSON.stringify(this.userInfo) !== '{}')?1:0;
+ uni.navigateTo({
+ url: './setting?isLogin='+isLogin
+ })
+ },
+ lookMore(){
+ uni.navigateTo({
+ url: '../manager/employeeReport'
})
}
}
@@ -140,7 +172,7 @@
background: #518EFF;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
- padding: 15px;
+ padding: 15px 10px;
}
.icon {
font-size: 18px;
@@ -150,6 +182,7 @@
width: 64px;
height: 64px;
border-radius: 50%;
+ flex: 0 0 64px;
}
.content{
padding: 0 10px;
@@ -166,9 +199,18 @@
background: #FFFFFF;
border-radius: 4px;
margin-top: 10px;
+ position: relative;
}
.tab{
border-bottom: 1px solid #EDEAF4;
+ }
+ .look-more{
+ position: absolute;
+ z-index: 99;
+ top: 22rpx;
+ right: 10px;
+ color: rgb(171, 177, 204);
+ font-size: 26rpx;
}
.performance-content{
padding: 20px 0;
@@ -183,4 +225,16 @@
background: #FFFFFF;
font-size: 15px;
}
+ .ellipsis{
+ color: #FFFFFF;
+ overflow: hidden;
+ text-overflow:ellipsis;
+ white-space: nowrap;
+ }
+ .ellipsis-rolename{
+ max-width: 125px;
+ }
+ .ellipsis-shopname{
+ max-width: 90px;
+ }
</style>
--
Gitblit v1.9.1