设置角色组
This commit is contained in:
@@ -30,12 +30,6 @@ const menuData = [
|
||||
url: '',
|
||||
type: 'balance',
|
||||
},
|
||||
{
|
||||
title: '推广中心',
|
||||
tit: '',
|
||||
url: '',
|
||||
type: 'promoter',
|
||||
},
|
||||
],
|
||||
[{
|
||||
title: '帮助中心',
|
||||
@@ -53,6 +47,16 @@ const menuData = [
|
||||
],
|
||||
];
|
||||
|
||||
// 会员角色组名为 Promoter 时才展示推广中心
|
||||
const PROMOTER_GROUP = 'Promoter';
|
||||
const promoterMenu = {
|
||||
title: '推广中心',
|
||||
tit: '',
|
||||
url: '',
|
||||
icon: '',
|
||||
type: 'promoter',
|
||||
};
|
||||
|
||||
const orderTagInfos = [{
|
||||
title: '待付款',
|
||||
iconName: 'wallet',
|
||||
@@ -134,10 +138,14 @@ Page({
|
||||
customerServiceInfo,
|
||||
} = res.data;
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
menuData[0] = menuData[0].filter(item => item.type !== 'quote');
|
||||
menuData[0] = menuData[0].filter((item) => item.type !== 'quote' && item.type !== 'promoter');
|
||||
if (userInfo.role === 'dev') {
|
||||
menuData[0].splice(1, 0, { title: '我投标的需求', tit: '', url: '', icon: '', type: 'quote' });
|
||||
}
|
||||
if (userInfo.group_name === PROMOTER_GROUP) {
|
||||
const balanceIndex = menuData[0].findIndex((item) => item.type === 'balance');
|
||||
menuData[0].splice(balanceIndex === -1 ? menuData[0].length : balanceIndex + 1, 0, { ...promoterMenu });
|
||||
}
|
||||
menuData[0].forEach((v) => {
|
||||
countsData.forEach((counts) => {
|
||||
if (counts.type === v.type) {
|
||||
|
||||
Reference in New Issue
Block a user