设置角色组
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// 接口环境:按小程序运行版本自动切换,无需注释切换域名
|
||||
// develop: 开发者工具运行/真机预览调试 | trial: 上传后的体验版 | release: 审核发布的正式版
|
||||
const API_ROOTS = {
|
||||
develop: 'http://codebg.cn', // 本地开发(phpStudy,hosts 需将 codebg.cn 指向 127.0.0.1)
|
||||
develop: 'https://code.syoai.cn', // 本地开发(http://codebg.cn)
|
||||
trial: 'https://code.syoai.cn', // 体验版(线上,需 https + 备案域名)
|
||||
release: 'https://code.syoai.cn', // 正式版(线上,需 https + 备案域名)
|
||||
};
|
||||
|
||||
@@ -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