修改部分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() {
|
||||
|
Reference in New Issue
Block a user