修改部分bug
This commit is contained in:
@ -24,6 +24,8 @@ Page({
|
||||
monthRefundAmount: 0, // 本月退款总金额
|
||||
monthPromotionCount: 0, // 本月推广数量
|
||||
userRole: '', // 用户角色
|
||||
isShowArr: [],
|
||||
widthRate: '30%'
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@ -45,6 +47,13 @@ Page({
|
||||
break;
|
||||
}
|
||||
this.setData({ showRole });
|
||||
if (options.role === 'manger') this.setData({isShowArr: [true, true, true]})
|
||||
else if (options.role === 'supervisor') this.setData({isShowArr: [false, true, true]})
|
||||
else if (options.role === 'staff') this.setData({isShowArr: [false, false, true]})
|
||||
const trueCount = this.data.isShowArr.filter(v => v === true).length;
|
||||
if (trueCount === 3) this.setData({widthRate: '30%'})
|
||||
else if (trueCount === 2) this.setData({widthRate: '47.5%'})
|
||||
else if (trueCount === 1) this.setData({widthRate: '100%'})
|
||||
},
|
||||
|
||||
fetchPerformance() {
|
||||
|
@ -61,31 +61,36 @@
|
||||
</view>
|
||||
|
||||
<!-- 底部网格 -->
|
||||
<view class="grid pos">
|
||||
<view class="flex-col items-center grid-item">
|
||||
<view class="pos">
|
||||
<view class="flex-row" style="justify-content: space-between;">
|
||||
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[0]}}">
|
||||
<text class="font text_2">主管数量</text>
|
||||
<text class="mt-20 font_2">{{superCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item">
|
||||
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[1]}}">
|
||||
<text class="font text_3">员工数量</text>
|
||||
<text class="mt-20 font_2">{{empCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item">
|
||||
<view style="width: {{widthRate}};" class="flex-col items-center grid-item" wx:if="{{isShowArr[2]}}">
|
||||
<text class="font text_4">客户数量</text>
|
||||
<text class="mt-20 font_2">{{promoCount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
</view>
|
||||
|
||||
<view class="flex-row" style="justify-content: space-between;">
|
||||
<view class="flex-col items-center grid-item_2" style="margin-right: 10rpx">
|
||||
<text class="font text_5">订单总金额</text>
|
||||
<text class="mt-20 font_2">¥{{totalAmount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
<view class="flex-col items-center grid-item_2" style="margin: 40rpx 10rpx 0">
|
||||
<text class="font text_6">订单净成交</text>
|
||||
<text class="mt-20 font_2">¥{{netAmount}}</text>
|
||||
</view>
|
||||
<view class="flex-col items-center grid-item_2">
|
||||
<view class="flex-col items-center grid-item_2" style="margin-left: 10rpx">
|
||||
<text class="font text_7">下单数量</text>
|
||||
<text class="mt-20 font_2">{{orderCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -232,6 +232,8 @@
|
||||
line-height: 24.54rpx;
|
||||
}
|
||||
.grid-item_2 {
|
||||
width: 30%;
|
||||
margin-top: 40rpx;
|
||||
padding: 22.5rpx 0;
|
||||
filter: drop-shadow(0rpx 3.75rpx 3.75rpx #00000040);
|
||||
background-color: #ffffff;
|
||||
|
Reference in New Issue
Block a user