feat: 支持角色身份自定义名称全链路配置与动态展示

这个提交包含在:
chen
2026-09-17 15:40:47 +08:00
父节点 06e98c57e0
当前提交 f8179706b3
共有 24 个文件被更改,包括 508 次插入 和 110 次删除

查看文件

@@ -18,10 +18,10 @@
mode="aspectFill"
>
</image>
<text class="tag-title">{{ agentInfo.level_info?.name }}</text>
<text class="tag-title">{{ levelTitle }}</text>
</view>
<view v-if="agentInfo.is_venue || agentInfo.identities?.includes('venue')" class="mini-tag">酒道馆</view>
<view v-if="agentInfo.is_county || agentInfo.identities?.includes('county')" class="mini-tag">区县</view>
<view v-if="agentInfo.is_venue || agentInfo.identities?.includes('venue')" class="mini-tag">{{ roleNames.venue || '酒道馆' }}</view>
<view v-if="agentInfo.is_county || agentInfo.identities?.includes('county')" class="mini-tag">{{ roleNames.county || '区县' }}</view>
<view class="ss-iconfont uicon-arrow-right" style="color: #fff; font-size: 28rpx">
</view>
</view>
@@ -39,6 +39,29 @@
const agentInfo = computed(() => sheep.$store('user').agentInfo);
const headerBg = sheep.$url.css('/assets/addons/shopro/uniapp/commission/background.png');
const roleNames = computed(() => {
return (
userInfo.value?.custom_role_names ||
userInfo.value?.role_names ||
agentInfo.value?.custom_role_names ||
agentInfo.value?.role_names ||
{}
);
});
const levelTitle = computed(() => {
if (userInfo.value?.maker_level_name) return userInfo.value.maker_level_name;
if (agentInfo.value?.maker_level_name) return agentInfo.value.maker_level_name;
const rawName = agentInfo.value?.level_info?.name;
if (rawName && roleNames.value.maker && rawName.includes('创客')) {
return rawName.replace('创客', roleNames.value.maker);
}
if (rawName && roleNames.value.taster && rawName.includes('品酒师')) {
return rawName.replace('品酒师', roleNames.value.taster);
}
return rawName || '';
});
const state = reactive({
showMoney: false,
});

查看文件

@@ -96,21 +96,34 @@
</template>
<script setup>
import { reactive } from 'vue';
import { computed, reactive } from 'vue';
import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app';
import sheep from '@/sheep';
import _ from 'lodash';
const headerBg = sheep.$url.css('/assets/addons/shopro/uniapp/user/wallet_card_bg.png');
const tabMaps = [
const userInfo = computed(() => sheep.$store('user').userInfo);
const agentInfo = computed(() => sheep.$store('user').agentInfo);
const roleNames = computed(() => {
return (
userInfo.value?.custom_role_names ||
userInfo.value?.role_names ||
agentInfo.value?.custom_role_names ||
agentInfo.value?.role_names ||
{}
);
});
const tabMaps = computed(() => [
{ name: '全部', value: 'all' },
{ name: '开拓奖', value: 'push3' },
{ name: '创客', value: 'maker' },
{ name: '酒道馆', value: 'venue' },
{ name: '区县', value: 'county' },
{ name: roleNames.value.maker || '创客', value: 'maker' },
{ name: roleNames.value.venue || '酒道馆', value: 'venue' },
{ name: roleNames.value.county || '区县', value: 'county' },
{ name: '加权奖励', value: 'share' },
];
]);
const emptyPagination = {
data: [],

查看文件

@@ -221,13 +221,13 @@
v-if="item.agent?.is_venue || item.agent?.identities?.includes('venue')"
class="mini-tag tag-venue"
>
酒道馆
{{ roleNames.venue || '酒道馆' }}
</view>
<view
v-if="item.agent?.is_county || item.agent?.identities?.includes('county')"
class="mini-tag tag-county"
>
区县代理
{{ roleNames.county || '区县代理' }}
</view>
</view>
</view>
@@ -403,13 +403,13 @@
v-if="state.currentMember.agent?.is_venue || state.currentMember.agent?.identities?.includes('venue')"
class="id-pill mini-tag tag-venue ss-m-r-12 ss-m-b-10"
>
酒道馆
{{ roleNames.venue || '酒道馆' }}
</view>
<view
v-if="state.currentMember.agent?.is_county || state.currentMember.agent?.identities?.includes('county')"
class="id-pill mini-tag tag-county ss-m-r-12 ss-m-b-10"
>
区县代理
{{ roleNames.county || '区县代理' }}
</view>
</view>
</view>
@@ -516,6 +516,16 @@
const userInfo = computed(() => sheep.$store('user').userInfo);
const headerBg = sheep.$url.css('/assets/addons/shopro/uniapp/user/withdraw_bg.png');
const roleNames = computed(() => {
return (
userInfo.value?.custom_role_names ||
userInfo.value?.role_names ||
agentInfo.value?.custom_role_names ||
agentInfo.value?.role_names ||
{}
);
});
// 控制吸顶及页面滚动
onPageScroll((e) => {
state.scrollTop = e.scrollTop > 100;
@@ -527,13 +537,13 @@
{ name: '二级间推', value: '2' },
];
const filterPills = [
const filterPills = computed(() => [
{ label: '全部', value: 'all' },
{ label: '合伙股东', value: 'partner' },
{ label: roleNames.value.partner || '合伙股东', value: 'partner' },
{ label: '正常活跃', value: 'active' },
{ label: '临期预警', value: 'expiring' },
{ label: '已暂停', value: 'inactive' },
];
]);
const sortOptions = [
{ label: '最新加入', value: 'createtime' },
@@ -581,12 +591,25 @@
}
function memberLevelName(item) {
return (
item?.agent?.level_info?.name ||
item?.agent?.maker_level_name ||
item?.agent?.identity_text ||
''
);
const rNames =
item?.agent?.custom_role_names ||
item?.agent?.role_names ||
roleNames.value ||
{};
if (item?.agent?.maker_level_name) {
return item.agent.maker_level_name;
}
const rawName = item?.agent?.level_info?.name;
if (rawName) {
if (rNames.maker && rawName.includes('创客')) {
return rawName.replace('创客', rNames.maker);
}
if (rNames.taster && rawName.includes('品酒师')) {
return rawName.replace('品酒师', rNames.taster);
}
return rawName;
}
return item?.agent?.identity_text || '';
}
function formatTime(timestamp) {