style: 订单详情nav展示问题

This commit is contained in:
2026-07-14 15:56:55 +08:00
parent 74a4f25ebd
commit 585fd6fb7e
3 changed files with 37 additions and 5 deletions
+31 -1
View File
@@ -227,6 +227,33 @@
return p.startsWith('/') ? p : `/${p}`;
};
const USER_ROOT_PAGES = [
'/pages/index/index',
'/pages/index/aiStore',
'/pages/home/seed',
'/pages/cart/cart',
'/pages/index/user',
];
const MERCHANT_ROOT_PAGES = [
'/pages/merchant/pickupList',
'/pages/merchant/scanVerify',
'/pages/merchant/storeManage',
];
const enforceBizModeRoute = () => {
const pages = getCurrentPages?.() || [];
const current = pages[pages.length - 1];
const currentPath = normalizePath(current?.route || '');
if (!currentPath) return;
if (isMerchantMode.value && USER_ROOT_PAGES.includes(currentPath)) {
uni.reLaunch({ url: '/pages/merchant/pickupList' });
return;
}
if (!isMerchantMode.value && MERCHANT_ROOT_PAGES.includes(currentPath)) {
uni.reLaunch({ url: '/pages/index/index' });
}
};
const updateTabbarPath = () => {
if (typeof props.tabbar === 'string' && props.tabbar) {
tabbarPath.value = normalizePath(props.tabbar);
@@ -237,7 +264,10 @@
tabbarPath.value = normalizePath(current?.route || '');
};
onShow(() => updateTabbarPath());
onShow(() => {
enforceBizModeRoute();
updateTabbarPath();
});
watch(() => props.tabbar, () => updateTabbarPath(), { immediate: true });
onMounted(() => {