20261109 #19
251
src/App.vue
251
src/App.vue
@ -31,17 +31,32 @@
|
||||
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
|
||||
import useLocale from '@/hooks/locale';
|
||||
import { isLoginRouteName } from '@/utils/login-portal';
|
||||
import { consumePageFlip } from '@/utils/page-transition-flag';
|
||||
import {
|
||||
consumePageFlip,
|
||||
PORTAL_IRIS_ACTIVE_CLASS,
|
||||
PORTAL_IRIS_SETTLED_CLASS,
|
||||
shouldPortalIris,
|
||||
} from '@/utils/page-transition-flag';
|
||||
import GlobalSetting from '@/components/global-setting/index.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
/** '' | 'oms-iris' — 中心虹膜散开(官网→登录 / 登录互切) */
|
||||
/** '' | 'oms-iris' — 中心展开(官网→登录 / 登录互切) */
|
||||
const portalTransition = ref('');
|
||||
const isPageIris = computed(() => portalTransition.value === 'oms-iris');
|
||||
|
||||
const IRIS_MS = 1000;
|
||||
const IRIS_EASE = 'cubic-bezier(0.22, 1, 0.36, 1)';
|
||||
/**
|
||||
* 圆半径用百分比时,约 71% 就盖住视口四角。
|
||||
* 收到 80% 为止,整段时间都在铺画面,不再扩到 150% 后空转。
|
||||
* 曲线前段就有位移、后段轻轻收住,避免猛地撑开或开头发呆。
|
||||
*/
|
||||
const IRIS_MS = 920;
|
||||
const IRIS_EASE = 'cubic-bezier(0.33, 0.5, 0.22, 1)';
|
||||
/** 新页图片解码最多等这么久,超时也开动画,避免点击发僵 */
|
||||
const IRIS_READY_CAP_MS = 160;
|
||||
const IRIS_AT = '50% 50%';
|
||||
/** 约 71% 盖住四角,收到 80% 留一点余量 */
|
||||
const IRIS_END = '80%';
|
||||
|
||||
function clearPortalTransition() {
|
||||
portalTransition.value = '';
|
||||
@ -58,89 +73,144 @@
|
||||
node.style.position = 'absolute';
|
||||
node.style.inset = '0';
|
||||
node.style.width = '100%';
|
||||
node.style.height = '100%';
|
||||
node.style.minHeight = '100%';
|
||||
node.style.zIndex = String(z);
|
||||
node.style.willChange = 'clip-path, opacity, filter';
|
||||
node.style.overflow = 'hidden';
|
||||
}
|
||||
|
||||
function clearSheetStyles(node: HTMLElement) {
|
||||
node.style.position = '';
|
||||
node.style.inset = '';
|
||||
node.style.width = '';
|
||||
node.style.height = '';
|
||||
node.style.minHeight = '';
|
||||
node.style.zIndex = '';
|
||||
node.style.overflow = '';
|
||||
node.style.willChange = '';
|
||||
node.style.transform = '';
|
||||
node.style.filter = '';
|
||||
node.style.opacity = '';
|
||||
node.style.clipPath = '';
|
||||
node.style.pointerEvents = '';
|
||||
node.style.removeProperty('-webkit-clip-path');
|
||||
}
|
||||
|
||||
/**
|
||||
* 中心虹膜:旧页留底层轻压暗;新页 clip-path 从中心向外展开。
|
||||
*/
|
||||
function playIrisLeave(node: HTMLElement, done: () => void) {
|
||||
prepareSheet(node, 1);
|
||||
const anim = node.animate(
|
||||
[
|
||||
{ opacity: 1, filter: 'brightness(1)', offset: 0 },
|
||||
{ opacity: 0.92, filter: 'brightness(0.94)', offset: 0.45 },
|
||||
{ opacity: 0.82, filter: 'brightness(0.88)', offset: 1 },
|
||||
],
|
||||
{
|
||||
duration: IRIS_MS,
|
||||
easing: IRIS_EASE,
|
||||
fill: 'forwards',
|
||||
},
|
||||
);
|
||||
/** 旧页卸掉之后再调;新页铺满前不能提前放 */
|
||||
let releaseIrisLeave: (() => void) | null = null;
|
||||
|
||||
anim.finished
|
||||
.catch(() => undefined)
|
||||
.finally(() => {
|
||||
done();
|
||||
});
|
||||
function markIrisSettled() {
|
||||
const root = document.documentElement;
|
||||
root.classList.add(PORTAL_IRIS_SETTLED_CLASS);
|
||||
root.classList.remove(PORTAL_IRIS_ACTIVE_CLASS);
|
||||
}
|
||||
|
||||
function playIrisEnter(node: HTMLElement, done: () => void) {
|
||||
prepareSheet(node, 4);
|
||||
node.style.clipPath = 'circle(0% at 50% 50%)';
|
||||
node.style.setProperty('-webkit-clip-path', 'circle(0% at 50% 50%)');
|
||||
|
||||
const anim = node.animate(
|
||||
[
|
||||
{
|
||||
clipPath: 'circle(0% at 50% 50%)',
|
||||
opacity: 1,
|
||||
filter: 'brightness(0.98)',
|
||||
offset: 0,
|
||||
},
|
||||
{
|
||||
clipPath: 'circle(42% at 50% 50%)',
|
||||
opacity: 1,
|
||||
filter: 'brightness(1)',
|
||||
offset: 0.42,
|
||||
},
|
||||
{
|
||||
clipPath: 'circle(150% at 50% 50%)',
|
||||
opacity: 1,
|
||||
filter: 'brightness(1)',
|
||||
offset: 1,
|
||||
},
|
||||
],
|
||||
{
|
||||
duration: IRIS_MS,
|
||||
easing: IRIS_EASE,
|
||||
fill: 'forwards',
|
||||
},
|
||||
/**
|
||||
* 等新页完成一次完整绘制,再开裁剪。
|
||||
* 若边裁边解码大图,每一帧都要重绘,圆就会一卡一卡地长。
|
||||
*/
|
||||
function whenIncomingReady(node: HTMLElement) {
|
||||
const pending = [...node.querySelectorAll('img')].filter((img) => !img.complete);
|
||||
const decoded = Promise.all(
|
||||
pending.map((img) =>
|
||||
typeof img.decode === 'function'
|
||||
? img.decode().catch(() => undefined)
|
||||
: Promise.resolve(),
|
||||
),
|
||||
);
|
||||
|
||||
anim.finished
|
||||
.catch(() => undefined)
|
||||
.finally(() => {
|
||||
clearSheetStyles(node);
|
||||
done();
|
||||
const cap = new Promise<void>((resolve) => {
|
||||
window.setTimeout(resolve, IRIS_READY_CAP_MS);
|
||||
});
|
||||
const frames = new Promise<void>((resolve) => {
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => resolve());
|
||||
});
|
||||
});
|
||||
return Promise.all([frames, Promise.race([decoded, cap])]).then(() => undefined);
|
||||
}
|
||||
|
||||
/**
|
||||
* 旧页只作一张静止底图。亮度滤镜会让整页每一帧都重采样,是掉帧的主要来源。
|
||||
*/
|
||||
function playIrisLeave(node: HTMLElement, done: () => void) {
|
||||
prepareSheet(node, 2);
|
||||
node.classList.add('portal-iris-frozen');
|
||||
node.style.transform = 'translateZ(0)';
|
||||
node.style.pointerEvents = 'none';
|
||||
try {
|
||||
node.getAnimations({ subtree: true }).forEach((anim) => anim.pause());
|
||||
} catch {
|
||||
/* 旧环境没有 getAnimations 时,样式冻结仍然生效 */
|
||||
}
|
||||
|
||||
let released = false;
|
||||
const release = () => {
|
||||
if (released) return;
|
||||
released = true;
|
||||
if (releaseIrisLeave === release) releaseIrisLeave = null;
|
||||
done();
|
||||
};
|
||||
releaseIrisLeave = release;
|
||||
window.setTimeout(release, IRIS_MS + IRIS_READY_CAP_MS + 480);
|
||||
}
|
||||
|
||||
async function playIrisEnter(node: HTMLElement, done: () => void) {
|
||||
prepareSheet(node, 1);
|
||||
node.style.willChange = 'clip-path';
|
||||
node.style.pointerEvents = 'none';
|
||||
node.style.clipPath = 'none';
|
||||
node.style.setProperty('-webkit-clip-path', 'none');
|
||||
|
||||
let finished = false;
|
||||
let anim: Animation | null = null;
|
||||
const finish = () => {
|
||||
if (finished) return;
|
||||
finished = true;
|
||||
// 先去掉内联裁剪再 cancel,避免 fill 被取消后回到 circle(0%)
|
||||
node.style.clipPath = '';
|
||||
node.style.removeProperty('-webkit-clip-path');
|
||||
anim?.cancel();
|
||||
clearSheetStyles(node);
|
||||
done();
|
||||
releaseIrisLeave?.();
|
||||
markIrisSettled();
|
||||
};
|
||||
|
||||
try {
|
||||
await whenIncomingReady(node);
|
||||
} catch {
|
||||
/* 解码失败也继续展开 */
|
||||
}
|
||||
|
||||
if (!node.isConnected) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
const at = IRIS_AT;
|
||||
const end = IRIS_END;
|
||||
// 先收到 0 再抬到上层,避免动画首帧还没写上时整页闪一下
|
||||
node.style.clipPath = `circle(0% at ${at})`;
|
||||
node.style.setProperty('-webkit-clip-path', `circle(0% at ${at})`);
|
||||
node.style.zIndex = '3';
|
||||
try {
|
||||
anim = node.animate(
|
||||
[
|
||||
{ clipPath: `circle(0% at ${at})` },
|
||||
{ clipPath: `circle(${end} at ${at})` },
|
||||
],
|
||||
{
|
||||
duration: IRIS_MS,
|
||||
easing: IRIS_EASE,
|
||||
fill: 'forwards',
|
||||
},
|
||||
);
|
||||
} catch {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
anim.finished.catch(() => undefined).finally(finish);
|
||||
}
|
||||
|
||||
function onPortalLeave(el: Element, done: () => void) {
|
||||
@ -182,26 +252,15 @@
|
||||
return true;
|
||||
});
|
||||
|
||||
function isPcLoginRouteName(name: unknown) {
|
||||
return name === 'login' || name === 'adminLogin';
|
||||
}
|
||||
|
||||
router.beforeEach((to, from) => {
|
||||
const armed = consumePageFlip();
|
||||
const siteToLogin =
|
||||
from.name === 'siteRoot' &&
|
||||
(to.name === 'login' || to.name === 'H5Login') &&
|
||||
to.query.from === 'official-site';
|
||||
const loginPortalSwitch =
|
||||
isPcLoginRouteName(from.name) &&
|
||||
isPcLoginRouteName(to.name) &&
|
||||
from.name !== to.name;
|
||||
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
if ((armed || siteToLogin || loginPortalSwitch) && !reduceMotion) {
|
||||
portalTransition.value = 'oms-iris';
|
||||
const iris = shouldPortalIris(to, from);
|
||||
consumePageFlip();
|
||||
portalTransition.value = iris ? 'oms-iris' : '';
|
||||
const root = document.documentElement;
|
||||
if (iris) {
|
||||
root.classList.add(PORTAL_IRIS_ACTIVE_CLASS);
|
||||
} else {
|
||||
portalTransition.value = '';
|
||||
root.classList.remove(PORTAL_IRIS_ACTIVE_CLASS, PORTAL_IRIS_SETTLED_CLASS);
|
||||
}
|
||||
});
|
||||
|
||||
@ -269,7 +328,33 @@ html body .main-menu .menu-text {
|
||||
overflow: hidden;
|
||||
min-height: 100vh;
|
||||
min-height: 100dvh;
|
||||
/* 与登录页灰底一致,避免虹膜展开时露黑缝 */
|
||||
/* 与登录页灰底一致,避免展开时露黑缝 */
|
||||
background: var(--app-page-bg, #f0f3f4);
|
||||
}
|
||||
|
||||
/* 旧页:停掉无限动画和额外合成层,让底图在展开期间保持同一张纹理 */
|
||||
.portal-iris-frozen,
|
||||
.portal-iris-frozen * {
|
||||
animation-play-state: paused !important;
|
||||
transition: none !important;
|
||||
will-change: auto !important;
|
||||
}
|
||||
|
||||
/* 新页:展开期间不要再叠模糊和入场动画,否则裁剪每一帧都要重绘 */
|
||||
html.portal-iris-active .login-split,
|
||||
html.portal-iris-active .login-pane {
|
||||
will-change: auto !important;
|
||||
}
|
||||
|
||||
html.portal-iris-active .login-container,
|
||||
html.portal-iris-active .login-container * {
|
||||
backdrop-filter: none !important;
|
||||
-webkit-backdrop-filter: none !important;
|
||||
}
|
||||
|
||||
html.portal-iris-active .login-hero__principle,
|
||||
html.portal-iris-settled .login-hero__principle {
|
||||
animation: none !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -28,42 +28,43 @@
|
||||
|
||||
<a-drawer
|
||||
:visible="cameraOpen"
|
||||
placement="bottom"
|
||||
placement="top"
|
||||
:height="'auto'"
|
||||
:header="false"
|
||||
:footer="false"
|
||||
:mask-closable="true"
|
||||
unmount-on-close
|
||||
class="h5-scan-drawer"
|
||||
@open="startCamera"
|
||||
@cancel="closeCamera"
|
||||
>
|
||||
<div class="h5-scan-sheet">
|
||||
<header class="h5-scan-sheet__head">
|
||||
<div>
|
||||
<h3>{{ sheetTitle }}</h3>
|
||||
<p>{{ sheetHint }}</p>
|
||||
</div>
|
||||
<button type="button" class="h5-scan-sheet__close" @click="closeCamera">
|
||||
{{ closeLabel }}
|
||||
</button>
|
||||
</header>
|
||||
|
||||
<div class="h5-scan-sheet__viewport">
|
||||
<video ref="videoRef" class="h5-scan-sheet__video" playsinline muted autoplay />
|
||||
<div class="h5-scan-sheet__frame" aria-hidden="true" />
|
||||
<header class="h5-scan-sheet__head">
|
||||
<div>
|
||||
<h3>{{ sheetTitle }}</h3>
|
||||
<p>{{ sheetHint }}</p>
|
||||
</div>
|
||||
<button type="button" class="h5-scan-sheet__close" @click="closeCamera">
|
||||
{{ closeLabel }}
|
||||
</button>
|
||||
</header>
|
||||
<p v-if="error" class="h5-scan-sheet__error">{{ error }}</p>
|
||||
</div>
|
||||
|
||||
<div class="h5-scan-sheet__toolbar">
|
||||
<button
|
||||
v-if="torchSupported"
|
||||
type="button"
|
||||
class="h5-scan-sheet__btn is-ghost"
|
||||
@click="toggleTorch"
|
||||
>
|
||||
{{ torchOn ? torchOffLabel : torchOnLabel }}
|
||||
</button>
|
||||
<button type="button" class="h5-scan-sheet__btn" @click="closeCamera">
|
||||
{{ closeLabel }}
|
||||
</button>
|
||||
<div class="h5-scan-sheet__toolbar">
|
||||
<button
|
||||
v-if="torchSupported"
|
||||
type="button"
|
||||
class="h5-scan-sheet__btn is-ghost"
|
||||
@click="toggleTorch"
|
||||
>
|
||||
{{ torchOn ? torchOffLabel : torchOnLabel }}
|
||||
</button>
|
||||
<button type="button" class="h5-scan-sheet__btn" @click="closeCamera">
|
||||
{{ closeLabel }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
@ -128,6 +129,8 @@ let rafId = 0;
|
||||
let zxingControls: { stop: () => void } | null = null;
|
||||
let lastCode = '';
|
||||
let lastAt = 0;
|
||||
let starting = false;
|
||||
let session = 0;
|
||||
let nativeDetector: {
|
||||
detect: (source: ImageBitmapSource) => Promise<Array<{ rawValue?: string }>>;
|
||||
} | null = null;
|
||||
@ -236,18 +239,36 @@ async function startZxing() {
|
||||
});
|
||||
}
|
||||
|
||||
async function startCamera() {
|
||||
error.value = '';
|
||||
if (running.value) return;
|
||||
await nextTick();
|
||||
const video = videoRef.value;
|
||||
if (!video) return;
|
||||
async function waitForVideo() {
|
||||
for (let i = 0; i < 20; i += 1) {
|
||||
if (videoRef.value) return videoRef.value;
|
||||
await new Promise<void>((resolve) => {
|
||||
window.requestAnimationFrame(() => resolve());
|
||||
});
|
||||
}
|
||||
return videoRef.value;
|
||||
}
|
||||
|
||||
async function startCamera() {
|
||||
if (running.value || starting) return;
|
||||
const mine = session;
|
||||
starting = true;
|
||||
error.value = '';
|
||||
try {
|
||||
if (!window.isSecureContext && location.hostname !== 'localhost') {
|
||||
// 抽屉内容挂到 body 之后 video 才存在,提前取流会直接返回
|
||||
const video = await waitForVideo();
|
||||
if (mine !== session || !cameraOpen.value) return;
|
||||
if (!video) {
|
||||
throw new Error('取景未就绪,请关闭后重试');
|
||||
}
|
||||
if (!navigator.mediaDevices?.getUserMedia) {
|
||||
throw new Error('当前浏览器不支持摄像头扫码');
|
||||
}
|
||||
if (!window.isSecureContext && location.hostname !== 'localhost' && location.hostname !== '127.0.0.1') {
|
||||
throw new Error('摄像头需在 HTTPS 或 localhost 下使用');
|
||||
}
|
||||
await ensureNativeDetector();
|
||||
if (mine !== session || !cameraOpen.value) return;
|
||||
|
||||
if (nativeDetector) {
|
||||
stream = await navigator.mediaDevices.getUserMedia({
|
||||
@ -258,6 +279,11 @@ async function startCamera() {
|
||||
height: { ideal: 720 },
|
||||
},
|
||||
});
|
||||
if (mine !== session || !cameraOpen.value) {
|
||||
stream.getTracks().forEach((track) => track.stop());
|
||||
stream = null;
|
||||
return;
|
||||
}
|
||||
video.srcObject = stream;
|
||||
await video.play();
|
||||
running.value = true;
|
||||
@ -268,16 +294,23 @@ async function startCamera() {
|
||||
|
||||
running.value = true;
|
||||
await startZxing();
|
||||
if (mine !== session || !cameraOpen.value) {
|
||||
stopCamera();
|
||||
return;
|
||||
}
|
||||
stream = (video.srcObject as MediaStream) || null;
|
||||
await attachTorchCapability();
|
||||
} catch (e: any) {
|
||||
running.value = false;
|
||||
if (mine !== session) return;
|
||||
const msg =
|
||||
e?.name === 'NotAllowedError'
|
||||
? '未授权摄像头,请在系统设置中允许后重试'
|
||||
: e?.message || '无法打开摄像头';
|
||||
error.value = msg;
|
||||
emit('error', msg);
|
||||
} finally {
|
||||
starting = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -309,18 +342,15 @@ function openCamera() {
|
||||
}
|
||||
|
||||
function closeCamera() {
|
||||
session += 1;
|
||||
cameraOpen.value = false;
|
||||
stopCamera();
|
||||
focusInput();
|
||||
}
|
||||
|
||||
watch(cameraOpen, async (open) => {
|
||||
if (open) {
|
||||
await nextTick();
|
||||
await startCamera();
|
||||
} else {
|
||||
stopCamera();
|
||||
}
|
||||
watch(cameraOpen, (open) => {
|
||||
if (open) void startCamera();
|
||||
else stopCamera();
|
||||
});
|
||||
|
||||
watch(
|
||||
@ -340,8 +370,12 @@ defineExpose({ focus: focusInput, openCamera, closeCamera });
|
||||
|
||||
<style lang="less">
|
||||
.h5-scan-drawer {
|
||||
.arco-drawer {
|
||||
border-radius: 0 0 18px 18px;
|
||||
}
|
||||
|
||||
.arco-drawer-body {
|
||||
padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px));
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.arco-drawer-header {
|
||||
@ -396,47 +430,14 @@ defineExpose({ focus: focusInput, openCamera, closeCamera });
|
||||
}
|
||||
|
||||
.h5-scan-sheet {
|
||||
padding: 8px 16px 4px;
|
||||
}
|
||||
|
||||
.h5-scan-sheet__head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
color: var(--h5-text, #1d2129);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
color: var(--h5-text-3, #86909c);
|
||||
}
|
||||
}
|
||||
|
||||
.h5-scan-sheet__close {
|
||||
flex: 0 0 auto;
|
||||
height: 32px;
|
||||
padding: 0 12px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: var(--h5-well-bg, #f0f3f4);
|
||||
color: var(--h5-text-2, #4e5969);
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.h5-scan-sheet__viewport {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: 14px;
|
||||
height: min(52vh, 420px);
|
||||
background: #111827;
|
||||
aspect-ratio: 16 / 10;
|
||||
}
|
||||
|
||||
.h5-scan-sheet__video {
|
||||
@ -449,30 +450,74 @@ defineExpose({ focus: focusInput, openCamera, closeCamera });
|
||||
.h5-scan-sheet__frame {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
inset: 18% 14%;
|
||||
border: 2px solid rgba(255, 255, 255, 0.9);
|
||||
inset: 22% 18% 18%;
|
||||
border: 2px solid rgba(255, 255, 255, 0.92);
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
|
||||
}
|
||||
|
||||
.h5-scan-sheet__head {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 36px;
|
||||
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent);
|
||||
color: #fff;
|
||||
|
||||
h3 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
color: rgba(255, 255, 255, 0.82);
|
||||
}
|
||||
}
|
||||
|
||||
.h5-scan-sheet__close {
|
||||
flex: 0 0 auto;
|
||||
height: 32px;
|
||||
padding: 0 12px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.16);
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.h5-scan-sheet__error {
|
||||
position: absolute;
|
||||
left: 12px;
|
||||
right: 12px;
|
||||
bottom: 12px;
|
||||
bottom: 64px;
|
||||
z-index: 2;
|
||||
margin: 0;
|
||||
padding: 8px 10px;
|
||||
border-radius: 8px;
|
||||
background: rgba(245, 63, 63, 0.9);
|
||||
background: rgba(245, 63, 63, 0.92);
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.h5-scan-sheet__toolbar {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: 12px;
|
||||
left: 12px;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.h5-scan-sheet__btn {
|
||||
@ -486,8 +531,8 @@ defineExpose({ focus: focusInput, openCamera, closeCamera });
|
||||
cursor: pointer;
|
||||
|
||||
&.is-ghost {
|
||||
background: var(--h5-well-bg, #f0f3f4);
|
||||
color: var(--h5-text-2, #4e5969);
|
||||
background: rgba(255, 255, 255, 0.16);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -20,7 +20,7 @@ import {
|
||||
} from '@/utils/login-portal';
|
||||
import { preferH5Portal } from '@/utils/device';
|
||||
import { applyRbacUserToUserStore } from '@/utils/enter-system';
|
||||
import { peekPageFlip } from '@/utils/page-transition-flag';
|
||||
import { shouldPortalIris } from '@/utils/page-transition-flag';
|
||||
|
||||
function buildLoginRedirect(to: {
|
||||
name?: string | symbol | null;
|
||||
@ -67,7 +67,7 @@ export default function setupUserLoginInfoGuard(router: Router) {
|
||||
tabBarStore.getCacheList.includes(toName);
|
||||
// 门户翻页:跳过顶栏横条,等待感交给翻页动画
|
||||
if (
|
||||
!peekPageFlip() &&
|
||||
!shouldPortalIris(to, from) &&
|
||||
!isCachedTabSwitch &&
|
||||
!String(to.path || '').startsWith('/h5') &&
|
||||
to.path !== '/'
|
||||
|
||||
@ -30,6 +30,15 @@ const OLD_TOKEN_KEY = 'rbac_token'
|
||||
const LOGIN_TYPE_KEY = 'rbac_login_type'
|
||||
const SSO_SESSION_FLAG = 'rbac_sso_session'
|
||||
|
||||
/** 中文业务文案可以展示;领域异常码(如 Fake.Rbac.Domain:UserNotExistsOrPwdErr)不展示。 */
|
||||
export function loginErrorForUser(raw: string): string {
|
||||
const msg = raw.trim()
|
||||
if (!msg) return ''
|
||||
if (/^[A-Za-z0-9_.]+:[A-Za-z0-9_.]+$/.test(msg)) return ''
|
||||
if (!/[\u4e00-\u9fff]/.test(msg)) return ''
|
||||
return msg
|
||||
}
|
||||
|
||||
function isSsoSessionActive(): boolean {
|
||||
return sessionStorage.getItem(SSO_SESSION_FLAG) === '1'
|
||||
}
|
||||
@ -319,9 +328,9 @@ export const useRbacUserStore = defineStore('rbacUser', () => {
|
||||
await hydrateUserAfterLogin(result)
|
||||
return true
|
||||
} catch (error: unknown) {
|
||||
// 交给登录页展示业务文案(如「客户已禁用」),勿一律当成账号密码错误
|
||||
// 业务文案(如「客户已禁用」)交给登录页;领域异常码不展示
|
||||
const anyErr = error as { body?: { message?: string }; message?: string }
|
||||
const msg = String(anyErr?.body?.message || anyErr?.message || '').trim()
|
||||
const msg = loginErrorForUser(String(anyErr?.body?.message || anyErr?.message || ''))
|
||||
if (msg) throw new Error(msg)
|
||||
return false
|
||||
}
|
||||
|
||||
@ -4,6 +4,16 @@ let skipOnce = false;
|
||||
/** 门户中心虹膜过渡(官网→登录 / 客户↔管理登录,单次消费) */
|
||||
let pageFlipOnce = false;
|
||||
|
||||
/** 过渡进行中:旧页停掉逐帧绘制,新页先不要播入场动画 */
|
||||
export const PORTAL_IRIS_ACTIVE_CLASS = 'portal-iris-active';
|
||||
|
||||
/** 过渡结束后保持静帧,避免入场动画重播把页面再抖一次 */
|
||||
export const PORTAL_IRIS_SETTLED_CLASS = 'portal-iris-settled';
|
||||
|
||||
export function isPortalIrisActive() {
|
||||
return document.documentElement.classList.contains(PORTAL_IRIS_ACTIVE_CLASS);
|
||||
}
|
||||
|
||||
export function skipNextPageTransition() {
|
||||
skipOnce = true;
|
||||
}
|
||||
@ -40,6 +50,35 @@ export function peekPageFlip(): boolean {
|
||||
return pageFlipOnce;
|
||||
}
|
||||
|
||||
type PortalRouteLike = {
|
||||
name?: string | symbol | null;
|
||||
query?: { from?: unknown };
|
||||
};
|
||||
|
||||
function portalRouteName(name: PortalRouteLike['name']) {
|
||||
return name ? String(name) : '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否走中心展开:已武装的翻页、官网进登录、客户登录与管理登录互切。
|
||||
* 只读标记,不消费;真正消费仍在 App 的导航守卫里。
|
||||
*/
|
||||
export function shouldPortalIris(to: PortalRouteLike, from: PortalRouteLike): boolean {
|
||||
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return false;
|
||||
if (pageFlipOnce) return true;
|
||||
const fromName = portalRouteName(from.name);
|
||||
const toName = portalRouteName(to.name);
|
||||
if (
|
||||
fromName === 'siteRoot' &&
|
||||
(toName === 'login' || toName === 'H5Login') &&
|
||||
to.query?.from === 'official-site'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
const isPcLogin = (name: string) => name === 'login' || name === 'adminLogin';
|
||||
return isPcLogin(fromName) && isPcLogin(toName) && fromName !== toName;
|
||||
}
|
||||
|
||||
/** @deprecated 同 peekPageFlip */
|
||||
export function peekOfficialLoginFlip(): boolean {
|
||||
return peekPageFlip();
|
||||
|
||||
@ -32,6 +32,7 @@ export default {
|
||||
'h5Admin.me.emptyRole': 'No roles',
|
||||
'h5Admin.me.emptyOrg': 'No organization',
|
||||
'h5Admin.me.emptyEmail': 'Not set',
|
||||
'h5Admin.me.changePassword': 'Change password',
|
||||
|
||||
'h5Admin.recharge.title': 'Recharge review',
|
||||
'h5Admin.recharge.subtitle': 'Approve customer top-ups',
|
||||
|
||||
@ -32,6 +32,7 @@ export default {
|
||||
'h5Admin.me.emptyRole': '暂无角色',
|
||||
'h5Admin.me.emptyOrg': '未分配组织',
|
||||
'h5Admin.me.emptyEmail': '未填写',
|
||||
'h5Admin.me.changePassword': '修改密码',
|
||||
|
||||
'h5Admin.recharge.title': '充值审核',
|
||||
'h5Admin.recharge.subtitle': '审核客户充值申请',
|
||||
|
||||
@ -68,7 +68,7 @@ import { OmsLoginType } from '@/api/rbac';
|
||||
import { isLogin, setToken } from '@/utils/auth';
|
||||
import { applyRbacUserToUserStore } from '@/utils/enter-system';
|
||||
import { ensureFullLocaleMessages } from '@/locale';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { loginErrorForUser, useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { ADMIN_H5_HOME_PATH, isAdminH5Path } from '@/utils/login-portal';
|
||||
import logoImg from '@/assets/logo2.png';
|
||||
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
|
||||
@ -144,7 +144,7 @@ async function handleSubmit() {
|
||||
Message.success(t('h5Admin.login.success'));
|
||||
await finishLogin();
|
||||
} catch (e: any) {
|
||||
errorBox.value = e?.message || t('h5Admin.login.failed');
|
||||
errorBox.value = loginErrorForUser(e?.message || '') || t('h5Admin.login.failed');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@ -25,16 +25,22 @@
|
||||
<span>{{ t('h5Admin.me.email') }}</span>
|
||||
<strong>{{ email }}</strong>
|
||||
</div>
|
||||
<button type="button" class="h5-admin-me__row h5-admin-me__link" @click="passwordOpen = true">
|
||||
<span>{{ t('h5Admin.me.changePassword') }}</span>
|
||||
<strong aria-hidden="true">›</strong>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<button type="button" class="h5-admin-me__logout h5-enter" @click="handleLogout">
|
||||
{{ t('h5Admin.me.logout') }}
|
||||
</button>
|
||||
|
||||
<H5PasswordSheet v-model:visible="passwordOpen" @success="onPasswordChanged" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Modal } from '@arco-design/web-vue';
|
||||
@ -42,6 +48,7 @@ import { useUserStore } from '@/store';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { ADMIN_H5_LOGIN_PATH } from '@/utils/login-portal';
|
||||
import defaultAvatar from '@/assets/logo2.png';
|
||||
import H5PasswordSheet from '@/views/h5/customer-center/components/H5PasswordSheet.vue';
|
||||
|
||||
defineOptions({ name: 'H5AdminMe' });
|
||||
|
||||
@ -66,6 +73,13 @@ const rolesLabel = computed(() => {
|
||||
return roles.map((r) => r.name || r.code).filter(Boolean).join(' · ');
|
||||
});
|
||||
const avatarUrl = computed(() => info.value?.avatar || defaultAvatar);
|
||||
const passwordOpen = ref(false);
|
||||
|
||||
async function onPasswordChanged() {
|
||||
await userStore.logout();
|
||||
rbacUserStore.logout();
|
||||
await router.replace(ADMIN_H5_LOGIN_PATH);
|
||||
}
|
||||
|
||||
function handleLogout() {
|
||||
Modal.confirm({
|
||||
@ -160,6 +174,23 @@ function handleLogout() {
|
||||
}
|
||||
}
|
||||
|
||||
.h5-admin-me__link {
|
||||
width: 100%;
|
||||
border: none;
|
||||
background: transparent;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
|
||||
strong {
|
||||
flex: 0 0 auto;
|
||||
color: var(--h5-text-3, #86909c);
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.h5-admin-me__logout {
|
||||
display: block;
|
||||
width: 100%;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<header class="h5-ops-hd">
|
||||
<button type="button" class="h5-ops-hd__back" @click="goBack">←</button>
|
||||
<h1 class="h5-ops-hd__title">{{ title }}</h1>
|
||||
<button type="button" class="h5-ops-hd__wh" @click="pickerOpen = true">
|
||||
<span class="h5-ops-hd__wh-name">{{ warehouseLabel }}</span>
|
||||
@ -53,7 +52,6 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { getWarehouseList } from '@/api/system/warehouse';
|
||||
import { useCurrentWarehouseStore } from '@/store';
|
||||
@ -69,7 +67,6 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const router = useRouter();
|
||||
const store = useCurrentWarehouseStore();
|
||||
|
||||
const pickerOpen = ref(false);
|
||||
@ -81,10 +78,6 @@ const warehouseLabel = computed(
|
||||
() => store.warehouseName || t('warehouse.common.noCurrentWarehouse'),
|
||||
);
|
||||
|
||||
function goBack() {
|
||||
router.back();
|
||||
}
|
||||
|
||||
async function loadWarehouses() {
|
||||
loading.value = true;
|
||||
try {
|
||||
@ -137,37 +130,29 @@ onMounted(() => {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.h5-ops-hd {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 10px;
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
.h5-ops-hd__back {
|
||||
flex: 0 0 auto;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: var(--h5-well-bg, #f0f3f4);
|
||||
color: var(--h5-text, #1d2129);
|
||||
font-size: 16px;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.h5-ops-hd__title {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
max-width: calc(100% - 200px);
|
||||
margin: 0;
|
||||
transform: translateX(-50%);
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
text-align: center;
|
||||
color: var(--h5-text, #1d2129);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.h5-ops-hd__wh {
|
||||
|
||||
@ -127,7 +127,7 @@ import { applyRbacUserToUserStore } from '@/utils/enter-system';
|
||||
import { parseH5RedirectLocation } from '@/utils/h5-redirect';
|
||||
import { ensureFullLocaleMessages } from '@/locale';
|
||||
import { isWeChatBrowser } from '@/utils/device';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { loginErrorForUser, useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import logoImg from '@/assets/logo2.png';
|
||||
import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue';
|
||||
import H5LoginPortalSwitch from '@/views/h5/components/H5LoginPortalSwitch.vue';
|
||||
@ -255,7 +255,7 @@ async function consumeOAuthCode(code: string) {
|
||||
// 成功后保持全屏过渡直到离开本页,勿 toast / 勿先露出登录表单
|
||||
await finishLogin();
|
||||
} catch (e: any) {
|
||||
const msg = e?.message || t('h5.login.oauthFailed');
|
||||
const msg = loginErrorForUser(e?.message || '') || t('h5.login.oauthFailed');
|
||||
Message.error(msg);
|
||||
errorBox.value = msg;
|
||||
oauthBusy.value = false;
|
||||
@ -299,7 +299,7 @@ async function handleSubmit() {
|
||||
Message.success(t('h5.login.success'));
|
||||
await finishLogin();
|
||||
} catch (e: any) {
|
||||
errorBox.value = e?.message || t('h5.login.failed');
|
||||
errorBox.value = loginErrorForUser(e?.message || '') || t('h5.login.failed');
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ import { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { getCarePeriod, getHolidayId, isAfterWorkHours } from '@/utils/admin-login-care';
|
||||
import { getAdminCareSettings } from '@/utils/admin-care-settings';
|
||||
import { isPortalIrisActive } from '@/utils/page-transition-flag';
|
||||
|
||||
defineOptions({ name: 'LoginCareBanner' });
|
||||
|
||||
@ -65,9 +66,14 @@ onMounted(async () => {
|
||||
settingsEnabled.value = s.careEnabled && s.loginBannerEnabled;
|
||||
if (!settingsEnabled.value) return;
|
||||
await nextTick();
|
||||
enterTimer = window.setTimeout(() => {
|
||||
const reveal = () => {
|
||||
if (isPortalIrisActive()) {
|
||||
enterTimer = window.setTimeout(reveal, 80);
|
||||
return;
|
||||
}
|
||||
visible.value = true;
|
||||
}, 180);
|
||||
};
|
||||
enterTimer = window.setTimeout(reveal, 180);
|
||||
timer = window.setInterval(() => {
|
||||
tick.value += 1;
|
||||
}, 60_000);
|
||||
|
||||
@ -82,6 +82,7 @@
|
||||
src="/login-assets/hero-plane.png"
|
||||
alt=""
|
||||
draggable="false"
|
||||
decoding="async"
|
||||
/>
|
||||
</picture>
|
||||
<img
|
||||
@ -90,6 +91,7 @@
|
||||
src="/login-assets/hero-truck.png"
|
||||
alt=""
|
||||
draggable="false"
|
||||
decoding="async"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
:to="to"
|
||||
replace
|
||||
:aria-label="label"
|
||||
@pointerenter="preloadTarget"
|
||||
@focus="preloadTarget"
|
||||
@click="onSwitchClick"
|
||||
>
|
||||
<icon-swap :size="16" />
|
||||
@ -36,6 +38,20 @@ const label = computed(() =>
|
||||
: t('login.switchToCustomer'),
|
||||
);
|
||||
|
||||
const TARGET_HERO: Record<'admin' | 'customer', string> = {
|
||||
admin: '/login-assets/hero-truck.png',
|
||||
customer: '/login-assets/hero-plane.webp',
|
||||
};
|
||||
|
||||
let targetPreloaded = false;
|
||||
|
||||
function preloadTarget() {
|
||||
if (targetPreloaded) return;
|
||||
targetPreloaded = true;
|
||||
const hero = new Image();
|
||||
hero.src = TARGET_HERO[props.target];
|
||||
}
|
||||
|
||||
function onSwitchClick(e: MouseEvent) {
|
||||
if (
|
||||
e.button !== 0 ||
|
||||
|
||||
@ -105,7 +105,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { IconWechat } from '@arco-design/web-vue/es/icon';
|
||||
import { OmsLoginType } from '@/api/rbac';
|
||||
import { useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { loginErrorForUser, useRbacUserStore } from '@/store/modules/rbac-user';
|
||||
import { setToken } from '@/utils/auth';
|
||||
import { getDefaultHomePathByType, resolveCustomerEntryPath } from '@/utils/login-portal';
|
||||
import { enterSystemAfterLogin, applyRbacUserToUserStore } from '@/utils/enter-system';
|
||||
@ -358,7 +358,7 @@ async function handleSubmit() {
|
||||
props.loginType,
|
||||
);
|
||||
} catch (loginErr: unknown) {
|
||||
const msg = loginErr instanceof Error ? loginErr.message.trim() : '';
|
||||
const msg = loginErr instanceof Error ? loginErrorForUser(loginErr.message) : '';
|
||||
errorBox.value = msg || t('login.form.login.failed');
|
||||
loginCharacters.value?.onLoginFailed();
|
||||
return;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { onBeforeUnmount, onMounted, ref, shallowRef, nextTick, type Ref } from 'vue';
|
||||
import gsap from 'gsap';
|
||||
import { isPortalIrisActive } from '@/utils/page-transition-flag';
|
||||
|
||||
export interface LoginCharactersApi {
|
||||
onAccountFocus: () => void;
|
||||
@ -458,6 +459,10 @@ export function useLoginCharacters(refs: CharacterRefs) {
|
||||
}
|
||||
|
||||
function tick() {
|
||||
if (isPortalIrisActive()) {
|
||||
rafId = requestAnimationFrame(tick);
|
||||
return;
|
||||
}
|
||||
const container = refs.container.value;
|
||||
updateMouthExpressions();
|
||||
if (!container) {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<div ref="rightSplitRef" class="login-split login-split--right" aria-hidden="true" />
|
||||
|
||||
<LoginCareBanner
|
||||
v-if="shellReady && isAdminLogin"
|
||||
v-if="shellReady && isAdminLogin && careBannerReady"
|
||||
:light="isLightMode"
|
||||
/>
|
||||
|
||||
@ -113,6 +113,7 @@ import {
|
||||
type LoginCharactersApi,
|
||||
} from './composables/useLoginCharacters';
|
||||
import { LOGIN_EXIT_KEY, type LoginExitApi } from './composables/useLoginExit';
|
||||
import { isPortalIrisActive } from '@/utils/page-transition-flag';
|
||||
|
||||
/** Admin login never mounts WeChat; keep it out of the critical path */
|
||||
const WechatLogin = defineAsyncComponent(
|
||||
@ -142,6 +143,8 @@ const brandCornerSuffix = computed(() =>
|
||||
);
|
||||
/** 角色动画偏重,首屏延后一帧再挂,管理端也挂但异步分包 */
|
||||
const showCharacters = ref(false);
|
||||
/** 管理端关怀条在翻页结束后再挂,避免展开过程中插入一块新图层 */
|
||||
const careBannerReady = ref(!isPortalIrisActive());
|
||||
const activeKey = ref<'pwd' | 'wechat'>('pwd');
|
||||
const wechatMounted = ref(false);
|
||||
const wechatLoginRef = ref<{ prefetch?: () => void } | null>(null);
|
||||
@ -293,21 +296,42 @@ function prefetchWechatQr() {
|
||||
});
|
||||
}
|
||||
|
||||
/** 翻页进行中主线程要让给裁剪动画,装饰内容等动画结束后再挂 */
|
||||
function afterPortalIris(run: () => void) {
|
||||
if (!isPortalIrisActive()) {
|
||||
run();
|
||||
return;
|
||||
}
|
||||
const started = performance.now();
|
||||
const wait = () => {
|
||||
if (!isPortalIrisActive() || performance.now() - started > 1800) {
|
||||
run();
|
||||
return;
|
||||
}
|
||||
window.setTimeout(wait, 80);
|
||||
};
|
||||
window.setTimeout(wait, 80);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
document.documentElement.classList.add(LOGIN_PAGE_SCROLL_LOCK_CLASS);
|
||||
shellReady.value = true;
|
||||
const idle = window.requestIdleCallback
|
||||
? (cb: () => void, timeout = 1200) => window.requestIdleCallback(cb, { timeout })
|
||||
: (cb: () => void, timeout = 1200) => window.setTimeout(cb, Math.min(timeout, 400));
|
||||
// 表单先出,空闲后再挂角色,避免和首屏 JS/图抢带宽
|
||||
idle(() => {
|
||||
showCharacters.value = true;
|
||||
}, 1600);
|
||||
idle(() => {
|
||||
void import('@/locale').then(({ ensureFullLocaleMessages }) => {
|
||||
void ensureFullLocaleMessages();
|
||||
});
|
||||
}, 2500);
|
||||
const enteredByIris = isPortalIrisActive();
|
||||
afterPortalIris(() => {
|
||||
careBannerReady.value = true;
|
||||
// 表单先出,空闲后再挂角色,避免和首屏 JS/图抢带宽
|
||||
idle(() => {
|
||||
showCharacters.value = true;
|
||||
}, enteredByIris ? 480 : 1600);
|
||||
idle(() => {
|
||||
void import('@/locale').then(({ ensureFullLocaleMessages }) => {
|
||||
void ensureFullLocaleMessages();
|
||||
});
|
||||
}, 2500);
|
||||
});
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
@ -327,6 +351,9 @@ onBeforeUnmount(() => {
|
||||
--login-right-bg: var(--app-page-bg, #f0f3f4);
|
||||
|
||||
box-sizing: border-box;
|
||||
/* 官网 body 行高 1.55 会留到翻页结束。钉成页面默认 1.15,避免卸样式时登录卡缩短下移 */
|
||||
font-size: 14px;
|
||||
line-height: 1.15;
|
||||
height: 100dvh;
|
||||
max-height: 100dvh;
|
||||
min-height: 100dvh;
|
||||
|
||||
@ -36,26 +36,35 @@
|
||||
</div>
|
||||
<div class="ai-welcome__stack">
|
||||
<div class="ai-welcome__command">
|
||||
<div class="ai-welcome-compose-panel">
|
||||
<a
|
||||
class="ai-welcome-cta-link"
|
||||
:href="loginUrl"
|
||||
@pointerenter="$emit('warm-login')"
|
||||
@focus="$emit('warm-login')"
|
||||
>{{ copy.heroCta }}</a>
|
||||
<p class="ai-welcome-compose__lead">{{ copy.composeLead }}</p>
|
||||
<div class="ai-home-dests" role="group" :aria-label="copy.destAria">
|
||||
<button
|
||||
v-for="dest in homeDests"
|
||||
:key="dest.id"
|
||||
type="button"
|
||||
class="ai-home-dest"
|
||||
:disabled="busy"
|
||||
@click="$emit('open-routes', dest.id)"
|
||||
<div class="ai-ask">
|
||||
<div class="ai-ask__bar">
|
||||
<div
|
||||
class="ai-ask__dests"
|
||||
role="group"
|
||||
:aria-label="copy.destAria"
|
||||
@keydown="onDestKeydown"
|
||||
>
|
||||
{{ isZh ? dest.label.zh : dest.label.en }}
|
||||
</button>
|
||||
<button
|
||||
v-for="(dest, index) in homeDests"
|
||||
:key="dest.id"
|
||||
type="button"
|
||||
class="ai-ask__dest"
|
||||
:aria-pressed="pickedDest === dest.id"
|
||||
:tabindex="index === destCursor ? 0 : -1"
|
||||
:disabled="busy"
|
||||
@click="pickDest(dest.id, index)"
|
||||
>
|
||||
{{ isZh ? dest.label.zh : dest.label.en }}
|
||||
</button>
|
||||
</div>
|
||||
<a
|
||||
class="ai-ask__cta"
|
||||
:href="loginUrl"
|
||||
@pointerenter="$emit('warm-login')"
|
||||
@focus="$emit('warm-login')"
|
||||
>{{ copy.heroCta }}</a>
|
||||
</div>
|
||||
<p class="ai-ask__hint">{{ copy.composeLead }}</p>
|
||||
<div class="ai-composer-slot--welcome">
|
||||
<SiteComposer
|
||||
v-if="!chatting"
|
||||
@ -282,6 +291,31 @@
|
||||
|
||||
const copy = computed(() => (props.isZh ? WELCOME_COPY.zh : WELCOME_COPY.en));
|
||||
const homeDests = ROUTE_DEST_PRESETS.filter((item) => item.id !== 'all');
|
||||
const pickedDest = ref('');
|
||||
const destCursor = ref(0);
|
||||
|
||||
function pickDest(id: string, index: number) {
|
||||
pickedDest.value = id;
|
||||
destCursor.value = index;
|
||||
emit('open-routes', id);
|
||||
}
|
||||
|
||||
function onDestKeydown(event: KeyboardEvent) {
|
||||
const key = event.key;
|
||||
if (key !== 'ArrowRight' && key !== 'ArrowLeft' && key !== 'Home' && key !== 'End') return;
|
||||
const root = event.currentTarget;
|
||||
if (!(root instanceof HTMLElement)) return;
|
||||
const buttons = [...root.querySelectorAll<HTMLButtonElement>('.ai-ask__dest:not(:disabled)')];
|
||||
if (!buttons.length) return;
|
||||
event.preventDefault();
|
||||
let index = destCursor.value;
|
||||
if (key === 'ArrowRight') index = (index + 1) % buttons.length;
|
||||
else if (key === 'ArrowLeft') index = (index - 1 + buttons.length) % buttons.length;
|
||||
else if (key === 'Home') index = 0;
|
||||
else index = buttons.length - 1;
|
||||
destCursor.value = index;
|
||||
buttons[index]?.focus();
|
||||
}
|
||||
|
||||
function doorById(id: string) {
|
||||
return HOME_DOORS.find((d) => d.id === id);
|
||||
|
||||
@ -18,7 +18,9 @@
|
||||
@keydown="onKeydown"
|
||||
></textarea>
|
||||
<button type="submit" class="ai-composer-send" :class="{ 'is-empty': !modelValue.trim() }" :disabled="busy" :aria-label="sendLabel">
|
||||
<i class="si si-send-fill"></i>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
* - 单次遍历 + fillRect,避免双遍 arc
|
||||
*/
|
||||
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { isPortalIrisActive } from '@/utils/page-transition-flag';
|
||||
|
||||
defineOptions({ name: 'SiteDotGrid' });
|
||||
|
||||
@ -170,6 +171,7 @@
|
||||
|
||||
const loop = () => {
|
||||
raf = 0;
|
||||
if (isPortalIrisActive()) return;
|
||||
paint();
|
||||
if (!isPaused && isVisible && isPageVisible && (moving || stillSettling())) {
|
||||
moving = false;
|
||||
|
||||
@ -188,42 +188,42 @@
|
||||
href: '/',
|
||||
zh: '首页',
|
||||
en: 'Home',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none"><path d="M4.5 11.2 12 4.8l7.5 6.4V19a1.6 1.6 0 0 1-1.6 1.6h-3.4v-5.2h-5V20.6H6.1A1.6 1.6 0 0 1 4.5 19z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>',
|
||||
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M4.5 11.2 12 4.8l7.5 6.4V19a1.6 1.6 0 0 1-1.6 1.6h-3.4v-5.2h-5V20.6H6.1A1.6 1.6 0 0 1 4.5 19z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'routes',
|
||||
href: '#routes',
|
||||
zh: '线路',
|
||||
en: 'Lanes',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none"><path d="M6.2 7.2h7.4a3.2 3.2 0 0 1 0 6.4H10.4a3.2 3.2 0 0 0 0 6.4h7.4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="6.2" cy="7.2" r="2.1" stroke="currentColor" stroke-width="1.8"/><circle cx="17.8" cy="19.9" r="2.1" stroke="currentColor" stroke-width="1.8"/></svg>',
|
||||
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M6.2 7.2h7.4a3.2 3.2 0 0 1 0 6.4H10.4a3.2 3.2 0 0 0 0 6.4h7.4" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="6.2" cy="7.2" r="2.1" stroke="currentColor" stroke-width="1.8"/><circle cx="17.8" cy="19.9" r="2.1" stroke="currentColor" stroke-width="1.8"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'services',
|
||||
href: '#services',
|
||||
zh: '服务',
|
||||
en: 'Services',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none"><path d="M4 14.5V12a8 8 0 0 1 16 0v2.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><path d="M4 14h2.8v5.2H4A1.6 1.6 0 0 1 2.4 17.6v-2A1.6 1.6 0 0 1 4 14z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M20 14h-2.8v5.2H20a1.6 1.6 0 0 0 1.6-1.6v-2A1.6 1.6 0 0 0 20 14z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>',
|
||||
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M4 14.5V12a8 8 0 0 1 16 0v2.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><path d="M4 14h2.8v5.2H4A1.6 1.6 0 0 1 2.4 17.6v-2A1.6 1.6 0 0 1 4 14z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M20 14h-2.8v5.2H20a1.6 1.6 0 0 0 1.6-1.6v-2A1.6 1.6 0 0 0 20 14z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'pricing',
|
||||
href: '#pricing',
|
||||
zh: '价格',
|
||||
en: 'Price',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none"><rect x="4.2" y="5.2" width="15.6" height="13.6" rx="2.2" stroke="currentColor" stroke-width="1.8"/><path d="M8 10.2h3.2M8 13.8h8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="15.4" cy="10.2" r="1.2" fill="currentColor"/></svg>',
|
||||
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><rect x="4.2" y="5.2" width="15.6" height="13.6" rx="2.2" stroke="currentColor" stroke-width="1.8"/><path d="M8 10.2h3.2M8 13.8h8" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="15.4" cy="10.2" r="1.2" fill="currentColor"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'about',
|
||||
href: '#about',
|
||||
zh: '关于',
|
||||
en: 'About',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.2" stroke="currentColor" stroke-width="1.8"/><path d="M12 10.6V17" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="12" cy="7.6" r="1.05" fill="currentColor"/></svg>',
|
||||
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.2" stroke="currentColor" stroke-width="1.8"/><path d="M12 10.6V17" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><circle cx="12" cy="7.6" r="1.05" fill="currentColor"/></svg>',
|
||||
},
|
||||
{
|
||||
id: 'contact',
|
||||
href: '#contact',
|
||||
zh: '联系',
|
||||
en: 'Contact',
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none"><path d="M5.2 6.2h13.6A1.8 1.8 0 0 1 20.6 8v7.2a1.8 1.8 0 0 1-1.8 1.8H9.4L4.8 20.4V8A1.8 1.8 0 0 1 6.6 6.2z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M8.4 10.4h7.2M8.4 13.4h4.6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',
|
||||
icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M5.2 6.2h13.6A1.8 1.8 0 0 1 20.6 8v7.2a1.8 1.8 0 0 1-1.8 1.8H9.4L4.8 20.4V8A1.8 1.8 0 0 1 6.6 6.2z" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><path d="M8.4 10.4h7.2M8.4 13.4h4.6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
* - 通过 --runway-edge-top 把上边线位置交给飞机对齐
|
||||
*/
|
||||
import { onMounted, onUnmounted, ref, watch } from 'vue';
|
||||
import { isPortalIrisActive } from '@/utils/page-transition-flag';
|
||||
|
||||
defineOptions({ name: 'SiteRunway' });
|
||||
|
||||
@ -217,6 +218,7 @@
|
||||
|
||||
const tickEnter = (now: number) => {
|
||||
enterRaf = 0;
|
||||
if (isPortalIrisActive()) return;
|
||||
if (!enterStart) enterStart = now;
|
||||
const raw = now - enterStart - ENTER_DELAY;
|
||||
enterElapsed = raw <= 0 ? 0 : raw;
|
||||
|
||||
@ -121,6 +121,7 @@
|
||||
} from './lib/site-style-lifecycle';
|
||||
import { useSiteAdvisor } from './useSiteAdvisor';
|
||||
import { trackSiteEvent } from '@/utils/ga';
|
||||
import { isPortalIrisActive } from '@/utils/page-transition-flag';
|
||||
|
||||
// 同步注入,离开页面时卸载,避免污染 /h5 与 NanaAssistant
|
||||
mountOfficialSiteStyles();
|
||||
@ -455,6 +456,24 @@
|
||||
else if (hash) nav.value = hash;
|
||||
});
|
||||
|
||||
function releaseOfficialSiteSurface() {
|
||||
if (!isPortalIrisActive()) {
|
||||
clearOfficialSiteDomState();
|
||||
unmountOfficialSiteStyles();
|
||||
return;
|
||||
}
|
||||
const started = performance.now();
|
||||
const wait = () => {
|
||||
if (!isPortalIrisActive() || performance.now() - started > 2000) {
|
||||
clearOfficialSiteDomState();
|
||||
unmountOfficialSiteStyles();
|
||||
return;
|
||||
}
|
||||
window.setTimeout(wait, 32);
|
||||
};
|
||||
window.setTimeout(wait, 32);
|
||||
}
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('keydown', onKeydown);
|
||||
window.removeEventListener('resize', syncHeaderOffset);
|
||||
@ -463,8 +482,9 @@
|
||||
window.visualViewport?.removeEventListener('scroll', syncVisualViewport);
|
||||
deactivatePanelFocus();
|
||||
closeMobileNav();
|
||||
clearOfficialSiteDomState();
|
||||
unmountOfficialSiteStyles();
|
||||
// 翻页过程中旧 DOM 还在。立刻卸 command-home / 官网样式的话,
|
||||
// 导航 SVG 没有宽高,会按默认 300px 摊成一块蓝色房子图标。
|
||||
releaseOfficialSiteSurface();
|
||||
if (previousTitle) document.title = previousTitle;
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -105,6 +105,8 @@ export function warmupOfficialLogin() {
|
||||
document.head.appendChild(prefetch);
|
||||
// 预拉取登录分包,翻页进入时少等 chunk
|
||||
void import('@/views/login/index.vue');
|
||||
const hero = new Image();
|
||||
hero.src = '/login-assets/hero-plane.webp';
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
|
||||
@ -2550,17 +2550,12 @@ body.command-home .ai-stage-map--eu {
|
||||
}
|
||||
|
||||
.ai-welcome-airstrip,
|
||||
.ai-welcome-compose-panel,
|
||||
.ai-welcome-trustline,
|
||||
.ai-intent-section,
|
||||
.ai-trust-bar {
|
||||
animation: ai-welcome-rise 0.78s cubic-bezier(0.22, 1, 0.36, 1) both;
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel {
|
||||
animation-delay: 0.24s;
|
||||
}
|
||||
|
||||
.ai-welcome-trustline {
|
||||
animation-delay: 0.34s;
|
||||
}
|
||||
@ -2678,75 +2673,97 @@ body.command-home #navbar .site-nav-avatar:hover {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Welcome compose — light frost, not a heavy card stack */
|
||||
.ai-welcome-compose-panel {
|
||||
/* 提问卡:薄玻璃,点阵透出来 */
|
||||
.ai-ask {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 20px 22px 18px;
|
||||
border-radius: 18px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.72);
|
||||
background: rgba(255, 255, 255, 0.55);
|
||||
backdrop-filter: blur(14px) saturate(140%);
|
||||
-webkit-backdrop-filter: blur(14px) saturate(140%);
|
||||
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
|
||||
padding: 18px 20px 16px;
|
||||
border-radius: 16px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.7);
|
||||
background: rgba(255, 255, 255, 0.28);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel .ai-welcome-cta-link {
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
right: 20px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel .ai-welcome-compose__lead {
|
||||
padding-right: 7.5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ai-welcome-cta-link {
|
||||
display: inline-flex;
|
||||
.ai-ask__bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
min-height: 32px;
|
||||
padding: 0 14px;
|
||||
border: 1px solid color-mix(in srgb, var(--ai-accent, #e96a26) 28%, #fff);
|
||||
border-radius: 999px;
|
||||
background: color-mix(in srgb, var(--ai-accent, #e96a26) 10%, #fff);
|
||||
color: var(--ai-accent, #e96a26);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.01em;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
box-shadow: 0 1px 2px rgba(233, 106, 38, 0.08);
|
||||
transition:
|
||||
color 0.18s var(--ai-ease),
|
||||
background 0.18s var(--ai-ease),
|
||||
border-color 0.18s var(--ai-ease),
|
||||
box-shadow 0.18s var(--ai-ease),
|
||||
transform 0.15s var(--ai-ease);
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.ai-welcome-cta-link:hover,
|
||||
.ai-welcome-cta-link:focus {
|
||||
color: #fff;
|
||||
background: var(--ai-accent, #e96a26);
|
||||
border-color: var(--ai-accent, #e96a26);
|
||||
.ai-ask__cta {
|
||||
flex-shrink: 0;
|
||||
margin-left: auto;
|
||||
color: var(--ai-accent, #e96a26);
|
||||
font-size: 0.84rem;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
text-decoration: none;
|
||||
box-shadow: 0 4px 14px rgba(233, 106, 38, 0.28);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.ai-ask__cta:hover,
|
||||
.ai-ask__cta:focus-visible {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
|
||||
.ai-ask__dests {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ai-ask__dest {
|
||||
min-height: 34px;
|
||||
padding: 0 14px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(18, 24, 32, 0.12);
|
||||
background: rgba(255, 255, 255, 0.38);
|
||||
color: #3d4754;
|
||||
font: inherit;
|
||||
font-size: 0.84rem;
|
||||
font-weight: 650;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
color 0.15s var(--ai-ease),
|
||||
background 0.15s var(--ai-ease),
|
||||
border-color 0.15s var(--ai-ease);
|
||||
}
|
||||
|
||||
.ai-ask__dest:hover:not(:disabled) {
|
||||
color: #023e8a;
|
||||
border-color: rgba(2, 62, 138, 0.35);
|
||||
background: rgba(255, 255, 255, 0.62);
|
||||
}
|
||||
|
||||
.ai-ask__dest:focus-visible {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.18);
|
||||
}
|
||||
|
||||
.ai-ask__dest[aria-pressed='true'] {
|
||||
color: #023e8a;
|
||||
border-color: rgba(2, 62, 138, 0.55);
|
||||
background: rgba(2, 62, 138, 0.1);
|
||||
}
|
||||
|
||||
.ai-ask__dest:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.ai-ask__hint {
|
||||
margin: 0 0 12px;
|
||||
font-size: 0.8rem;
|
||||
line-height: 1.4;
|
||||
color: #6a7380;
|
||||
}
|
||||
|
||||
/* 意图区 · 双区分类网格(履约 3 + 代理 featured + 成长 3) */
|
||||
@ -2966,7 +2983,7 @@ body.command-home #navbar .site-nav-avatar:hover {
|
||||
padding: 12px 14px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.66);
|
||||
border-radius: 14px;
|
||||
background: color-mix(in srgb, #fff 52%, transparent);
|
||||
background: color-mix(in srgb, #fff 46%, transparent);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.78),
|
||||
0 1px 2px rgba(15, 23, 42, 0.04);
|
||||
@ -2983,10 +3000,35 @@ body.command-home #navbar .site-nav-avatar:hover {
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
/* 覆盖 command-home 全局禁 blur:仅精选卡开磨砂,透出点阵 */
|
||||
/* 提问卡的点只有 2px,模糊一大就会被白底抹平,所以比线路卡更透、更少糊 */
|
||||
body.command-home .ai-ask {
|
||||
backdrop-filter: blur(6px) saturate(135%) !important;
|
||||
-webkit-backdrop-filter: blur(6px) saturate(135%) !important;
|
||||
}
|
||||
|
||||
body.command-home .ai-featured-routes__card {
|
||||
backdrop-filter: blur(18px) saturate(155%) !important;
|
||||
-webkit-backdrop-filter: blur(18px) saturate(155%) !important;
|
||||
backdrop-filter: blur(18px) saturate(160%) !important;
|
||||
-webkit-backdrop-filter: blur(18px) saturate(160%) !important;
|
||||
}
|
||||
|
||||
.ai-featured-routes__card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
border-radius: inherit;
|
||||
pointer-events: none;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(255, 255, 255, 0.55) 0%,
|
||||
rgba(255, 255, 255, 0.05) 40%,
|
||||
transparent 62%
|
||||
);
|
||||
}
|
||||
|
||||
.ai-featured-routes__card > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ai-featured-routes__card:hover {
|
||||
@ -3250,7 +3292,11 @@ body.command-home .ai-featured-routes__card {
|
||||
|
||||
/* 奇数:正梯形 · 亮 */
|
||||
.ai-intent-ribbon__item:nth-child(odd) .ai-intent-ribbon__face {
|
||||
background: var(--ai-ribbon-light);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(255, 255, 255, 0.96) 0%,
|
||||
rgba(255, 255, 255, 0.62) 100%
|
||||
);
|
||||
clip-path: polygon(
|
||||
var(--ai-ribbon-cut) 0,
|
||||
calc(100% - var(--ai-ribbon-cut)) 0,
|
||||
@ -3261,7 +3307,11 @@ body.command-home .ai-featured-routes__card {
|
||||
|
||||
/* 偶数:反梯形 · 淡雾 */
|
||||
.ai-intent-ribbon__item:nth-child(even) .ai-intent-ribbon__face {
|
||||
background: var(--ai-ribbon-soft);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(255, 255, 255, 0.84) 0%,
|
||||
color-mix(in srgb, #d8e4ef 46%, rgba(255, 255, 255, 0.5)) 100%
|
||||
);
|
||||
clip-path: polygon(
|
||||
0 0,
|
||||
100% 0,
|
||||
@ -3547,7 +3597,7 @@ body.command-home .ai-featured-routes__card {
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ai-welcome-plane img,
|
||||
.ai-welcome-airstrip,
|
||||
.ai-welcome-compose-panel,
|
||||
.ai-ask,
|
||||
.ai-welcome-trustline,
|
||||
.ai-intent-section,
|
||||
.ai-trust-bar {
|
||||
@ -3579,15 +3629,19 @@ body.command-home .ai-featured-routes__card {
|
||||
height: 42px;
|
||||
}
|
||||
|
||||
body.command-home .ai-welcome-compose-panel {
|
||||
body.command-home .ai-ask {
|
||||
padding: 12px 14px 10px;
|
||||
border-radius: 18px;
|
||||
box-shadow: none;
|
||||
border-radius: 16px;
|
||||
}
|
||||
|
||||
body.command-home .ai-welcome-compose-panel .ai-welcome-cta-link {
|
||||
top: 12px;
|
||||
right: 14px;
|
||||
body.command-home .ai-ask__dest {
|
||||
min-height: 30px;
|
||||
padding: 0 12px;
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
body.command-home .ai-ask__hint {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
body.command-home .ai-home-dests {
|
||||
@ -4585,7 +4639,7 @@ body.command-home .ai-welcome-compose__lead {
|
||||
padding: 0 14px;
|
||||
border-radius: var(--ai-chip-radius, 999px);
|
||||
border: 1px solid rgba(18, 24, 32, 0.06);
|
||||
background: rgba(255, 255, 255, 0.55);
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
box-shadow: none;
|
||||
color: var(--ai-text-2);
|
||||
font-size: 0.84rem;
|
||||
@ -4628,40 +4682,33 @@ body.command-home .ai-welcome-compose__lead {
|
||||
color: var(--ai-text-3);
|
||||
}
|
||||
|
||||
/* Welcome input — soft inner field, no heavy nested drop shadow */
|
||||
/* 输入框不再铺第二层白,点阵跟提问卡、线路卡是同一层 */
|
||||
.ai-composer-slot--welcome .ai-composer {
|
||||
min-height: 56px;
|
||||
padding: 12px 12px 12px 18px;
|
||||
border-radius: 16px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.9) !important;
|
||||
border-radius: 14px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.66) !important;
|
||||
outline: none;
|
||||
background: rgba(255, 255, 255, 0.72) !important;
|
||||
backdrop-filter: blur(24px) saturate(170%) !important;
|
||||
-webkit-backdrop-filter: blur(24px) saturate(170%) !important;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.95),
|
||||
inset 0 1px 6px rgba(15, 23, 42, 0.05) !important;
|
||||
background: transparent !important;
|
||||
backdrop-filter: none !important;
|
||||
-webkit-backdrop-filter: none !important;
|
||||
box-shadow: none !important;
|
||||
transition:
|
||||
background 0.18s var(--ai-ease),
|
||||
box-shadow 0.18s var(--ai-ease),
|
||||
border-color 0.18s var(--ai-ease);
|
||||
border-color 0.18s var(--ai-ease),
|
||||
box-shadow 0.18s var(--ai-ease);
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer::before,
|
||||
.ai-composer-slot--welcome .ai-composer::after {
|
||||
content: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer:focus-within {
|
||||
border-color: rgba(2, 62, 138, 0.28) !important;
|
||||
border-color: rgba(255, 255, 255, 0.9) !important;
|
||||
outline: none;
|
||||
background: rgba(255, 255, 255, 0.88) !important;
|
||||
backdrop-filter: blur(28px) saturate(180%) !important;
|
||||
-webkit-backdrop-filter: blur(28px) saturate(180%) !important;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 1),
|
||||
inset 0 1px 6px rgba(15, 23, 42, 0.06),
|
||||
0 0 0 3px rgba(2, 62, 138, 0.08) !important;
|
||||
background: transparent !important;
|
||||
box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.08) !important;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-input {
|
||||
@ -4672,27 +4719,14 @@ body.command-home .ai-welcome-compose__lead {
|
||||
color: var(--ai-text-3, #66707d);
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
font-size: 1.1rem;
|
||||
box-shadow: none;
|
||||
background: var(--ai-brand, #023e8a);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send i {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send:hover:not(:disabled):not(.is-empty) {
|
||||
background: var(--ai-brand-hover, #012a74);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ai-composer-slot--welcome .ai-composer-send,
|
||||
.ai-composer-slot--welcome .ai-composer-send:hover:not(:disabled):not(.is-empty),
|
||||
.ai-composer-slot--welcome .ai-composer-send.is-empty {
|
||||
background: color-mix(in srgb, var(--ai-brand, #023e8a) 42%, #c5d0db);
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 999px;
|
||||
box-shadow: none;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.ai-composer-dock {
|
||||
@ -4838,38 +4872,44 @@ body.command-home .ai-welcome-compose__lead {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
background: var(--ai-action);
|
||||
border-radius: 999px;
|
||||
background: #0d0d0d;
|
||||
color: #fff;
|
||||
font-size: 1.35rem;
|
||||
box-shadow: 0 0 0 4px var(--ai-bg);
|
||||
box-shadow: none;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s var(--ai-ease), transform 0.15s var(--ai-ease);
|
||||
transition: background 0.15s var(--ai-ease);
|
||||
}
|
||||
|
||||
.ai-composer-send i {
|
||||
font-size: 1.2rem;
|
||||
line-height: 1;
|
||||
.ai-composer-send__mark {
|
||||
display: block;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
fill: none;
|
||||
stroke: currentColor;
|
||||
stroke-width: 2.25;
|
||||
stroke-linecap: round;
|
||||
stroke-linejoin: round;
|
||||
}
|
||||
|
||||
.ai-composer-send.is-empty {
|
||||
background: color-mix(in srgb, var(--ai-text-3) 18%, #e9edf0);
|
||||
color: color-mix(in srgb, var(--ai-text-3) 70%, #fff);
|
||||
.ai-composer-send.is-empty,
|
||||
.ai-composer-send.is-empty:hover {
|
||||
background: #ececec;
|
||||
color: #9a9a9a;
|
||||
cursor: default;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.ai-composer-send.is-empty:hover {
|
||||
background: color-mix(in srgb, var(--ai-text-3) 18%, #e9edf0);
|
||||
.ai-composer-send:hover:not(:disabled):not(.is-empty) {
|
||||
background: #2f2f2f;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.ai-composer-send:hover:not(:disabled):not(.is-empty) {
|
||||
background: var(--ai-action-hover);
|
||||
transform: translateY(-1px);
|
||||
.ai-composer-send:focus-visible {
|
||||
outline: 2px solid #0d0d0d;
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.ai-composer-send:disabled {
|
||||
@ -5337,69 +5377,31 @@ body.command-home .ai-welcome-compose__lead {
|
||||
padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel {
|
||||
.ai-ask {
|
||||
padding: 14px 14px 12px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel .ai-welcome-cta-link {
|
||||
position: static;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
margin: 0 0 10px;
|
||||
padding: 0 14px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid color-mix(in srgb, var(--ai-accent, #e96a26) 28%, #fff);
|
||||
background: color-mix(in srgb, var(--ai-accent, #e96a26) 12%, #fff);
|
||||
color: var(--ai-accent, #e96a26);
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
text-decoration: none;
|
||||
box-shadow: 0 1px 2px rgba(233, 106, 38, 0.08);
|
||||
.ai-ask__bar {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel .ai-welcome-cta-link:hover,
|
||||
.ai-welcome-compose-panel .ai-welcome-cta-link:focus {
|
||||
color: #fff;
|
||||
background: var(--ai-accent, #e96a26);
|
||||
border-color: var(--ai-accent, #e96a26);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.ai-welcome-compose-panel .ai-welcome-compose__lead {
|
||||
padding-right: 0;
|
||||
padding-top: 0;
|
||||
margin-bottom: 10px;
|
||||
font-size: 0.92rem;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.ai-home-dests {
|
||||
display: flex;
|
||||
.ai-ask__dests {
|
||||
flex: 1;
|
||||
flex-wrap: nowrap;
|
||||
gap: 8px;
|
||||
margin-bottom: 10px;
|
||||
overflow-x: auto;
|
||||
padding-bottom: 2px;
|
||||
scrollbar-width: none;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
touch-action: pan-x;
|
||||
mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 20px), transparent 100%);
|
||||
-webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 20px), transparent 100%);
|
||||
}
|
||||
|
||||
.ai-home-dests::-webkit-scrollbar {
|
||||
.ai-ask__dests::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ai-home-dest {
|
||||
.ai-ask__dest {
|
||||
flex: 0 0 auto;
|
||||
min-height: 40px;
|
||||
padding: 0 14px;
|
||||
font-size: 0.88rem;
|
||||
}
|
||||
|
||||
.ai-welcome-sub {
|
||||
@ -5428,9 +5430,10 @@ body.command-home .ai-welcome-compose__lead {
|
||||
font-size: 16px; /* iOS 避免自动放大 */
|
||||
}
|
||||
|
||||
.ai-composer-send {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
.ai-composer-send,
|
||||
.ai-composer-slot--welcome .ai-composer-send {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.ai-composer-dock {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user