设置角色组

This commit is contained in:
Dev
2026-10-17 16:29:14 +08:00
parent 2d342bcbd7
commit 8a3f133488
8 changed files with 89 additions and 10 deletions
+1 -1
View File
@@ -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 + 备案域名)
};
+15 -7
View File
@@ -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) {