feat: 多网点展示

This commit is contained in:
2026-07-15 14:15:14 +08:00
parent ea5b1c2532
commit a88952db3a
2 changed files with 23 additions and 3 deletions
+12 -1
View File
@@ -13,7 +13,18 @@
const userStore = sheep.$store('user');
const label = computed(() => (appStore.bizMode === 'merchant' ? '商户' : '用户'));
const showSwitch = computed(() => Number(userStore?.userInfo?.storeId || 0) > 0);
const hasStoreAccess = (value) => {
if (Array.isArray(value)) {
return value.some((item) => String(item ?? '').trim() !== '');
}
return String(value ?? '')
.split(',')
.some((item) => item.trim() !== '');
};
const showSwitch = computed(() => {
const info = userStore?.userInfo || {};
return hasStoreAccess(info.storeIds) || hasStoreAccess(info.storeId);
});
onMounted(() => {
if (!userStore?.isLogin) return;