feat: 客户门户多页签与顶栏/侧栏体验,下单成功带单号跳转查询
All checks were successful
Build and Deploy Front / deploy (push) Successful in 11m56s

客户端启用与管理端同款页签并修标题 i18n;顶栏主题色菜单坞与独立 Logo;侧栏底栏布局与选中态调整;下单成功携带 keyword 打开订单列表。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zzh 2026-11-27 10:01:06 +08:00
parent cd27fc3029
commit 95c71f4c44
9 changed files with 288 additions and 154 deletions

View File

@ -90,25 +90,8 @@
</section> </section>
</div> </div>
<!-- 底栏:当前仓(一级)→ 头像/消息/打印/收起(二级) --> <!-- 底栏:头像/消息/打印 → 当前仓+收起 -->
<div class="customer-side-rail__dock"> <div class="customer-side-rail__dock">
<button
type="button"
class="customer-side-rail__warehouse-chip"
:class="{ 'is-compact': compactLayout }"
:title="warehouseDockTitle"
:aria-label="warehouseDockTitle"
@click="openWarehouseAddressPeek"
>
<icon-home class="customer-side-rail__warehouse-chip-icon" />
<span v-if="!compactLayout" class="customer-side-rail__warehouse-chip-body">
<span class="customer-side-rail__warehouse-chip-label">
{{ t('nav.warehousePeek.shipLabel') }}
</span>
<span class="customer-side-rail__warehouse-chip-name">{{ warehouseDockName }}</span>
</span>
</button>
<div <div
class="customer-side-rail__toolbar" class="customer-side-rail__toolbar"
:class="{ 'is-account-active': isAccountRouteActive || isBalanceRouteActive }" :class="{ 'is-account-active': isAccountRouteActive || isBalanceRouteActive }"
@ -162,6 +145,22 @@
</a-doption> </a-doption>
</template> </template>
</a-dropdown> </a-dropdown>
</div>
<div class="customer-side-rail__warehouse-row">
<button
type="button"
class="customer-side-rail__warehouse-chip"
:class="{ 'is-compact': compactLayout }"
:title="warehouseDockTitle"
:aria-label="warehouseDockTitle"
@click="openWarehouseAddressPeek"
>
<icon-home class="customer-side-rail__warehouse-chip-icon" />
<span v-if="!compactLayout" class="customer-side-rail__warehouse-chip-body">
<span class="customer-side-rail__warehouse-chip-name">{{ warehouseDockName }}</span>
</span>
</button>
<button <button
type="button" type="button"
class="customer-side-rail__toggle" class="customer-side-rail__toggle"
@ -646,9 +645,9 @@ onUnmounted(() => {
} }
&__message-slot { &__message-slot {
flex: 0 0 auto;
min-width: 0; min-width: 0;
display: flex; display: flex;
align-items: center;
justify-content: center; justify-content: center;
:deep(.message-dropdown-trigger) { :deep(.message-dropdown-trigger) {
@ -789,55 +788,40 @@ onUnmounted(() => {
min-height: var(--csr-item-h); min-height: var(--csr-item-h);
padding: 0 12px 0 14px; padding: 0 12px 0 14px;
border: none; border: none;
border-radius: var(--csr-radius); border-radius: 10px;
background: transparent; background: transparent;
color: var(--color-text-2); color: var(--color-text-2);
cursor: pointer; cursor: pointer;
text-align: left; text-align: left;
box-shadow: inset 0 0 0 0 transparent; box-shadow: none;
transition: transition:
background-color 0.14s ease, background-color 0.16s ease,
color 0.14s ease, color 0.16s ease;
box-shadow 0.14s ease;
&::before {
content: '';
position: absolute;
left: 0;
top: 50%;
width: 3px;
height: 0;
border-radius: 0 3px 3px 0;
background: var(--app-primary-color, rgb(var(--primary-6)));
transform: translateY(-50%);
opacity: 0;
transition:
height 0.16s var(--csr-ease),
opacity 0.16s ease;
}
&:hover { &:hover {
color: var(--color-text-1); color: var(--color-text-1);
background: rgba(255, 255, 255, 0.72); background: rgba(15, 23, 42, 0.04);
} }
/* 选中:实心主色胶囊(无描边框),白字 + 图标浅底 */
&.active { &.active {
color: var(--app-primary-color, rgb(var(--primary-6))); color: #fff;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 12%, #fff); background: var(--app-primary-color, #054f74);
font-weight: 600; font-weight: 600;
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-primary-color, #1d7281) 18%, transparent); box-shadow: none;
&::before {
height: 22px;
opacity: 1;
}
.customer-side-rail__icon { .customer-side-rail__icon {
color: var(--app-primary-color, rgb(var(--primary-6))); color: #fff;
background: rgba(255, 255, 255, 0.16);
} }
.customer-side-rail__text { .customer-side-rail__text {
color: var(--app-primary-color, rgb(var(--primary-6))); color: #fff;
}
&:hover {
color: #fff;
background: color-mix(in srgb, var(--app-primary-color, #054f74) 88%, #000);
} }
} }
} }
@ -846,16 +830,21 @@ onUnmounted(() => {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 22px; width: 28px;
height: 22px; height: 28px;
flex-shrink: 0; flex-shrink: 0;
font-size: 17px; border-radius: 8px;
font-size: 16px;
color: var(--color-text-3); color: var(--color-text-3);
transition: color 0.14s ease; background: transparent;
transition:
color 0.16s ease,
background-color 0.16s ease;
} }
&__item:hover &__icon { &__item:hover:not(.active) &__icon {
color: var(--color-text-1); color: var(--color-text-1);
background: rgba(15, 23, 42, 0.04);
} }
&__text { &__text {
@ -872,37 +861,43 @@ onUnmounted(() => {
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 6px;
padding: 10px var(--csr-pad-x) 10px; padding: 8px var(--csr-pad-x) 12px;
border-top: 1px solid var(--color-border-2, rgba(0, 0, 0, 0.06)); border-top: 1px solid var(--color-border-2, rgba(0, 0, 0, 0.06));
} }
/* 一级:当前仓 Workspace Switcher */ /* 一级:当前仓 + 收起 同行 */
&__warehouse-row {
display: flex;
align-items: center;
gap: 2px;
min-width: 0;
width: 100%;
}
&__warehouse-chip { &__warehouse-chip {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 8px; gap: 8px;
width: 100%; flex: 1;
min-width: 0; min-width: 0;
height: 40px; height: 40px;
padding: 0 10px; padding: 0 10px;
border: 1px solid color-mix(in srgb, var(--app-primary-color, #1d7281) 16%, transparent); border: none;
border-radius: 8px; border-radius: 8px;
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 6%, #fff); background: transparent;
box-shadow: none;
color: var(--color-text-1); color: var(--color-text-1);
cursor: pointer; cursor: pointer;
text-align: left; text-align: left;
transition: transition: background-color 0.14s ease;
background-color 0.14s ease,
border-color 0.14s ease,
box-shadow 0.14s ease;
&:hover { &:hover {
background: color-mix(in srgb, var(--app-primary-color, #1d7281) 10%, #fff); background: color-mix(in srgb, var(--app-primary-color, #1d7281) 8%, transparent);
border-color: color-mix(in srgb, var(--app-primary-color, #1d7281) 28%, transparent);
} }
&.is-compact { &.is-compact {
flex: 0 0 auto;
width: 40px; width: 40px;
height: 40px; height: 40px;
padding: 0; padding: 0;
@ -914,7 +909,7 @@ onUnmounted(() => {
&__warehouse-chip-icon { &__warehouse-chip-icon {
flex-shrink: 0; flex-shrink: 0;
font-size: 16px; font-size: 16px;
color: var(--app-primary-color, #1d7281); color: var(--color-text-3);
} }
&__warehouse-chip-body { &__warehouse-chip-body {
@ -925,37 +920,39 @@ onUnmounted(() => {
gap: 1px; gap: 1px;
} }
&__warehouse-chip-label {
font-size: 11px;
line-height: 1.2;
color: var(--color-text-3);
font-weight: 500;
}
&__warehouse-chip-name { &__warehouse-chip-name {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
font-size: 13px; font-size: 13px;
font-weight: 650; font-weight: 400;
line-height: 1.25; line-height: 1.25;
color: var(--color-text-1); color: var(--color-text-2);
} }
/* 底栏:头像 + 消息 + 打印 + 收起 */ /* 底栏:头像 + 消息 + 打印,三等分铺满 */
&__toolbar { &__toolbar {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: 2px; gap: 4px;
min-width: 0; min-width: 0;
padding: 2px; width: 100%;
padding: 2px 4px;
border-radius: 8px; border-radius: 8px;
background: transparent; background: transparent;
transition: transition:
background-color 0.14s ease, background-color 0.14s ease,
box-shadow 0.14s ease; box-shadow 0.14s ease;
> * {
flex: 1 1 0;
min-width: 0;
display: flex;
align-items: center;
justify-content: center;
}
&.is-account-active { &.is-account-active {
:deep(.user-dropdown-trigger) { :deep(.user-dropdown-trigger) {
color: var(--app-primary-color, rgb(var(--primary-6))); color: var(--app-primary-color, rgb(var(--primary-6)));
@ -1014,9 +1011,9 @@ onUnmounted(() => {
} }
&__user { &__user {
flex: 0 0 auto;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center;
:deep(.user-dropdown-trigger), :deep(.user-dropdown-trigger),
:deep(.user-dropdown-trigger.is-compact) { :deep(.user-dropdown-trigger.is-compact) {
@ -1137,6 +1134,13 @@ onUnmounted(() => {
padding: 8px 0 10px; padding: 8px 0 10px;
} }
.customer-side-rail__warehouse-row {
width: 40px;
flex-direction: column;
align-items: center;
gap: 2px;
}
.customer-side-rail__warehouse-chip { .customer-side-rail__warehouse-chip {
width: 40px; width: 40px;
height: 40px; height: 40px;

View File

@ -383,6 +383,8 @@
} }
onMounted(() => { onMounted(() => {
// 客户门户无 TopNav 时也要翻一次标题(DEFAULT_ROUTE 初始存的是 locale key)
tabBarStore.refreshTagTitles();
initSortable(); initSortable();
window.addEventListener('resize', onWindowResize, { passive: true }); window.addEventListener('resize', onWindowResize, { passive: true });
nextTick(() => { nextTick(() => {

View File

@ -2,21 +2,21 @@
<div id="top-nav" class="top-nav" :class="{ tabNavEnable: tabNavEnable }"> <div id="top-nav" class="top-nav" :class="{ tabNavEnable: tabNavEnable }">
<div class="top-nav-header"> <div class="top-nav-header">
<!-- 左对齐菜单坞(与下方页签左缘对齐) --> <!-- 左对齐菜单坞(与下方页签左缘对齐) -->
<a
v-if="navLogoSrc"
class="top-nav-logo"
href="/"
:title="brandCopy.navFullName"
@click="goOfficialSite"
>
<img :src="navLogoSrc" :alt="brandCopy.navName" />
</a>
<div <div
class="top-nav-menu" class="top-nav-menu"
ref="topMenuCon" ref="topMenuCon"
@wheel="onMenuWheel" @wheel="onMenuWheel"
@pointerleave="onMenuBarPointerLeave" @pointerleave="onMenuBarPointerLeave"
> >
<a
v-if="navLogoSrc"
class="top-nav-logo"
href="/"
:title="brandCopy.navFullName"
@click="goOfficialSite"
>
<img :src="navLogoSrc" :alt="brandCopy.navName" />
</a>
<div <div
v-show="indicatorVisible" v-show="indicatorVisible"
class="top-nav-menu-indicator" class="top-nav-menu-indicator"
@ -724,14 +724,13 @@ async function recalcMenuOverflow() {
if (!wrap) return; if (!wrap) return;
const itemMargin = 6; // margin: 0 3px(程序坞内) const itemMargin = 6; // margin: 0 3px(程序坞内)
const logoEl = wrap.querySelector('.top-nav-logo') as HTMLElement | null; // Logo 已拆到菜单坞外,不再占用坞内预算
const logoReserve = logoEl ? logoEl.offsetWidth + 8 : 0;
const widths = menus.map((item) => { const widths = menus.map((item) => {
const el = menuItemEls.get(menuKey(item)); const el = menuItemEls.get(menuKey(item));
return (el?.offsetWidth || 56) + itemMargin; return (el?.offsetWidth || 56) + itemMargin;
}); });
const totalNeeded = widths.reduce((sum, w) => sum + w, 0); const totalNeeded = widths.reduce((sum, w) => sum + w, 0);
const menuBudget = Math.max(80, wrap.clientWidth - logoReserve); const menuBudget = Math.max(80, wrap.clientWidth);
if (totalNeeded <= menuBudget + 1) { if (totalNeeded <= menuBudget + 1) {
fittedTopMenus.value = [...menus]; fittedTopMenus.value = [...menus];
@ -1407,9 +1406,56 @@ onUnmounted(() => {
background-color: transparent !important; background-color: transparent !important;
color: var(--color-text-1, #1d2129); color: var(--color-text-1, #1d2129);
align-items: center; align-items: center;
gap: 12px; gap: 8px;
/* 左对齐白坞:宽随内容,与页签左缘同起点 */ /* 独立白底圆标:大图标 + 克制高级感(细描边 / 轻环境光) */
.top-nav-logo {
position: relative;
z-index: 2;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 44px;
height: 44px;
margin: 0;
border-radius: 50%;
background: #fff;
border: 1px solid rgba(15, 23, 42, 0.08);
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
color: inherit;
text-decoration: none;
cursor: pointer;
overflow: hidden;
transition:
border-color 0.18s ease,
box-shadow 0.18s ease;
&:hover {
border-color: rgba(15, 23, 42, 0.12);
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
&:active {
border-color: rgba(15, 23, 42, 0.1);
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
img {
height: 30px;
width: 30px;
box-sizing: border-box;
object-fit: contain;
display: block;
background: transparent;
border: none;
border-radius: 0;
padding: 0;
pointer-events: none;
}
}
/* 左对齐菜单坞:主题色底 + 白字,跟随 --app-primary-color */
.top-nav-menu { .top-nav-menu {
position: relative; position: relative;
z-index: 1; z-index: 1;
@ -1418,7 +1464,7 @@ onUnmounted(() => {
width: max-content; width: max-content;
max-width: calc(100% - 280px); max-width: calc(100% - 280px);
height: 44px; height: 44px;
margin-left: 4px; margin-left: 0;
padding: 0 12px 0 8px; padding: 0 12px 0 8px;
overflow: hidden; overflow: hidden;
overflow-x: auto; overflow-x: auto;
@ -1426,38 +1472,12 @@ onUnmounted(() => {
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
scroll-behavior: smooth; scroll-behavior: smooth;
background: rgba(255, 255, 255, 0.94); background: var(--app-primary-color, #054f74);
border-radius: 22px; border-radius: 22px;
border: 1px solid rgba(15, 23, 42, 0.06); border: 1px solid color-mix(in srgb, #fff 14%, transparent);
box-shadow: none; box-shadow: none;
color: #fff;
.top-nav-logo { transition: background-color 0.2s ease, border-color 0.2s ease;
position: relative;
z-index: 2;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 32px;
height: 32px;
margin-right: 6px;
border-radius: 10px;
color: inherit;
text-decoration: none;
cursor: pointer;
img {
height: 28px;
width: 28px;
box-sizing: border-box;
object-fit: contain;
display: block;
background: transparent;
border: none;
border-radius: 0;
padding: 0;
}
}
.top-nav-menu-indicator { .top-nav-menu-indicator {
position: absolute; position: absolute;
@ -1467,18 +1487,12 @@ onUnmounted(() => {
height: 30px; height: 30px;
margin-top: -15px; margin-top: -15px;
border-radius: 15px; border-radius: 15px;
/* 选中态克制:约 9% 主色,偏状态感而非按钮 */ background-color: color-mix(in srgb, #fff 16%, transparent);
background-color: color-mix(
in srgb,
var(--app-primary-color, #054f74) 9%,
#fff
);
pointer-events: none; pointer-events: none;
will-change: transform, width; will-change: transform, width;
opacity: 1; opacity: 1;
&.is-ready { &.is-ready {
/* 稳重缓动,少弹跳 */
transition: transition:
transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
width 0.22s cubic-bezier(0.4, 0, 0.2, 1), width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
@ -1488,7 +1502,7 @@ onUnmounted(() => {
&.is-hover { &.is-hover {
opacity: 1; opacity: 1;
background-color: rgba(0, 0, 0, 0.035); background-color: color-mix(in srgb, #fff 10%, transparent);
} }
} }
@ -1502,8 +1516,9 @@ onUnmounted(() => {
padding: 0 14px; padding: 0 14px;
line-height: 1; line-height: 1;
text-decoration: none; text-decoration: none;
color: var(--color-text-2, #4e5969); color: color-mix(in srgb, #fff 78%, transparent);
font-size: 13px; font-size: 13px;
font-weight: 600;
border-radius: 15px; border-radius: 15px;
white-space: nowrap; white-space: nowrap;
margin: 0 3px; margin: 0 3px;
@ -1512,7 +1527,7 @@ onUnmounted(() => {
transition: color 0.16s ease; transition: color 0.16s ease;
&:hover { &:hover {
color: var(--color-text-1, #1d2129); color: #fff;
} }
&:active { &:active {
@ -1521,8 +1536,8 @@ onUnmounted(() => {
&.active, &.active,
&.is-open { &.is-open {
color: var(--app-primary-color, #054f74); color: #fff;
font-weight: 600; font-weight: 700;
background-color: transparent; background-color: transparent;
} }
} }

View File

@ -3,7 +3,7 @@
<!-- 运营端顶栏;客户/代理门户无顶栏(能力沉底侧栏) --> <!-- 运营端顶栏;客户/代理门户无顶栏(能力沉底侧栏) -->
<TopNav v-if="!isPortalShell" /> <TopNav v-if="!isPortalShell" />
<!-- 客户/代理门户:全高侧栏 + 主区(无多页签,当前页由侧栏高亮) --> <!-- 客户/代理门户:全高侧栏 + 主区(页签与运营端同一套 TabBar) -->
<a-layout <a-layout
v-if="isPortalShell" v-if="isPortalShell"
class="layout-content layout-content--customer" class="layout-content layout-content--customer"
@ -11,6 +11,9 @@
<CustomerSideRail v-if="isCustomerShell" /> <CustomerSideRail v-if="isCustomerShell" />
<AgentSideRail v-else-if="isAgentShell" /> <AgentSideRail v-else-if="isAgentShell" />
<a-layout class="layout-main-wrap"> <a-layout class="layout-main-wrap">
<div v-if="portalTabBarEnable" class="portal-tab-nav">
<TabBar />
</div>
<a-layout-content class="layout-main"> <a-layout-content class="layout-main">
<PageLayout /> <PageLayout />
</a-layout-content> </a-layout-content>
@ -40,6 +43,7 @@
import TopNav from '@/components/top-nav/index.vue'; import TopNav from '@/components/top-nav/index.vue';
import CustomerSideRail from '@/components/customer-side-rail/index.vue'; import CustomerSideRail from '@/components/customer-side-rail/index.vue';
import AgentSideRail from '@/components/agent-side-rail/index.vue'; import AgentSideRail from '@/components/agent-side-rail/index.vue';
import TabBar from '@/components/tab-bar/index.vue';
import usePermission from '@/hooks/permission'; import usePermission from '@/hooks/permission';
import useResponsive from '@/hooks/responsive'; import useResponsive from '@/hooks/responsive';
import PageLayout from './page-layout.vue'; import PageLayout from './page-layout.vue';
@ -75,6 +79,8 @@
() => rbacUserStore.isAgentPortal() && rbacUserStore.isLoggedIn, () => rbacUserStore.isAgentPortal() && rbacUserStore.isLoggedIn,
); );
const isPortalShell = computed(() => isCustomerShell.value || isAgentShell.value); const isPortalShell = computed(() => isCustomerShell.value || isAgentShell.value);
/** 与运营端同一开关:settings.tabBar */
const portalTabBarEnable = computed(() => !!appStore.tabBar);
// 仅运营端需要为 fixed 顶栏留白 // 仅运营端需要为 fixed 顶栏留白
const adminContentStyle = computed(() => { const adminContentStyle = computed(() => {
@ -123,6 +129,8 @@
/* 客户门户:无顶栏;侧栏与右侧内容卡片同 inset / 圆角 */ /* 客户门户:无顶栏;侧栏与右侧内容卡片同 inset / 圆角 */
.layout-content--customer { .layout-content--customer {
/* 与 customer-side-rail --csr-panel-inset / agent --asr-panel-inset 对齐 */
--portal-panel-inset: 16px;
flex-direction: row; flex-direction: row;
align-items: stretch; align-items: stretch;
min-height: 0; min-height: 0;
@ -133,11 +141,29 @@
flex: 1; flex: 1;
min-width: 0; min-width: 0;
min-height: 0; min-height: 0;
/* 顶/底与左侧菜单齐平,不顶到视口上沿 */
margin: var(--portal-panel-inset) var(--portal-panel-inset) var(--portal-panel-inset) 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
} }
/* 与运营端 top-nav-tabs 同高;左缩进对齐页面内容 */
.portal-tab-nav {
flex-shrink: 0;
height: 28px;
background: transparent;
:deep(.tab-bar) {
padding-left: 16px;
padding-right: 12px;
}
:deep(.tab-bar.is-overflow-left::before) {
left: 16px;
}
}
:deep(.arco-layout-content.layout-main), :deep(.arco-layout-content.layout-main),
.layout-main { .layout-main {
flex: 1; flex: 1;

View File

@ -17,17 +17,36 @@ import { TabBarState, TagProps } from './types';
/** keep-alive 同时缓存的页面上限(LRU),避免页签开太多越切越顿 */ /** keep-alive 同时缓存的页面上限(LRU),避免页签开太多越切越顿 */
export const MAX_KEEP_ALIVE_TABS = 10; export const MAX_KEEP_ALIVE_TABS = 10;
/** 标题若是 locale key(如 menu.home.workplace)则翻译;否则原样返回。 */
function translateTabTitle(title: string): string {
const raw = String(title || '').trim();
if (!raw) return raw;
// 已是可读文案(含中文)则不走 i18n,避免误伤
if (!raw.includes('.') && !/^[a-z][a-zA-Z0-9_-]*$/.test(raw)) {
return raw;
}
try {
const translated = String(i18n.global.t(raw));
if (translated && translated !== raw) {
return translated;
}
} catch {
// ignore
}
return raw;
}
function resolveRouteTabTitle(route: RouteLocationNormalized): string { function resolveRouteTabTitle(route: RouteLocationNormalized): string {
const rbacUserStore = useRbacUserStore(); const rbacUserStore = useRbacUserStore();
const { pathToTitle } = buildMenuTitleMaps(rbacUserStore.menus as MenuTreeDto[]); const { pathToTitle } = buildMenuTitleMaps(rbacUserStore.menus as MenuTreeDto[]);
const menuTitle = resolveMenuTitleByPath(route.path, pathToTitle); const menuTitle = resolveMenuTitleByPath(route.path, pathToTitle);
if (menuTitle) { if (menuTitle) {
return menuTitle; return translateTabTitle(menuTitle);
} }
const metaLocale = route.meta?.locale; const metaLocale = route.meta?.locale;
if (typeof metaLocale === 'string' && metaLocale.trim()) { if (typeof metaLocale === 'string' && metaLocale.trim()) {
const translated = String(i18n.global.t(metaLocale.trim())); const translated = translateTabTitle(metaLocale.trim());
if (translated && translated !== metaLocale.trim()) { if (translated && translated !== metaLocale.trim()) {
return translated; return translated;
} }
@ -35,15 +54,15 @@ function resolveRouteTabTitle(route: RouteLocationNormalized): string {
const byPath = translateMenuTitleByPath(route.path); const byPath = translateMenuTitleByPath(route.path);
if (byPath) { if (byPath) {
return byPath; return translateTabTitle(byPath);
} }
const metaTitle = route.meta?.title; const metaTitle = route.meta?.title;
if (typeof metaTitle === 'string' && metaTitle.trim()) { if (typeof metaTitle === 'string' && metaTitle.trim()) {
return metaTitle.trim(); return translateTabTitle(metaTitle.trim());
} }
return String(route.name || route.path || ''); return translateTabTitle(String(route.name || route.path || ''));
} }
const formatTag = (route: RouteLocationNormalized): TagProps => { const formatTag = (route: RouteLocationNormalized): TagProps => {
@ -242,13 +261,14 @@ const useTabBarStore = defineStore('tabBar', {
this.tagList = this.tagList.map((tag) => { this.tagList = this.tagList.map((tag) => {
const fromTree = resolveMenuTitleFromTree(menus, tag.fullPath, ''); const fromTree = resolveMenuTitleFromTree(menus, tag.fullPath, '');
if (fromTree) { if (fromTree) {
return { ...tag, title: fromTree }; return { ...tag, title: translateTabTitle(fromTree) };
} }
const byPath = translateMenuTitleByPath(tag.fullPath); const byPath = translateMenuTitleByPath(tag.fullPath);
if (byPath) { if (byPath) {
return { ...tag, title: byPath }; return { ...tag, title: translateTabTitle(byPath) };
} }
return tag; // 兜底:DEFAULT_ROUTE 等仍存 locale key 时翻成当前语言
return { ...tag, title: translateTabTitle(tag.title) };
}); });
}, },
}, },

View File

@ -58,9 +58,12 @@ defineOptions({ name: 'CustomerWorkplace' })
--wp-well-shadow-deep: --wp-well-shadow-deep:
inset 0 0 0 1px rgba(15, 23, 42, 0.08), inset 0 0 0 1px rgba(15, 23, 42, 0.08),
inset 0 2px 6px rgba(15, 23, 42, 0.07); inset 0 2px 6px rgba(15, 23, 42, 0.07);
box-sizing: border-box;
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 100%; min-height: 0;
/* 与其它页 *-container 同一套页边距,避免外层 8 + 内层 16 叠出「卡片偏矮」 */
padding: var(--app-page-padding, 8px 16px 16px);
overflow: hidden; overflow: hidden;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -69,8 +72,8 @@ defineOptions({ name: 'CustomerWorkplace' })
.container { .container {
display: flex; display: flex;
flex: 1; flex: 1;
/* 与其它页面 *-container 一致:相对主区左右 16px,勿 94% 居中造成两侧偏大留白 */ /* 外边距已由 workplace-container 承担,这里只保留列间距 */
padding: 16px; padding: 0;
gap: 16px; gap: 16px;
overflow: hidden; overflow: hidden;
min-height: 0; min-height: 0;
@ -334,7 +337,7 @@ defineOptions({ name: 'CustomerWorkplace' })
@media (max-width: 1200px) { @media (max-width: 1200px) {
.container { .container {
flex-direction: column; flex-direction: column;
padding: 16px; padding: 0;
gap: 12px; gap: 12px;
width: 100%; width: 100%;
max-width: 100%; max-width: 100%;
@ -377,7 +380,7 @@ defineOptions({ name: 'CustomerWorkplace' })
} }
.container { .container {
padding: 12px; padding: 0;
gap: 12px; gap: 12px;
} }
} }

View File

@ -1923,10 +1923,28 @@
selectedRowCount.value = selectedOrderRows.value.length; selectedRowCount.value = selectedOrderRows.value.length;
}; };
/** 从路由 query.keyword 填入列表搜索框(下单成功「查看我的订单」等入口)。 */
function applyKeywordFromQuery(): boolean {
const raw = route.query.keyword;
const kw = String(Array.isArray(raw) ? raw[0] : raw || '').trim();
if (!kw) return false;
listKeyword.value = kw;
return true;
}
function clearKeywordQuery() {
if (route.query.keyword == null) return;
const nextQuery = { ...route.query } as Record<string, any>;
delete nextQuery.keyword;
void router.replace({ query: nextQuery });
}
onMounted(() => { onMounted(() => {
nextTick(async () => { nextTick(async () => {
applyKeywordFromQuery();
await Promise.all([loadOrderList(), loadTabCounts()]); await Promise.all([loadOrderList(), loadTabCounts()]);
await tryOpenOrderFromQuery(); await tryOpenOrderFromQuery();
clearKeywordQuery();
}); });
}); });
@ -1971,6 +1989,16 @@
void tryOpenOrderFromQuery(); void tryOpenOrderFromQuery();
}, },
); );
watch(
() => route.query.keyword,
(keyword) => {
if (!keyword) return;
if (!applyKeywordFromQuery()) return;
handleSearch();
clearKeywordQuery();
},
);
</script> </script>
<template> <template>

View File

@ -3868,13 +3868,21 @@
} else if (pickupErr) { } else if (pickupErr) {
content = `${content}\n揽收未创建成功:${pickupErr}(可到我的订单补建)`; content = `${content}\n揽收未创建成功:${pickupErr}(可到我的订单补建)`;
} }
const serviceNo = String(created?.serviceNo ?? created?.ServiceNo ?? '').trim();
const clientNo = String(
created?.clientNo ?? created?.ClientNo ?? singleForm.clientNo ?? '',
).trim();
const keyword = serviceNo || clientNo;
Modal.confirm({ Modal.confirm({
title: t('order.placeOrder.single.successTitle'), title: t('order.placeOrder.single.successTitle'),
content, content,
okText: t('order.placeOrder.single.successGoOrders'), okText: t('order.placeOrder.single.successGoOrders'),
cancelText: t('order.placeOrder.single.successStay'), cancelText: t('order.placeOrder.single.successStay'),
onOk: () => { onOk: () => {
router.push({ path: orderListPath.value }); router.push({
path: orderListPath.value,
query: keyword ? { keyword } : undefined,
});
}, },
}); });
} catch (e: any) { } catch (e: any) {

View File

@ -2177,11 +2177,29 @@
selectedRowCount.value = selectedOrderRows.value.length; selectedRowCount.value = selectedOrderRows.value.length;
}; };
/** 从路由 query.keyword 填入列表搜索框(下单成功「查看我的订单」等入口)。 */
function applyKeywordFromQuery(): boolean {
const raw = route.query.keyword;
const kw = String(Array.isArray(raw) ? raw[0] : raw || '').trim();
if (!kw) return false;
listKeyword.value = kw;
return true;
}
function clearKeywordQuery() {
if (route.query.keyword == null) return;
const nextQuery = { ...route.query } as Record<string, any>;
delete nextQuery.keyword;
void router.replace({ query: nextQuery });
}
onMounted(() => { onMounted(() => {
nextTick(async () => { nextTick(async () => {
// 列表与角标并行,避免串行多等一整轮接口 // 列表与角标并行,避免串行多等一整轮接口
applyKeywordFromQuery();
await Promise.all([loadOrderList(), loadTabCounts()]); await Promise.all([loadOrderList(), loadTabCounts()]);
await tryOpenOrderFromQuery(); await tryOpenOrderFromQuery();
clearKeywordQuery();
}); });
}); });
@ -2226,6 +2244,16 @@
void tryOpenOrderFromQuery(); void tryOpenOrderFromQuery();
}, },
); );
watch(
() => route.query.keyword,
(keyword) => {
if (!keyword) return;
if (!applyKeywordFromQuery()) return;
handleSearch();
clearKeywordQuery();
},
);
</script> </script>
<template> <template>