feat: 官网与助手共用 Nana 会话,完善下单与顶栏门户过渡 #20

Merged
zzh merged 1 commits from test into master 2026-11-10 10:47:16 +08:00
20 changed files with 896 additions and 521 deletions

2
src/components.d.ts vendored
View File

@ -47,6 +47,8 @@ declare module 'vue' {
NanaAssistant: typeof import('./components/NanaAssistant/index.vue')['default']
NanaAvatar: typeof import('./components/NanaAssistant/NanaAvatar.vue')['default']
NanaBatchJobsDrawer: typeof import('./components/NanaAssistant/NanaBatchJobsDrawer.vue')['default']
NanaChatDialog: typeof import('./components/NanaAssistant/NanaChatDialog.vue')['default']
NanaComposer: typeof import('./components/NanaAssistant/NanaComposer.vue')['default']
OrderPrintModal: typeof import('./components/PrintTemplate/OrderPrintModal.vue')['default']
PaginationPro: typeof import('./components/PaginationPro/index.vue')['default']
PrintOptionsForm: typeof import('./components/PrintTemplate/PrintOptionsForm.vue')['default']

View File

@ -1,6 +1,6 @@
<template>
<div
class="ai-advisor-shell ai-advisor-shell--page"
class="ai-advisor-shell ai-advisor-shell--page ai-advisor-shell--round-send"
:class="{ 'ai-history-open': historyOpen }"
>
<div class="ai-shell-bg" aria-hidden="true" />
@ -190,70 +190,38 @@
</div>
</section>
<div v-show="isChatting" class="ai-messages is-active" role="log" aria-live="polite">
<div
v-for="(msg, idx) in messages"
:key="idx"
:class="['ai-msg-row', msg.role === 'user' ? 'ai-msg-row--user' : 'ai-msg-row--assistant']"
>
<div class="ai-msg-avatar">
<NanaAvatar v-if="msg.role === 'assistant'" size="sm" :pulse="false" />
<template v-else>{{ youInitial }}</template>
</div>
<div class="ai-msg-bubble">{{ msg.content }}</div>
</div>
<div v-if="chatLoading" class="ai-msg-row ai-msg-row--assistant ai-msg-row--typing">
<div class="ai-msg-avatar"><NanaAvatar size="sm" :pulse="false" /></div>
<div class="ai-msg-bubble"><span /><span /><span /></div>
</div>
</div>
</div>
<div v-show="isChatting" class="ai-followup is-visible" role="toolbar">
<button
v-for="cap in mcpCapabilities"
:key="cap.id"
type="button"
class="ai-followup-chip"
:disabled="chatLoading"
@click="startMcpCapability(cap.id)"
<NanaChatDialog
v-show="isChatting"
:messages="messages"
:typing="chatLoading"
:active="isChatting"
>
{{ t(cap.titleKey) }}
</button>
<template #assistant-extra="{ isLatest }">
<div v-if="isLatest" class="ai-msg-followups" role="toolbar">
<button
v-for="cap in mcpCapabilities"
:key="cap.id"
type="button"
class="ai-followup-chip"
:disabled="chatLoading"
@click="startMcpCapability(cap.id)"
>
{{ t(cap.titleKey) }}
</button>
</div>
</template>
</NanaChatDialog>
</div>
<div class="ai-composer-wrap">
<div class="ai-composer">
<form class="ai-composer-form" @submit.prevent="sendMessage">
<textarea
ref="inputRef"
v-model="inputText"
class="ai-composer-input"
rows="1"
maxlength="2000"
:placeholder="composerPlaceholder"
:disabled="chatLoading"
@keydown.enter.exact.prevent="sendMessage"
@input="resizeInput"
/>
<button
type="submit"
class="ai-composer-send"
:class="{ 'is-empty': roundSend && !inputText.trim() }"
:aria-label="t('nanaAssistant.send')"
:disabled="roundSend ? chatLoading : !canSend"
>
<svg
v-if="roundSend"
class="ai-composer-send__mark"
viewBox="0 0 24 24"
aria-hidden="true"
>
<path d="M12 19V5M6.5 10.5 12 5l5.5 5.5" />
</svg>
<icon-send v-else />
</button>
</form>
<NanaComposer
ref="composerRef"
v-model="inputText"
:placeholder="composerPlaceholder"
:send-label="t('nanaAssistant.send')"
:busy="chatLoading"
@submit="sendMessage"
>
<template #footer>
<div class="ai-composer-footer">
<p class="ai-composer-hint">
{{ providerKey ? t('nanaAssistant.hintLive') : t('nanaAssistant.hint') }}
@ -263,8 +231,8 @@
{{ t('nanaAssistant.human') }}
</button>
</div>
</div>
</div>
</template>
</NanaComposer>
</div>
</div>
@ -328,7 +296,6 @@ import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { Message } from '@arco-design/web-vue';
import {
IconSend,
IconClockCircle,
IconCustomerService,
IconDelete,
@ -375,15 +342,14 @@ import { isMobileUserAgent, isWeChatBrowser } from '@/utils/device';
import { openWecomKf } from '@/utils/wecomKf';
import { resolveTextModelId } from '@/views/system/aiAssistant/providerCatalog';
import NanaAvatar from './NanaAvatar.vue';
import NanaChatDialog from './NanaChatDialog.vue';
import NanaComposer from './NanaComposer.vue';
import logoImg from '@/assets/logo2.png';
withDefaults(
defineProps<{
/** 发送钮用首页提问卡的圆钮:空态浅灰,有内容黑底上箭头 */
roundSend?: boolean;
}>(),
{ roundSend: false },
);
/** @deprecated 圆钮发送已默认开启,保留 prop 兼容旧调用方 */
defineProps<{
roundSend?: boolean;
}>();
type QuickTagDef = {
id: string;
@ -456,7 +422,7 @@ function mcpCardIcon(id: McpCapabilityId) {
const activeThreadId = ref<string | null>(null);
const messages = ref<ChatMessage[]>([]);
const mainScrollRef = ref<HTMLElement>();
const inputRef = ref<HTMLTextAreaElement>();
const composerRef = ref<InstanceType<typeof NanaComposer> | null>(null);
const advisorLoading = ref(false);
const advisorLoaded = ref(false);
@ -540,8 +506,6 @@ const canSend = computed(() => Boolean(inputText.value.trim() && !chatLoading.va
const composerPlaceholder = computed(() => '');
const youInitial = computed(() => t('nanaAssistant.you').charAt(0).toUpperCase());
const waybillDisplayNo = computed(() =>
waybillContext.value ? getWaybillDisplayNo(waybillContext.value) : '',
);
@ -747,21 +711,18 @@ function shouldSkipAutoFocus() {
function focusInput(options?: { force?: boolean }) {
if (!options?.force && shouldSkipAutoFocus()) return;
nextTick(() => {
inputRef.value?.focus({ preventScroll: true });
composerRef.value?.focus({ preventScroll: true });
});
}
function blurInput() {
inputRef.value?.blur();
composerRef.value?.blur();
const active = document.activeElement;
if (active instanceof HTMLElement) active.blur();
}
function resizeInput() {
const el = inputRef.value;
if (!el) return;
el.style.height = 'auto';
el.style.height = `${Math.min(el.scrollHeight, 120)}px`;
composerRef.value?.resize();
}
function ensureWelcomeMessage() {

View File

@ -0,0 +1,87 @@
<template>
<div
class="nana-chat-dialog ai-messages"
:class="{ 'is-active': active }"
role="log"
aria-live="polite"
>
<div
v-for="(msg, index) in normalized"
:key="index"
class="ai-msg-row"
:class="'ai-msg-row--' + msg.role"
>
<NanaAvatar
v-if="msg.role === 'assistant'"
size="sm"
:pulse="false"
class="ai-msg-nana"
/>
<div v-if="msg.role === 'assistant'" class="ai-msg-body">
<p v-if="msg.text" class="ai-msg-text">{{ msg.text }}</p>
<slot
name="assistant-extra"
:message="msg.raw"
:index="index"
:is-latest="isLatestAssistant(index)"
/>
</div>
<div v-else class="ai-msg-bubble">
<p v-if="msg.text" class="ai-msg-text">{{ msg.text }}</p>
</div>
</div>
<div v-if="typing" class="ai-msg-row ai-msg-row--assistant ai-msg-row--typing">
<NanaAvatar size="sm" pulse class="ai-msg-nana" />
<div class="ai-msg-body ai-msg-body--typing">
<span /><span /><span />
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import NanaAvatar from './NanaAvatar.vue';
export type NanaChatMessageInput = {
role: 'user' | 'assistant';
/** 官网会话字段 */
text?: string;
/** OMS 助手会话字段 */
content?: string;
[key: string]: unknown;
};
const props = withDefaults(
defineProps<{
messages: NanaChatMessageInput[];
typing?: boolean;
/** 是否展示会话流(对应 .ai-messages.is-active) */
active?: boolean;
}>(),
{
typing: false,
active: true,
},
);
const normalized = computed(() =>
props.messages.map((msg) => ({
role: msg.role,
text: String(msg.text ?? msg.content ?? '').trim(),
raw: msg,
})),
);
function isLatestAssistant(index: number) {
if (props.typing) return false;
const list = normalized.value;
if (!list[index] || list[index].role !== 'assistant') return false;
for (let i = list.length - 1; i >= 0; i -= 1) {
if (list[i].role === 'assistant') return i === index;
}
return false;
}
</script>
<style src="./nana-chat.css"></style>

View File

@ -1,6 +1,12 @@
<template>
<div class="ai-composer-wrap" :class="{ 'has-new-chat-tip': showHint }">
<div class="ai-new-chat-tip" :hidden="!showHint" role="status" aria-live="polite">
<div
class="ai-new-chat-tip"
:class="{ 'is-visible': showHint }"
:hidden="!showHint"
role="status"
aria-live="polite"
>
<span class="ai-new-chat-tip__text">{{ hint }}</span>
</div>
<div class="ai-composer">
@ -17,12 +23,19 @@
@focus="onFocus"
@keydown="onKeydown"
></textarea>
<button type="submit" class="ai-composer-send" :class="{ 'is-empty': !modelValue.trim() }" :disabled="busy" :aria-label="sendLabel">
<button
type="submit"
class="ai-composer-send"
:class="{ 'is-empty': !modelValue.trim() }"
:disabled="busy"
:aria-label="sendLabel"
>
<svg class="ai-composer-send__mark" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 19V5M6.5 10.5 12 5l5.5 5.5" />
</svg>
</button>
</form>
<slot name="footer" />
</div>
</div>
</template>
@ -30,14 +43,21 @@
<script lang="ts" setup>
import { ref } from 'vue';
const props = defineProps<{
modelValue: string;
placeholder: string;
sendLabel: string;
busy: boolean;
hint?: string;
showHint?: boolean;
}>();
const props = withDefaults(
defineProps<{
modelValue: string;
placeholder: string;
sendLabel: string;
busy?: boolean;
hint?: string;
showHint?: boolean;
}>(),
{
busy: false,
hint: '',
showHint: false,
},
);
const emit = defineEmits<{
'update:modelValue': [value: string];
@ -50,7 +70,7 @@
const el = inputRef.value;
if (!el) return;
el.style.height = 'auto';
el.style.height = Math.min(el.scrollHeight, 160) + 'px';
el.style.height = `${Math.min(el.scrollHeight, 160)}px`;
}
function onInput(event: Event) {
@ -62,7 +82,6 @@
function onFocus() {
const el = inputRef.value;
if (!el) return;
// iOS 键盘顶起后,把输入框滚进可视区
window.setTimeout(() => {
el.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
}, 80);
@ -81,8 +100,12 @@
}
defineExpose({
focus() {
inputRef.value?.focus();
focus(options?: FocusOptions) {
inputRef.value?.focus(options);
},
blur() {
inputRef.value?.blur();
},
resize,
});
</script>

View File

@ -924,108 +924,9 @@
display: flex;
}
.ai-msg-row {
display: flex;
gap: 10px;
align-items: flex-end;
max-width: 100%;
animation: ai-msg-in 0.3s ease;
}
/* 会话气泡/阅读流由 NanaChatDialog + nana-chat.css 统一提供 */
@keyframes ai-msg-in {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.ai-msg-row--user {
flex-direction: row-reverse;
align-self: flex-end;
}
.ai-msg-row--assistant {
align-self: flex-start;
}
.ai-msg-avatar {
flex-shrink: 0;
width: 32px;
height: 32px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.9rem;
}
.ai-msg-row--assistant .ai-msg-avatar {
width: 32px;
height: 32px;
padding: 0;
background: transparent;
overflow: visible;
}
.ai-msg-row--user .ai-msg-avatar {
background: rgba(27, 42, 107, 0.08);
color: var(--kc-primary, #1b2a6b);
font-size: 0.75rem;
font-weight: 700;
}
.ai-msg-bubble {
max-width: min(680px, 88%);
padding: 12px 16px;
border-radius: 18px;
font-size: 0.94rem;
line-height: 1.6;
white-space: pre-wrap;
word-break: break-word;
}
.ai-msg-row--user .ai-msg-bubble {
background: var(--kc-primary, #1b2a6b);
color: #fff;
border-bottom-right-radius: 6px;
}
.ai-msg-row--assistant .ai-msg-bubble {
background: var(--app-card-bg);
color: var(--color-text-1);
border: 1px solid rgba(27, 42, 107, 0.08);
box-shadow: 0 2px 8px rgba(27, 42, 107, 0.04);
border-bottom-left-radius: 6px;
}
.ai-msg-row--typing .ai-msg-bubble {
display: flex;
gap: 5px;
align-items: center;
padding: 14px 18px;
}
.ai-msg-row--typing span {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--kc-secondary, #6a75b8);
animation: ai-typing 1.2s ease-in-out infinite;
}
.ai-msg-row--typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-msg-row--typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-typing {
0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
40% { opacity: 1; transform: scale(1); }
}
/* Compact chips after chat starts */
/* Compact chips(跟进条仍可在壳层单独使用) */
.ai-followup {
flex-shrink: 0;
display: none;
@ -1151,6 +1052,68 @@
filter: none;
}
/* 与官网欢迎提问卡一致:32px 圆钮,空态浅灰 / 有内容黑底上箭头 */
.ai-advisor-shell--round-send .ai-composer-send {
width: 32px;
height: 32px;
border-radius: 999px;
background: #0d0d0d;
color: #fff;
box-shadow: none;
font-size: inherit;
opacity: 1;
transform: none;
filter: none;
transition: background 0.15s ease;
}
.ai-advisor-shell--round-send .ai-composer-send__mark,
.ai-advisor-shell--round-send .ai-composer-send svg {
display: block;
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2.25;
stroke-linecap: round;
stroke-linejoin: round;
color: inherit;
}
.ai-advisor-shell--round-send .ai-composer-send.is-empty,
.ai-advisor-shell--round-send .ai-composer-send.is-empty:hover {
background: #ececec;
color: #9a9a9a;
cursor: default;
transform: none;
filter: none;
}
.ai-advisor-shell--round-send .ai-composer-send:hover:not(:disabled):not(.is-empty) {
background: #2f2f2f;
transform: none;
filter: none;
}
.ai-advisor-shell--round-send .ai-composer-send:focus-visible {
outline: 2px solid #0d0d0d;
outline-offset: 2px;
}
.ai-advisor-shell--round-send .ai-composer-send:disabled:not(.is-empty) {
background: #0d0d0d;
color: #fff;
opacity: 0.45;
cursor: not-allowed;
transform: none;
filter: none;
}
.ai-advisor-shell--round-send .ai-composer-send:not(:disabled):not(.is-empty):active {
background: #2f2f2f;
filter: none;
}
.ai-composer-footer {
display: flex;
align-items: center;

View File

@ -0,0 +1,157 @@
/* Nana 公共会话流:与 FAB 同源头像 + 阅读流排版 */
.nana-chat-dialog.ai-messages {
display: none;
flex-direction: column;
gap: 18px;
width: 100%;
max-width: min(720px, 100%);
margin-inline: auto;
padding: 8px 0 16px;
}
.nana-chat-dialog.ai-messages.is-active {
display: flex;
}
.nana-chat-dialog .ai-msg-row {
display: flex;
gap: 12px;
align-items: flex-start;
max-width: 100%;
animation: nana-chat-msg-in 0.3s ease;
}
@keyframes nana-chat-msg-in {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.nana-chat-dialog .ai-msg-row--user {
justify-content: flex-end;
align-self: stretch;
}
.nana-chat-dialog .ai-msg-row--assistant {
align-self: stretch;
width: 100%;
}
.nana-chat-dialog .ai-msg-nana.nana-fab-wrap,
.nana-chat-dialog .ai-msg-row--assistant .nana-fab-wrap {
position: relative;
display: block;
flex-shrink: 0;
width: 36px;
height: 36px;
margin-top: 2px;
}
.nana-chat-dialog .ai-msg-nana .nana-fab__img,
.nana-chat-dialog .ai-msg-row--assistant .nana-fab__img {
width: 100%;
height: 100%;
object-fit: contain;
filter: drop-shadow(0 3px 8px rgba(45, 140, 140, 0.28));
pointer-events: none;
}
.nana-chat-dialog .ai-msg-nana .nana-fab__pulse,
.nana-chat-dialog .ai-msg-row--assistant .nana-fab__pulse {
position: absolute;
inset: 1px;
border-radius: 50%;
border: 1.5px solid var(--app-primary-color, #2d8c8c);
opacity: 0;
animation: nana-pulse 2.4s ease-out infinite;
pointer-events: none;
}
.nana-chat-dialog .ai-msg-body {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 12px;
color: var(--ai-ink, var(--color-text-1));
}
.nana-chat-dialog .ai-msg-body--typing {
flex-direction: row;
align-items: center;
gap: 5px;
min-height: 36px;
padding: 8px 0;
}
.nana-chat-dialog .ai-msg-bubble {
max-width: min(520px, 86%);
padding: 11px 15px;
border-radius: 18px;
font-size: 0.94rem;
line-height: 1.55;
white-space: pre-wrap;
word-break: break-word;
}
.nana-chat-dialog .ai-msg-row--user .ai-msg-bubble {
background: var(--ai-action, var(--app-primary-color, #2d8c8c));
color: #fff;
border-bottom-right-radius: 6px;
box-shadow: 0 8px 20px color-mix(in srgb, var(--ai-action, var(--app-primary-color, #2d8c8c)) 18%, transparent);
}
.nana-chat-dialog .ai-msg-text {
margin: 0;
white-space: pre-wrap;
word-break: break-word;
}
.nana-chat-dialog .ai-msg-row--assistant .ai-msg-text {
font-size: 0.98rem;
line-height: 1.68;
letter-spacing: -0.01em;
color: var(--ai-ink, var(--color-text-1));
}
.nana-chat-dialog .ai-msg-followups {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding-top: 2px;
}
.nana-chat-dialog .ai-msg-row--typing .ai-msg-body--typing span {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--ai-muted, var(--color-text-3, #86909c));
animation: nana-chat-typing 1.2s ease-in-out infinite;
}
.nana-chat-dialog .ai-msg-row--typing .ai-msg-body--typing span:nth-child(2) {
animation-delay: 0.15s;
}
.nana-chat-dialog .ai-msg-row--typing .ai-msg-body--typing span:nth-child(3) {
animation-delay: 0.3s;
}
@keyframes nana-chat-typing {
0%,
80%,
100% {
opacity: 0.35;
transform: scale(0.85);
}
40% {
opacity: 1;
transform: scale(1);
}
}

View File

@ -259,7 +259,7 @@ const props = withDefaults(
/** 侧栏收起等场景只显示头像 */
compact?: boolean
/** 下拉相对触发器位置;侧栏 Cursor 风格默认 tl(向上) */
dropdownPosition?: 'br' | 'bl' | 'tr' | 'tl' | 'rt' | 'rb'
dropdownPosition?: 'br' | 'bl' | 'tr' | 'tl' | 'rt' | 'rb' | 'bottom' | 'top'
/** 客户侧栏:资产与账户菜单,收进用户下拉 */
accountMenus?: CustomerNavItem[]
/** 客户侧栏:语言收进用户菜单,不再单独占底栏 */
@ -303,7 +303,7 @@ const dropdownTrigger = computed(() => {
});
const dropdownPosition = computed(
() => props.dropdownPosition ?? (isSiderVariant.value ? 'tl' : 'br'),
() => props.dropdownPosition ?? (isSiderVariant.value ? 'tl' : 'bottom'),
);
const contentClass = computed(() =>
@ -641,27 +641,29 @@ const onMenuClick = async (event: { key: string }) => {
}
.user-menu-item {
display: flex;
display: inline-flex;
align-items: center;
min-width: 148px;
max-width: 220px;
width: max-content;
max-width: 100%;
box-sizing: border-box;
line-height: 1.35;
}
.user-menu-item__icon {
width: 18px;
width: 16px;
flex-shrink: 0;
display: inline-flex;
align-items: center;
justify-content: center;
margin-right: 10px;
font-size: 14px;
margin-right: 8px;
font-size: 13px;
color: var(--color-text-3);
}
.user-menu-item__label {
flex: 1;
flex: 0 1 auto;
white-space: nowrap;
font-size: 13px;
font-weight: 500;
text-align: left;
}
@ -679,12 +681,33 @@ const onMenuClick = async (event: { key: string }) => {
<style lang="less">
.user-account-dropdown {
padding: 6px !important;
border-radius: 8px !important;
width: max-content !important;
.arco-dropdown {
min-width: 156px;
min-width: 0;
width: max-content;
padding: 0;
}
.arco-dropdown-list {
padding: 0;
width: max-content;
}
.arco-dropdown-option {
min-height: 32px;
line-height: 1.35;
padding: 0;
width: 100%;
}
.arco-dropdown-option-content {
padding: 8px 12px;
display: flex;
padding: 7px 12px;
width: 100%;
box-sizing: border-box;
}
}

View File

@ -2,7 +2,7 @@
<div id="top-nav" class="top-nav" :class="{ tabNavEnable: tabNavEnable }">
<div class="top-nav-header">
<!-- Logo 区域:点击跳转官网首页 -->
<a class="top-nav-logo" href="/" :title="t('brand.fullName')" @click.prevent="goOfficialSite">
<a class="top-nav-logo" href="/" :title="t('brand.fullName')" @click="goOfficialSite">
<img :src="navLogo" :alt="t('brand.name')" />
<div class="top-nav-logo__brand">
<span class="top-nav-logo__name">{{ t('brand.name') }}</span>
@ -306,6 +306,7 @@ import { resolveCurrentCustomer } from '@/api/customer/resolve';
import { CUSTOMER_BALANCE_CHANGED_EVENT } from '@/api/customer/accountFlow';
import { resolvePortalDrawerPanel } from '@/views/user/portal-drawer/types';
import { PRINT_CONTROL_DOWNLOAD_URL } from '@/constants/printControl';
import { armPageFlip } from '@/utils/page-transition-flag';
const { t } = useI18n();
const route = useRoute();
@ -319,9 +320,21 @@ const topNavEnable = computed(() => true); // 启用顶部导航
const tabNavEnable = computed(() => appStore.tabBar);
const printConnectionState = useHiprintClientState();
/** 顶栏 Logo → 官网首页(开发环境即 http://localhost:5173/) */
function goOfficialSite() {
window.location.href = '/';
/** 顶栏 Logo → 官网首页(与登录门户切换同一套中心虹膜过渡) */
function goOfficialSite(e: MouseEvent) {
if (
e.button !== 0 ||
e.metaKey ||
e.ctrlKey ||
e.shiftKey ||
e.altKey
) {
return;
}
e.preventDefault();
if (route.name === 'siteRoot') return;
armPageFlip();
void router.push({ name: 'siteRoot' });
}
const menuItemEls = new Map<string, HTMLElement>();

View File

@ -50,18 +50,16 @@ const ORDER: AppRouteRecordRaw = {
meta: {
locale: 'menu.order.myOrders',
requiresAuth: true,
ignoreCache: true,
menuPermission: 'Order.MyOrders',
},
},
{
path: 'fulfillOrders',
name: 'FulfillOrders',
component: () => import('@/views/order/myOrders/index.vue'),
component: () => import('@/views/order/fulfillOrders/index.vue'),
meta: {
locale: 'menu.order.fulfillOrders',
requiresAuth: true,
ignoreCache: true,
listMode: 'fulfill',
permission: 'Order.FulfillOrders',
menuPermission: 'Order.FulfillOrders',
@ -77,7 +75,6 @@ const ORDER: AppRouteRecordRaw = {
adminPortalOnly: true,
permission: 'Order.WaybillManage',
menuPermission: 'Order.WaybillManage',
ignoreCache: true,
order: 3,
icon: 'icon-storage',
},

View File

@ -76,7 +76,15 @@ export function shouldPortalIris(to: PortalRouteLike, from: PortalRouteLike): bo
return true;
}
const isPcLogin = (name: string) => name === 'login' || name === 'adminLogin';
return isPcLogin(fromName) && isPcLogin(toName) && fromName !== toName;
// 客户/管理登录互切
if (isPcLogin(fromName) && isPcLogin(toName) && fromName !== toName) {
return true;
}
// 登录页回官网(与门户切换同一套中心虹膜)
if (isPcLogin(fromName) && toName === 'siteRoot') {
return true;
}
return false;
}
/** @deprecated 同 peekPageFlip */

View File

@ -1,6 +1,6 @@
<template>
<div class="assistant-page">
<AiAdvisorShell />
<AiAdvisorShell round-send />
</div>
</template>

View File

@ -1476,7 +1476,8 @@ import { pickResolvedAudit } from '@/utils/auditFields'
const PRICE_LIST_HOT_HEIGHT = 550
defineOptions({
name: 'ServiceChannel'
// 须与路由 name `ServiceChannels` 一致,否则 keep-alive include 对不上,切标签会整页重挂
name: 'ServiceChannels'
})
const { t } = useI18n()

View File

@ -337,65 +337,6 @@ function promptGuestRegister() {
border-radius: 16px;
}
:deep(.ai-composer-send) {
width: 32px;
height: 32px;
border: none;
border-radius: 999px;
background: #0d0d0d;
color: #fff;
box-shadow: none;
opacity: 1;
transform: none;
filter: none;
.ai-composer-send__mark,
svg {
display: block;
width: 18px;
height: 18px;
fill: none;
stroke: currentColor;
stroke-width: 2.25;
stroke-linecap: round;
stroke-linejoin: round;
}
&.is-empty,
&.is-empty:hover {
background: #ececec;
color: #9a9a9a;
cursor: default;
transform: none;
filter: none;
}
&:hover:not(:disabled):not(.is-empty) {
background: #2f2f2f;
transform: none;
filter: none;
}
&:focus-visible {
outline: 2px solid #0d0d0d;
outline-offset: 2px;
}
&:disabled:not(.is-empty) {
background: #0d0d0d;
color: #fff;
opacity: 0.45;
cursor: not-allowed;
transform: none;
filter: none;
}
&:not(:disabled):not(.is-empty):active {
background: #2f2f2f;
filter: none;
}
}
:deep(.ai-composer-footer) {
flex-direction: row;
align-items: center;

View File

@ -4,7 +4,7 @@
class="nova-login__header"
href="/"
:title="brandHint"
@click.prevent="goOfficialSite"
@click="goOfficialSite"
>
<LoginLockLogo />
<p class="nova-login__brand-hint">{{ brandHint }}</p>
@ -110,6 +110,7 @@ import { setToken } from '@/utils/auth';
import { getDefaultHomePathByType, resolveCustomerEntryPath } from '@/utils/login-portal';
import { enterSystemAfterLogin, applyRbacUserToUserStore } from '@/utils/enter-system';
import { ensureHeavyPlugins } from '@/plugins/heavy-plugins';
import { armPageFlip } from '@/utils/page-transition-flag';
import { LOGIN_CHARACTERS_KEY, type LoginCharactersApi } from '../../composables/useLoginCharacters';
import { LOGIN_EXIT_KEY, type LoginExitApi } from '../../composables/useLoginExit';
import LoginLockLogo from '../LoginLockLogo.vue';
@ -162,9 +163,20 @@ const brandHint = computed(() => {
return t('login.form.brandHint.admin');
});
/** Logo / 欢迎文案 → 官网首页 */
function goOfficialSite() {
window.location.href = '/';
/** Logo / 欢迎文案 → 官网首页(与门户切换同一套中心虹膜过渡) */
function goOfficialSite(e: MouseEvent) {
if (
e.button !== 0 ||
e.metaKey ||
e.ctrlKey ||
e.shiftKey ||
e.altKey
) {
return;
}
e.preventDefault();
armPageFlip();
void router.push({ name: 'siteRoot' });
}
const accountFieldLabel = computed(() =>
isAgentLogin.value ? t('login.field.account.agent') : t('login.field.account'),

View File

@ -0,0 +1,15 @@
<script setup lang="ts">
/**
* 代发订单与「我的订单」共用列表实现,但 keep-alive 按组件 name 缓存。
* 独立壳组件使用路由名 FulfillOrders,避免与 MyOrders 抢同一缓存实例。
*/
import MyOrders from '../myOrders/index.vue';
defineOptions({
name: 'FulfillOrders',
});
</script>
<template>
<MyOrders />
</template>

View File

@ -17,6 +17,7 @@
import SelectDeclarationSkuModal from './components/SelectDeclarationSkuModal.vue';
import FormLabelWithPreview from '@/views/channel/salesProducts/components/FormLabelWithPreview.vue';
import CustomerGuideDrawer from '@/views/order/priceCheck/components/CustomerGuideDrawer.vue';
import ShippingMethodTabSelect from '@/views/order/priceCheck/components/ShippingMethodTabSelect.vue';
import ExportCustoms9610GuideModal from './components/ExportCustoms9610GuideModal.vue';
import { Message, Modal } from '@arco-design/web-vue';
import { useI18n } from 'vue-i18n';
@ -42,6 +43,7 @@
postOrderUpload,
getOrderBatchJob,
postOrderReceiverParseAddress,
type PriceCheckShippingGroup,
} from '@/api/order';
import { listAiProviders, listAiSkills, type AiSkillItem } from '@/api/ai';
import {
@ -217,9 +219,6 @@
if (!p) return [];
return resolveProviderModelTags(p);
});
/** 申报表固定高度(框内滚动,不支持拖拽调高) */
const DECLARATION_PANEL_HEIGHT = 280;
interface TemplateRow {
id: number;
name: string;
@ -385,6 +384,7 @@
const singleReferenceLoading = ref(false);
const singleSalesProductOptions = ref<SingleProductOption[]>([]);
const singleShippingMethodGroups = ref<PriceCheckShippingGroup[]>([]);
const singleDomesticPickupProductOptions = ref<Array<{ value: string; label: string }>>([]);
const singleCargoAttributeOptions = ref<SingleSelectOption[]>([]);
const singleExportCustomsModeOptions = ref<SingleSelectOption[]>([]);
@ -404,6 +404,7 @@
const code = String(row?.productCode ?? row?.ProductCode ?? '').trim();
const name = String(row?.productName ?? row?.ProductName ?? '').trim();
const id = Number(row?.id ?? row?.Id ?? 0);
const productGroup = String(row?.productGroup ?? row?.ProductGroup ?? '').trim();
const routeSortRaw = row?.routeSort ?? row?.RouteSort;
const routeSortNum = Number(routeSortRaw);
const minTimelinessRaw = row?.minTimeliness ?? row?.MinTimeliness;
@ -418,6 +419,7 @@
code,
name,
productId: id > 0 ? id : undefined,
productGroup,
routeSort: Number.isFinite(routeSortNum) ? routeSortNum : 0,
minTimeliness:
minTimelinessNum != null && Number.isFinite(minTimelinessNum)
@ -427,6 +429,60 @@
};
}
function buildShippingMethodGroups(
products: Array<{
code: string;
name: string;
productId?: number;
productGroup: string;
routeSort: number;
minTimeliness: number | null;
}>,
groupDictRows: any[],
): PriceCheckShippingGroup[] {
const groupMeta = new Map<string, { name: string; sort: number }>();
for (const row of groupDictRows ?? []) {
const code = String(row?.dictCode ?? row?.DictCode ?? '').trim();
if (!code) continue;
const name = String(row?.dictName ?? row?.DictName ?? '').trim() || code;
const sortRaw = Number(row?.dictSort ?? row?.DictSort ?? row?.sort ?? row?.Sort ?? 0);
groupMeta.set(code, {
name,
sort: Number.isFinite(sortRaw) ? sortRaw : 0,
});
}
const grouped = new Map<string, PriceCheckShippingGroup & { sort: number }>();
for (const product of products) {
const groupCode = product.productGroup || '_ungrouped';
const meta = groupMeta.get(groupCode);
if (!grouped.has(groupCode)) {
grouped.set(groupCode, {
groupCode,
groupName: meta?.name || (groupCode === '_ungrouped' ? '其他' : groupCode),
products: [],
sort: meta?.sort ?? Number.MAX_SAFE_INTEGER,
});
}
const label = product.name ? `${product.name} ${product.code}` : product.code;
grouped.get(groupCode)!.products.push({
productId: product.productId ?? 0,
productCode: product.code,
productName: product.name || product.code,
label,
});
}
return Array.from(grouped.values())
.sort(
(a, b) =>
a.sort - b.sort ||
a.groupName.localeCompare(b.groupName, 'zh') ||
a.groupCode.localeCompare(b.groupCode),
)
.map(({ sort: _sort, ...group }) => group);
}
/** 与官网线路目录一致:RouteSort → 时效 → 名称 → Id */
function compareSalesProductRouteSort(
a: {
@ -1689,7 +1745,6 @@
router.push({ path: '/user/exportQualification' });
}
const singleFormScrollRef = ref<HTMLElement | null>(null);
const customerGuideDrawerRef = ref<InstanceType<typeof CustomerGuideDrawer> | null>(null);
const singlePanelRefs = reactive<Record<string, HTMLElement | null>>({
basic: null,
@ -2630,21 +2685,26 @@
.filter((code: string) => Boolean(code)),
);
singleSalesProductOptions.value = (productRes.items ?? [])
const placeOrderProducts = (productRes.items ?? [])
.filter((row: any) => {
const groupCode = String(row?.productGroup ?? row?.ProductGroup ?? '').trim();
return domesticPickupGroupCodes.size ? !domesticPickupGroupCodes.has(groupCode) : true;
})
.map(normalizeProductRow)
.filter((p) => p.code)
.sort(compareSalesProductRouteSort)
.map((p) => ({
value: p.code,
label: p.name ? `${p.name} ${p.code}` : p.code,
productId: p.productId,
productName: p.name || p.code,
additionalServices: p.additionalServices ?? [],
}));
.sort(compareSalesProductRouteSort);
singleSalesProductOptions.value = placeOrderProducts.map((p) => ({
value: p.code,
label: p.name ? `${p.name} ${p.code}` : p.code,
productId: p.productId,
productName: p.name || p.code,
additionalServices: p.additionalServices ?? [],
}));
singleShippingMethodGroups.value = buildShippingMethodGroups(
placeOrderProducts,
salesProductGroupDictRows ?? [],
);
singleDomesticPickupProductOptions.value = (productRes.items ?? [])
.filter((row: any) => {
@ -2730,6 +2790,7 @@
} catch (e: any) {
Message.error(e?.message || '加载下拉选项失败');
singleSalesProductOptions.value = [];
singleShippingMethodGroups.value = [];
singleDomesticPickupProductOptions.value = [];
singleCargoAttributeOptions.value = [];
singleExportCustomsModeOptions.value = [];
@ -3445,21 +3506,25 @@
Message.success('Mock 订单已填入');
}
function pulsePanel(panelEl: HTMLElement) {
panelEl.classList.remove('is-focus-pulse');
void panelEl.offsetWidth;
panelEl.classList.add('is-focus-pulse');
window.setTimeout(() => panelEl.classList.remove('is-focus-pulse'), 1200);
}
function scrollSectionIntoView(section: string) {
const scrollEl = singleFormScrollRef.value;
const panelEl = singlePanelRefs[section];
if (!scrollEl || !panelEl) return;
if (!panelEl) return;
const nextTop =
panelEl.getBoundingClientRect().top -
scrollEl.getBoundingClientRect().top +
scrollEl.scrollTop -
8;
// 申报区已停靠;基本/收件各自在卡片内滚动,点步骤时滚到顶并轻提示
if (section === 'declaration') {
pulsePanel(panelEl);
return;
}
scrollEl.scrollTo({
top: Math.max(0, nextTop),
behavior: 'smooth',
});
panelEl.scrollTo({ top: 0, behavior: 'smooth' });
pulsePanel(panelEl);
}
function focusSingleSection(section: string) {
@ -3981,7 +4046,7 @@
</div>
<div class="single-form-body">
<div ref="singleFormScrollRef" class="single-form-scroll">
<div class="single-form-top">
<div class="single-cards-row">
<section
class="single-info-card liquid-card"
@ -4002,20 +4067,13 @@
@preview="handleViewShippingCustomerGuide"
/>
</template>
<a-select
<ShippingMethodTabSelect
v-model="singleForm.productCode"
allow-search
placeholder="请选择"
:groups="singleShippingMethodGroups"
:loading="singleReferenceLoading"
>
<a-option
v-for="opt in singleSalesProductOptions"
:key="opt.value"
:value="opt.value"
>
{{ opt.label }}
</a-option>
</a-select>
placeholder="请选择"
:show-all-option="false"
/>
</a-form-item>
<a-form-item
label="客户单号"
@ -4576,6 +4634,7 @@
</div>
</section>
</div>
</div>
<section
class="single-info-card liquid-card declaration-card"
@ -4651,10 +4710,7 @@
</a-tooltip>
</div>
</header>
<div
class="single-declaration-table-wrap"
:style="{ height: `${DECLARATION_PANEL_HEIGHT}px` }"
>
<div class="single-declaration-table-wrap">
<table class="single-declaration-table">
<thead>
<tr>
@ -4781,7 +4837,6 @@
</a-button>
</div>
</div>
</div>
</div>
</div>
</div>
@ -5758,11 +5813,20 @@
}
.declaration-card {
flex: 0 0 clamp(260px, 34vh, 420px);
display: flex;
flex-direction: column;
min-width: 0;
overflow: hidden;
&.is-focus-pulse {
animation: place-order-focus-pulse 1.2s ease;
}
}
.single-declaration-table-wrap {
flex: 1 1 auto;
min-height: 0;
overflow: auto;
overscroll-behavior: contain;
-webkit-overflow-scrolling: touch;
@ -6826,19 +6890,36 @@
flex: 1;
min-height: 0;
min-width: 0;
gap: 12px;
overflow: hidden;
}
.single-form-scroll {
flex: 1;
/* 上区定高;基本/收件各自卡片内滚动,互不带走 */
.single-form-top {
flex: 1 1 auto;
min-height: 0;
min-width: 0;
overflow: hidden;
}
.single-cards-row {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
gap: 12px;
height: 100%;
min-height: 0;
align-items: stretch;
}
.single-info-card {
padding: 14px 16px 12px;
box-sizing: border-box;
min-width: 0;
min-height: 0;
max-height: 100%;
overflow-x: hidden;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 12px;
padding-right: 2px;
overscroll-behavior: contain;
&::-webkit-scrollbar {
width: 6px;
@ -6852,19 +6933,10 @@
&::-webkit-scrollbar-thumb:hover {
background: var(--color-border-3);
}
}
.single-cards-row {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
gap: 12px;
align-items: stretch;
}
.single-info-card {
padding: 14px 16px 12px;
box-sizing: border-box;
min-width: 0;
&.is-focus-pulse {
animation: place-order-focus-pulse 1.2s ease;
}
}
.single-info-card--recipient {
@ -6900,6 +6972,7 @@
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
flex-shrink: 0;
margin-bottom: 8px;
}
@ -6968,8 +7041,6 @@
flex-wrap: wrap;
flex-shrink: 0;
padding: 12px 16px;
position: sticky;
bottom: 0;
z-index: 5;
}
@ -7580,8 +7651,19 @@
min-height: 320px;
}
.single-form-top {
overflow-y: auto;
}
.single-cards-row {
grid-template-columns: 1fr;
height: auto;
align-items: start;
}
.single-info-card {
max-height: none;
overflow: visible;
}
.receiver-split {

View File

@ -4,13 +4,23 @@ import { IconClose, IconDown, IconSearch } from '@arco-design/web-vue/es/icon'
import SlidingTabs from '@/components/SlidingTabs/index.vue'
import type { PriceCheckShippingGroup } from '@/api/order'
const props = defineProps<{
modelValue: string
groups: PriceCheckShippingGroup[]
loading?: boolean
placeholder?: string
disabled?: boolean
}>()
const props = withDefaults(
defineProps<{
modelValue: string
groups: PriceCheckShippingGroup[]
loading?: boolean
placeholder?: string
disabled?: boolean
/** 下拉顶部「全部渠道」;下单必选场景关掉 */
showAllOption?: boolean
/** 触发器清空按钮 */
allowClear?: boolean
}>(),
{
showAllOption: true,
allowClear: true,
},
)
const emit = defineEmits<{
'update:modelValue': [string]
@ -113,6 +123,7 @@ function clearSelection(e: Event) {
<template>
<a-dropdown
v-model:popup-visible="popupVisible"
class="shipping-tab-select"
trigger="click"
position="bl"
:disabled="disabled || loading"
@ -123,10 +134,10 @@ function clearSelection(e: Event) {
@click="openPopup"
>
<span class="trigger-text" :class="{ placeholder: !selectedLabel && !modelValue }">
{{ selectedLabel || placeholder || '全部渠道' }}
{{ selectedLabel || placeholder || (showAllOption ? '全部渠道' : '请选择') }}
</span>
<button
v-if="modelValue"
v-if="allowClear && modelValue"
type="button"
class="trigger-clear"
aria-label="clear"
@ -143,7 +154,7 @@ function clearSelection(e: Event) {
v-model="keyword"
allow-clear
size="small"
:placeholder="placeholder || '搜索渠道名称或代码'"
placeholder="搜索渠道名称或代码"
>
<template #prefix>
<icon-search />
@ -151,6 +162,7 @@ function clearSelection(e: Event) {
</a-input>
</div>
<button
v-if="showAllOption"
type="button"
class="product-item product-item--all"
:class="{ active: !modelValue }"
@ -189,6 +201,11 @@ function clearSelection(e: Event) {
</template>
<style lang="less" scoped>
.shipping-tab-select {
display: block;
width: 100%;
}
.shipping-tab-select-trigger {
display: flex;
align-items: center;

View File

@ -66,7 +66,7 @@
</div>
<p class="ai-ask__hint">{{ copy.composeLead }}</p>
<div class="ai-composer-slot--welcome">
<SiteComposer
<NanaComposer
v-if="!chatting"
v-model="draft"
:placeholder="copy.placeholder"
@ -117,59 +117,45 @@
</div>
</div>
</section>
<div class="ai-messages" :class="{ 'is-active': chatting }" role="log" aria-live="polite">
<div v-for="(msg, index) in messages" :key="index" class="ai-msg-row" :class="'ai-msg-row--' + msg.role">
<div class="ai-msg-avatar">
<i v-if="msg.role === 'assistant'" class="si si-truck" aria-hidden="true"></i>
<template v-else>{{ copy.you.charAt(0).toUpperCase() }}</template>
<NanaChatDialog :messages="messages" :typing="typing" :active="chatting">
<template #assistant-extra="{ message, isLatest }">
<SiteMessageCard
v-if="message.card"
:card="message.card as any"
:is-zh="isZh"
@intent="$emit('intent', $event)"
@wechat="$emit('wechat')"
@choice="$emit('choice', $event)"
/>
<div v-if="isLatest" class="ai-msg-followups" role="toolbar">
<button
v-if="routesPending"
type="button"
class="ai-followup-chip ai-followup-chip--routes"
:disabled="busy"
@click="$emit('open-routes')"
>
{{ copy.routesBack }}
</button>
<button
v-for="intent in visibleFollowups"
:key="'fu-' + intent.id"
type="button"
class="ai-followup-chip"
:disabled="busy"
@click="$emit('intent', intent.id)"
>
{{ isZh ? intent.zh.title : intent.en.title }}
</button>
</div>
<div class="ai-msg-bubble">
<p v-if="msg.text" class="ai-msg-text">{{ msg.text }}</p>
<SiteMessageCard
v-if="msg.card"
:card="msg.card"
:is-zh="isZh"
@intent="$emit('intent', $event)"
@wechat="$emit('wechat')"
@choice="$emit('choice', $event)"
/>
</div>
</div>
<div v-if="typing" class="ai-msg-row ai-msg-row--assistant ai-msg-row--typing">
<div class="ai-msg-avatar"><i class="si si-truck" aria-hidden="true"></i></div>
<div class="ai-msg-bubble"><span></span><span></span><span></span></div>
</div>
</div>
</template>
</NanaChatDialog>
</div>
<div class="ai-composer-dock">
<div
class="ai-followup"
:class="{ 'is-visible': chatting || routesPending }"
role="toolbar"
>
<button
v-if="routesPending"
type="button"
class="ai-followup-chip ai-followup-chip--routes"
:disabled="busy"
@click="$emit('open-routes')"
>
{{ copy.routesBack }}
</button>
<button
v-for="intent in SITE_FOLLOWUP_INTENTS"
:key="'fu-' + intent.id"
type="button"
class="ai-followup-chip"
:disabled="busy"
@click="$emit('intent', intent.id)"
>
{{ isZh ? intent.zh.title : intent.en.title }}
</button>
</div>
<div class="ai-composer-slot--chat">
<SiteComposer
<NanaComposer
v-if="chatting"
class="is-docked"
v-model="draft"
:placeholder="copy.placeholder"
:send-label="copy.sendLabel"
@ -198,8 +184,22 @@
</div>
</div>
</div>
<aside v-if="chatting || historyOpen" class="ai-history-sidebar" :aria-label="copy.historyTitle">
<p class="ai-history-sidebar__title">{{ copy.historyTitle }}</p>
<aside
class="ai-history-sidebar"
:aria-hidden="historyOpen ? 'false' : 'true'"
:aria-label="copy.historyTitle"
>
<div class="ai-history-sidebar__head">
<p class="ai-history-sidebar__title">{{ copy.historyTitle }}</p>
<button
type="button"
class="ai-history-sidebar__close"
:aria-label="copy.closeHistory"
@click="$emit('close-history')"
>
<i class="si si-x-lg" aria-hidden="true"></i>
</button>
</div>
<button type="button" class="ai-new-chat-btn" @click="$emit('new-chat')">
<i class="si si-plus-lg" aria-hidden="true"></i>
<span class="ai-new-chat-btn__label">{{ copy.newChat }}</span>
@ -215,7 +215,6 @@
role="listitem"
@click="$emit('switch-thread', thread.id)"
>
<span class="ai-history-item__icon"><i class="si si-chat" aria-hidden="true"></i></span>
<span class="ai-history-item__body">
<span class="ai-history-item__title">{{ thread.title || copy.newChat }}</span>
<span class="ai-history-item__time">{{ formatThreadTime(thread.updatedAt) }}</span>
@ -223,13 +222,20 @@
</button>
</div>
</aside>
<button type="button" class="ai-history-backdrop" aria-hidden="true" tabindex="-1" @click="$emit('close-history')"></button>
<button
type="button"
class="ai-history-backdrop"
aria-hidden="true"
tabindex="-1"
@click="$emit('close-history')"
></button>
</div>
</template>
<script lang="ts" setup>
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import SiteComposer from './SiteComposer.vue';
import NanaChatDialog from '@/components/NanaAssistant/NanaChatDialog.vue';
import NanaComposer from '@/components/NanaAssistant/NanaComposer.vue';
import SitePartnerMarquee from './SitePartnerMarquee.vue';
import SiteMessageCard from './SiteMessageCard.vue';
import SiteIllusIcon from './SiteIllusIcon.vue';
@ -244,6 +250,9 @@
} from './lib/site-welcome';
import { ROUTE_DEST_PRESETS } from './lib/portal-catalog';
/** 会话内跟进只保留前几条,避免底部一排挤占阅读 */
const FOLLOWUP_VISIBLE = 3;
export type SiteChatMessage = {
role: 'user' | 'assistant';
text?: string;
@ -344,6 +353,8 @@
set: (value) => emit('update:modelValue', value),
});
const visibleFollowups = computed(() => SITE_FOLLOWUP_INTENTS.slice(0, FOLLOWUP_VISIBLE));
function onHomeDoor(door: (typeof HOME_DOORS)[number]) {
emit('intent', door.intentId);
}

View File

@ -10,6 +10,7 @@ export const WELCOME_COPY = {
lanes: 'See lanes',
you: 'You',
historyTitle: 'Chat history',
closeHistory: 'Close history',
newChat: 'New chat',
newChatHint: 'New chat started — ask here',
emptyHistory: 'No conversations yet',
@ -44,6 +45,7 @@ export const WELCOME_COPY = {
lanes: '看线路',
you: '你',
historyTitle: '历史记录',
closeHistory: '关闭历史',
newChat: '新会话',
newChatHint: '已开启新会话,在这里提问',
emptyHistory: '暂无会话',

View File

@ -1310,58 +1310,58 @@ body.command-home .ai-stage-map--eu {
z-index: 3;
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px;
border-radius: 18px;
border: 1px solid var(--ai-glass-border);
background: var(--ai-glass-fill);
backdrop-filter: var(--ai-glass-blur);
-webkit-backdrop-filter: var(--ai-glass-blur);
box-shadow: var(--ai-glass-shadow);
gap: 2px;
padding: 0;
border: none;
border-radius: 0;
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
box-shadow: none;
}
.ai-sidebar-toggle,
.ai-new-chat-ghost {
.ai-stage-tools .ai-sidebar-toggle,
.ai-stage-tools .ai-new-chat-ghost {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 34px;
padding: 0 12px;
border-radius: 14px;
border: 1px solid transparent;
padding: 0 10px;
border-radius: 10px;
border: none;
background: transparent;
backdrop-filter: none;
-webkit-backdrop-filter: none;
box-shadow: none;
color: var(--ai-text-2);
font-size: 0.78rem;
font-weight: 600;
cursor: pointer;
}
.ai-sidebar-toggle {
.ai-stage-tools .ai-sidebar-toggle {
width: 34px;
padding: 0;
}
.ai-sidebar-toggle i,
.ai-new-chat-ghost i {
.ai-stage-tools .ai-sidebar-toggle i,
.ai-stage-tools .ai-new-chat-ghost i {
font-size: 0.95rem;
line-height: 1;
color: var(--ai-text-3);
transition: color 0.2s var(--ai-ease);
}
.ai-sidebar-toggle:hover,
.ai-new-chat-ghost:hover {
.ai-stage-tools .ai-sidebar-toggle:hover,
.ai-stage-tools .ai-new-chat-ghost:hover {
color: var(--ai-action);
border: none;
background: color-mix(in srgb, #fff 86%, #e6edf2);
box-shadow: inset 0 3px 8px rgba(15, 23, 42, 0.1);
background: transparent;
box-shadow: none;
}
.ai-sidebar-toggle:hover i,
.ai-new-chat-ghost:hover i {
.ai-stage-tools .ai-sidebar-toggle:hover i,
.ai-stage-tools .ai-new-chat-ghost:hover i {
color: var(--ai-action);
}
@ -1371,18 +1371,25 @@ body.command-home .ai-stage-map--eu {
left: 12px;
bottom: calc(var(--ai-trust-bar-h) + 10px);
z-index: 20;
width: min(268px, calc(86vw - 24px));
width: min(280px, calc(86vw - 24px));
display: flex;
flex-direction: column;
padding: 16px 12px 16px;
gap: 10px;
padding: 14px 12px 16px;
border-radius: var(--ai-dock-radius);
border: none;
background: color-mix(in srgb, var(--ai-paper) 88%, #e8eef2);
background: color-mix(in srgb, var(--ai-paper) 92%, #e8eef2);
backdrop-filter: none;
-webkit-backdrop-filter: none;
box-shadow: inset 0 3px 12px rgba(15, 23, 42, 0.1);
transform: translateX(calc(-100% - 16px));
transition: transform 0.28s var(--ai-ease);
box-shadow:
inset 0 3px 12px rgba(15, 23, 42, 0.08),
0 16px 40px rgba(15, 23, 42, 0.1);
transform: translateX(calc(-100% - 20px));
opacity: 0;
pointer-events: none;
transition:
transform 0.28s var(--ai-ease),
opacity 0.22s var(--ai-ease);
}
.ai-history-sidebar > * {
@ -1390,8 +1397,37 @@ body.command-home .ai-stage-map--eu {
z-index: 1;
}
.ai-history-sidebar__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 0 2px;
}
.ai-history-sidebar__close {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border: none;
border-radius: 999px;
background: transparent;
color: var(--ai-text-3);
cursor: pointer;
}
.ai-history-sidebar__close:hover {
color: var(--ai-action);
background: color-mix(in srgb, #fff 86%, #e6edf2);
box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.08);
}
#ai-advisor-shell.ai-history-open .ai-history-sidebar {
transform: translateX(0);
opacity: 1;
pointer-events: auto;
}
.ai-history-backdrop {
@ -2373,11 +2409,11 @@ body.command-home .ai-stage-map--eu {
}
.ai-history-sidebar__title {
margin: 0 0 10px;
padding: 0 4px;
font-size: 0.7rem;
margin: 0;
padding: 0 2px;
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.1em;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--ai-muted);
}
@ -2460,33 +2496,22 @@ body.command-home .ai-stage-map--eu {
color: var(--ai-action);
}
.ai-history-item__icon {
flex-shrink: 0;
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border-radius: 8px;
background: transparent;
color: var(--ai-text-3);
font-size: 0.85rem;
transition: color 0.2s var(--ai-ease);
}
.ai-history-item:hover .ai-history-item__icon,
.ai-history-item.is-active .ai-history-item__icon {
color: var(--ai-action);
.ai-history-item__body {
min-width: 0;
flex: 1;
}
.ai-history-item__title {
display: block;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
line-clamp: 2;
font-size: 0.84rem;
font-weight: 600;
line-height: 1.35;
color: var(--ai-ink);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
white-space: normal;
}
.ai-history-item__time {
@ -2508,6 +2533,11 @@ body.command-home .ai-stage-map--eu {
-ms-overflow-style: none;
}
/* 会话态给顶栏工具留空,避免压住首条消息 */
#ai-advisor-shell:has(.ai-stage-tools) .ai-app-main {
padding-top: 52px;
}
.ai-app-main.is-scrolled,
.ai-app-main.is-overflowing,
.ai-app-main.is-scrolled.is-overflowing {
@ -4254,15 +4284,15 @@ body.command-home .ai-featured-routes__card {
}
}
/* ?? Messages ?? */
/* ?? Messages — advisor reading flow ?? */
.ai-messages {
display: none;
flex-direction: column;
gap: 18px;
gap: 22px;
width: 100%;
max-width: min(840px, 100%);
max-width: min(720px, 100%);
margin-inline: auto;
padding: 20px 0 12px;
padding: 28px 4px 20px;
}
.ai-messages.is-active {
@ -4271,8 +4301,8 @@ body.command-home .ai-featured-routes__card {
.ai-msg-row {
display: flex;
gap: 10px;
align-items: flex-end;
gap: 12px;
align-items: flex-start;
max-width: 100%;
animation: ai-msg-in 0.3s ease;
}
@ -4289,87 +4319,117 @@ body.command-home .ai-featured-routes__card {
}
.ai-msg-row--user {
flex-direction: row-reverse;
align-self: flex-end;
justify-content: flex-end;
align-self: stretch;
}
.ai-msg-row--assistant {
align-self: flex-start;
align-self: stretch;
width: 100%;
}
.ai-msg-avatar {
/* Nana 与 FAB 同源:小尺寸头像贴助手阅读流 */
.ai-msg-nana.nana-fab-wrap,
.ai-msg-row--assistant .nana-fab-wrap {
position: relative;
display: block;
flex-shrink: 0;
width: 32px;
height: 32px;
border-radius: 10px;
width: 36px;
height: 36px;
margin-top: 2px;
}
.ai-msg-nana .nana-fab__img,
.ai-msg-row--assistant .nana-fab__img {
width: 100%;
height: 100%;
object-fit: contain;
filter: drop-shadow(0 3px 8px rgba(45, 140, 140, 0.28));
pointer-events: none;
}
.ai-msg-nana .nana-fab__pulse,
.ai-msg-row--assistant .nana-fab__pulse {
position: absolute;
inset: 1px;
border-radius: 50%;
border: 1.5px solid var(--app-primary-color, #2d8c8c);
opacity: 0;
animation: nana-pulse 2.4s ease-out infinite;
pointer-events: none;
}
@keyframes nana-pulse {
0% {
transform: scale(0.9);
opacity: 0.55;
}
70% {
transform: scale(1.25);
opacity: 0;
}
100% {
transform: scale(1.25);
opacity: 0;
}
}
.ai-msg-body {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.9rem;
}
.ai-msg-row--assistant .ai-msg-avatar {
background: var(--ai-primary-soft);
color: var(--ai-action);
}
.ai-msg-row--user .ai-msg-avatar {
background: rgba(var(--ai-navy-rgb), 0.08);
flex-direction: column;
gap: 12px;
color: var(--ai-ink);
font-size: 0.72rem;
font-weight: 700;
}
.ai-msg-body--typing {
flex-direction: row;
align-items: center;
gap: 5px;
min-height: 36px;
padding: 8px 0;
}
.ai-msg-bubble {
max-width: min(680px, 90%);
padding: 12px 16px;
border-radius: var(--ai-dock-radius-inner);
max-width: min(520px, 86%);
padding: 11px 15px;
border-radius: 18px;
font-size: 0.94rem;
line-height: 1.6;
line-height: 1.55;
}
.ai-msg-row--user .ai-msg-bubble {
background: var(--ai-action);
color: #fff;
border-bottom-right-radius: 6px;
}
.ai-msg-row--assistant .ai-msg-bubble {
color: var(--ai-ink);
border-bottom-left-radius: 6px;
}
.ai-msg-row--assistant .ai-msg-bubble:has(.ai-card) {
padding: 0;
background: none;
border: none;
box-shadow: none;
backdrop-filter: none;
-webkit-backdrop-filter: none;
overflow: visible;
isolation: auto;
}
.ai-msg-row--assistant .ai-msg-bubble:has(.ai-card)::before {
content: none;
box-shadow: 0 8px 20px color-mix(in srgb, var(--ai-action) 18%, transparent);
}
.ai-msg-text {
margin: 0;
}
.ai-msg-text + .ai-card {
margin-top: 12px;
.ai-msg-row--assistant .ai-msg-text {
font-size: 0.98rem;
line-height: 1.68;
letter-spacing: -0.01em;
color: var(--ai-ink);
}
.ai-msg-row--typing .ai-msg-bubble {
.ai-msg-text + .ai-card,
.ai-msg-body > .ai-card {
margin-top: 0;
}
.ai-msg-followups {
display: flex;
gap: 5px;
align-items: center;
padding: 14px 18px;
flex-wrap: wrap;
gap: 8px;
padding-top: 2px;
}
.ai-msg-row--typing span {
.ai-msg-row--typing .ai-msg-body--typing span {
width: 7px;
height: 7px;
border-radius: 50%;
@ -4377,8 +4437,8 @@ body.command-home .ai-featured-routes__card {
animation: ai-typing 1.2s ease-in-out infinite;
}
.ai-msg-row--typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-msg-row--typing span:nth-child(3) { animation-delay: 0.3s; }
.ai-msg-row--typing .ai-msg-body--typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-msg-row--typing .ai-msg-body--typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-typing {
0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
@ -4818,7 +4878,7 @@ body.command-home .ai-welcome-compose__lead {
.ai-composer-wrap.is-docked {
width: 100%;
max-width: min(840px, 100%);
max-width: min(720px, 100%);
margin-inline: auto;
padding: 10px 0 0;
border-top: none;