2026120301 #35

Merged
zzh merged 3 commits from test into master 2026-12-03 16:41:48 +08:00
23 changed files with 903 additions and 248 deletions

View File

@ -11,9 +11,11 @@ alwaysApply: true
## 关键规则速查 ## 关键规则速查
### 布局 ### 布局
- 页面容器使用 `[class$='-container']` 或 `xxx-container`,padding 用 `var(--app-page-padding)`(上 8 / 左右底 16;列表壳可用 `--app-page-padding-list`) - 页面容器使用 `[class$='-container']` 或 `xxx-container`,padding 用 `var(--app-page-padding)`(上 8 / 左右底 16;列表壳可用 `--app-page-padding-list`;窄屏由全局自动收紧 x/底)
- 主背景 `#f0f3f4`,内容区 `#fff` - 主背景 `#f0f3f4`,内容区 `#fff`
- 工具栏:`table-toolbar` + `toolbar-left` + `toolbar-right` - 工具栏:`table-toolbar` + `toolbar-left` + `toolbar-right`(窄屏可换行)
- 响应式:断点用 `@screen-*` / `APP_BREAKPOINTS`(与 `--app-bp-*` 同步);按 CSS 视口适配,禁止用 `devicePixelRatio` 改 zoom 反缩放
- 营销宽上限:`var(--app-content-max)`;列表页不要套。平台类 `html.platform-mac` 只修滚动条等,不改布局比例
### 色彩 ### 色彩
- 使用 `var(--app-primary-color)`,不硬编码 `#1d7281`(默认主色) - 使用 `var(--app-primary-color)`,不硬编码 `#1d7281`(默认主色)

View File

@ -108,23 +108,56 @@ Vite / esbuild 构建时若对象字面量出现重复键,会报错并导致
### 页面路由与 Vite 代理(硬刷新 / 直链) ### 页面路由与 Vite 代理(硬刷新 / 直链)
部分模块的**页面 path** 与后端 API 共用同一代理前缀(如 `/channel`、`/marketing`、`/finance`)。开发模式下地址栏回车、F5、外链直开时,请求会先走 Vite `server.proxy`;若未把 SPA 路径 bypass 掉,会打到后端并得到空白页 / 404。 部分模块的**页面 path** 与后端 API 共用同一代理前缀(如 `/channel`、`/system`)。开发模式下 F5 / 直链若未回退 `index.html`,会被 proxy 打到后端 → 整页空白 404。
新增与 API 同前缀的前端页面时,必须同步改 `vite.config.ts`: **约定(勿再往 `vite.config.ts` 手工加 SPA 白名单):**
1. **对应前缀的 `proxy.*.bypass` 白名单**(如 `/channel` 的 `channelSpaPrefixes`)加入页面 path,返回 `'/index.html'` 1. 路由写入 `src/router/routes/newModules/*.ts` 或 `src/router/index.ts`(path 用 **camelCase**)
2. **插件 `exclude-frontend-routes-from-proxy` 的 `frontendRoutes`(或 `frontendRoutesExact`)** 同样加入该 path 2. 开发服务器用 `config/devSpaRoutes.ts` **从 Router 自动收集**页面 path(精确匹配;`/h5` 与 `/h5/**` 一律 SPA 回退)
3. 改完 router 后若 Vite 未热更,重启一次 `pnpm dev`
约定: ### 响应式与跨端对齐(全局)
- 页面 path 用**驼峰**(如 `/channel/pricingWorkbench`) Mac / Windows 浏览器都显示「100%」时,观感仍可能不同:差异主要来自**系统 DPI**(Win 常 125%/150%)与 **CSS 视口宽度**(`innerWidth`),不是两套页面。适配与验收一律按**逻辑像素**,不要追求物理厘米或字体锐利度一致。
- 后端 API 尽量用 **kebab-case**(如 `/channel/pricing-workbench/preview`),避免与 SPA 前缀冲突
- 改完 `vite.config.ts` 后需**重启** `pnpm dev` 才生效
渠道现有 SPA bypass 示例:`salesProducts`、`serviceChannels`、`pricingWorkbench`、`guide` 等(完整列表见 `vite.config.ts`)。 完整约定见 [`docs/前端页面设计规范.md`](docs/前端页面设计规范.md) **§2.4**。摘要如下:
| 原则 | 说明 |
|------|------|
| 尺子 | 只用 CSS 视口:`window.innerWidth` / `@media (max-width)` |
| 禁止 | **禁止**用 `devicePixelRatio` 改 `zoom` / `html` 字号「抵消」系统缩放 |
| 平台类 | `html.platform-mac` 只修滚动条等引擎差异,**不**改布局比例 |
| 分表面 | **中后台**:控件高度锁 px,窄屏收 padding、工具栏可换行。**官网**:可用 `clamp` / 多档改版。**H5**:继续 `--h5-*` |
**断点三处必须同步**(改一处要改齐):
| 位置 | 符号 |
|------|------|
| `src/assets/style/breakpoint.less` | `@screen-xs` … `@screen-xxl` |
| `src/assets/style/global.less` | `--app-bp-*` |
| `src/constants/breakpoints.ts` | `APP_BREAKPOINTS`(供 JS / `useResponsive`) |
常用档:`480 / 576 / 768 / 992 / 1200 / 1600`;中后台主降级点 **992**(对齐 Arco)。
**全局 Token(`global.less` `:root`):**
- 字号:`--app-font-base`(14px,挂在 `body`)、`--app-font-sm`(12px);**不**改 `html` 根 rem(官网大量 rem 按 16px 设计)
- 间距:`--app-space-1`~`5` → `4 / 8 / 12 / 16 / 24`;按钮间距 `--app-button-gap`
- 营销/宽内容上限:`--app-content-max`(1200px);**列表页不要套** `max-width: var(--app-content-max)`
- 页面壳:`--app-page-padding` / `--app-page-padding-list`;`<992` / `<768` 由全局自动收紧左右与底边距
**新代码约定:**
- 新 `@media` 用 `@screen-*` 或 `APP_BREAKPOINTS`,勿散落魔法数
- 间距优先 `var(--app-space-*)`;主题色用 `var(--app-primary-color)`
- 官网内容宽接 `var(--app-content-max)` / `--ai-content-max`
- Mac/Win 对比:两边调到接近的 `innerWidth` 再比布局(建议 `1440 / 1280 / 768 / 390`,外加矮屏 `1280×720`)
页面布局、组件、表格等其余规范仍以 [`docs/前端页面设计规范.md`](docs/前端页面设计规范.md) 为准;Cursor 规则见 `.cursor/rules/frontend-design-spec.mdc`。
## 部署说明 ## 部署说明
1. 安装依赖 `pnpm i` 1. 安装依赖 `pnpm i`
2. 构建 `pnpm build`(生成 `dist/`) 2. 构建 `pnpm build`(生成 `dist/`)
3. **k3s(推荐)**:`Dockerfile.k3s` 多阶段构建,容器内用 `serve` 提供静态 SPA(`:80`);**HTTPS 由 Traefik `websecure` + cert-manager(Let's Encrypt)终结**,经 Ingress(tls) → Service,不在前端容器内挂证书。 3. **k3s(推荐)**:`Dockerfile.k3s` 多阶段构建,容器内用 `serve` 提供静态 SPA(`:80`);**HTTPS 由 Traefik `websecure` + cert-manager(Let's Encrypt)终结**,经 Ingress(tls) → Service,不在前端容器内挂证书。

View File

@ -83,17 +83,37 @@ a-layout (垂直)
- **分页位置(必选)**:所有列表的分页组件统一放在**紧邻列表上方**工具栏的**右侧**(即相对列表区域的**右上角**),见「七、7.3 分页」;不得放在表格下方或列表底部 - **分页位置(必选)**:所有列表的分页组件统一放在**紧邻列表上方**工具栏的**右侧**(即相对列表区域的**右上角**),见「七、7.3 分页」;不得放在表格下方或列表底部
- 使用 `a-space :size="8"` 或 `display: flex; gap: 8px` 控制按钮间距 - 使用 `a-space :size="8"` 或 `display: flex; gap: 8px` 控制按钮间距
### 2.4 响应式断点(Less) ### 2.4 响应式断点与跨端对齐(全局)
断点数值三处必须一致:`src/assets/style/breakpoint.less`(`@screen-*`)、`src/assets/style/global.less`(`--app-bp-*`)、`src/constants/breakpoints.ts`(`APP_BREAKPOINTS`)。
```less ```less
@screen-xs: 480px; // 手机 @screen-xs: 480px; // 手机
@screen-sm: 576px; // 平板 @screen-sm: 576px; // 平板
@screen-md: 768px; // 小屏 @screen-md: 768px; // 小屏
@screen-lg: 992px; // 桌面 @screen-lg: 992px; // 桌面(中后台主降级点;对齐 Arco / useResponsive)
@screen-xl: 1200px; // 大屏 @screen-xl: 1200px; // 大屏 / 营销内容宽参考
@screen-xxl: 1600px; // 超大屏 @screen-xxl: 1600px; // 超大屏
``` ```
#### 2.4.1 适配原则(官网 / 中后台 / H5 共用)
| 原则 | 说明 |
|------|------|
| 尺子 | 只用 **CSS 逻辑视口**(`window.innerWidth` / `@media (max-width)`)。浏览器显示「100%」≠ 系统 DPI 100%。 |
| 禁止 | **禁止**用 `devicePixelRatio` 改 `zoom` / `html` 字号「抵消」Windows 125%/150% 或 Retina。 |
| 平台类 | `html.platform-mac` 仅处理滚动条、字体等引擎差异,**不**改布局比例。 |
| Token | 间距/字号语义用 `--app-space-*`、`--app-font-base`;营销宽上限用 `--app-content-max`(列表页不要套)。 |
| 分表面 | **中后台**:控件高度锁定 px(按钮 32 等),窄屏收 padding、工具栏换行。**官网**:可 `clamp` / 多档改版。**H5**:继续 `--h5-*`,手机优先。 |
#### 2.4.2 窄屏页面壳(已全局生效)
`global.less` 在 `<992px` / `<768px` 自动收紧 `--app-page-padding-x` 等;门户壳同步收 `--portal-panel-inset`。业务页继续写 `padding: var(--app-page-padding)` 即可吃到收敛。
#### 2.4.3 验收对齐
Mac / Windows 对比时,把两边窗口调到接近的 `innerWidth`(如 1440 / 1280 / 768)再比布局;不要比物理厘米或字体锐利度。最低建议矩阵:`1440×900`、`1280×800`、`768×1024`、`390×844`,外加矮屏 `1280×720`。
### 2.5 页面壳、白卡片与列表区尺寸(列表 / Handsontable 类页面) ### 2.5 页面壳、白卡片与列表区尺寸(列表 / Handsontable 类页面)
以下约定与 `default-layout` + `page-layout`、`*-container` / `*-page` 等实现一致,避免「灰底大块留白、列表高度塌缩、内外边距叠成 32px/40px」等问题。 以下约定与 `default-layout` + `page-layout`、`*-container` / `*-page` 等实现一致,避免「灰底大块留白、列表高度塌缩、内外边距叠成 32px/40px」等问题。
@ -198,10 +218,12 @@ font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
### 4.2 字号与行高 ### 4.2 字号与行高
- 全局基准字号:`14px` - 全局基准字号:`14px`(`body` / `var(--app-font-base)`;**不**改 `html` 根 rem,避免官网 rem 版心被整体缩小)
- 次要/紧凑:`12px`(`var(--app-font-sm)`)
- 表单、按钮、输入框:`14px` - 表单、按钮、输入框:`14px`
- 日期选择器、部分紧凑区域:`12px`(如 `.notice` 内) - 日期选择器、部分紧凑区域:`12px`(如 `.notice` 内)
- 菜单文字:`12px`,`font-weight: bold` - 菜单文字:`12px`,`font-weight: bold`
- 间距阶梯:`--app-space-1`~`5` → `4 / 8 / 12 / 16 / 24`(与 `--app-button-gap` 的 8px 对齐)
--- ---
@ -557,7 +579,9 @@ const { t } = useI18n();
- [ ] 使用 `xxx-container` / `xxx-page` 或等效布局结构;列表页见 **§2.5**:灰底 **`padding: var(--app-page-padding-list)`**、`flex: 1; min-height: 0` - [ ] 使用 `xxx-container` / `xxx-page` 或等效布局结构;列表页见 **§2.5**:灰底 **`padding: var(--app-page-padding-list)`**、`flex: 1; min-height: 0`
- [ ] 白卡片与 **`.list-wrap`** 内边距勿重复叠加(推荐白卡片 `padding: 0` + 分区 padding) - [ ] 白卡片与 **`.list-wrap`** 内边距勿重复叠加(推荐白卡片 `padding: 0` + 分区 padding)
- [ ] **`.list-wrap`**:`padding: 16px`、`flex: 1; min-height: 0`;需测高时 `ref` 挂在本层 - [ ] **`.list-wrap`**:`padding: 16px`、`flex: 1; min-height: 0`;需测高时 `ref` 挂在本层
- [ ] 工具栏使用 `table-toolbar`、`toolbar-left`、`toolbar-right`,工具栏 **`padding: 16px 16px 0`** - [ ] 工具栏使用 `table-toolbar`、`toolbar-left`、`toolbar-right`,工具栏 **`padding: 16px 16px 0`**;窄屏允许换行,勿写死单行不换
- [ ] 断点只用 `@screen-*` / `APP_BREAKPOINTS`;未按 `devicePixelRatio` 做 zoom 反缩放(**§2.4**)
- [ ] 营销/宽内容页可用 `var(--app-content-max)`;列表页不要套内容 max-width
- [ ] 按钮、输入框符合全局样式(高度、圆角);未使用 `type="outline"` 描边按钮 - [ ] 按钮、输入框符合全局样式(高度、圆角);未使用 `type="outline"` 描边按钮
- [ ] 使用主题色变量,不硬编码 `#1d7281` - [ ] 使用主题色变量,不硬编码 `#1d7281`
- [ ] 弹窗 / 抽屉使用 ModalPro / DrawerPro + useModal - [ ] 弹窗 / 抽屉使用 ModalPro / DrawerPro + useModal

View File

@ -70,6 +70,10 @@
*/ */
function portalViewKey(r: RouteLocationNormalizedLoaded) { function portalViewKey(r: RouteLocationNormalizedLoaded) {
const path = String(r.path || ''); const path = String(r.path || '');
// PC 登录互切同壳复用,避免虹膜整页 remount(角色/gsap 反复装卸最忙)
if (path === '/login' || path === '/admin' || path === '/agent') {
return 'oms-pc-login';
}
if (isStandalonePortalPath(path) || isLoginPath(path)) { if (isStandalonePortalPath(path) || isLoginPath(path)) {
const top = r.matched[0]; const top = r.matched[0];
return String(top?.name || r.name || path); return String(top?.name || r.name || path);

View File

@ -1,4 +1,6 @@
// ==============breakpoint============ // ============== breakpoint ============
// 与 src/constants/breakpoints.ts、global.less --app-bp-* 同步。
// @media 只能用这里的 Less 变量;不要写 devicePixelRatio / 系统缩放分支。
// Extra small screen / phone // Extra small screen / phone
@screen-xs: 480px; @screen-xs: 480px;
@ -9,10 +11,10 @@
// Medium screen / desktop // Medium screen / desktop
@screen-md: 768px; @screen-md: 768px;
// Large screen / wide desktop // Large screen / wide desktop(中后台主降级点;对齐 Arco / useResponsive)
@screen-lg: 992px; @screen-lg: 992px;
// Extra large screen / full hd // Extra large screen / full hd(亦作营销内容宽上限参考)
@screen-xl: 1200px; @screen-xl: 1200px;
// Extra extra large screen / large desktop // Extra extra large screen / large desktop

View File

@ -24,13 +24,35 @@
var(--app-page-bg, #f0f3f4) 220px, var(--app-page-bg, #f0f3f4) 220px,
var(--app-page-bg, #f0f3f4) 100% var(--app-page-bg, #f0f3f4) 100%
); );
/* 透明顶栏后:页面根容器上边距收紧,左右/底仍 16 */ /* 透明顶栏后:页面根容器上边距收紧,左右/底仍 16;窄屏由下方 @media 只改分量 */
--app-page-padding-top: 8px; --app-page-padding-top: 8px;
--app-page-padding-x: 16px; --app-page-padding-x: 16px;
--app-page-padding-bottom: 16px; --app-page-padding-bottom: 16px;
--app-page-padding-list-bottom: 16px;
--app-page-padding: var(--app-page-padding-top) var(--app-page-padding-x) --app-page-padding: var(--app-page-padding-top) var(--app-page-padding-x)
var(--app-page-padding-bottom); var(--app-page-padding-bottom);
--app-page-padding-list: var(--app-page-padding-top) var(--app-page-padding-x) 16px; --app-page-padding-list: var(--app-page-padding-top) var(--app-page-padding-x)
var(--app-page-padding-list-bottom);
/*
* 字号 / 间距阶梯(跨官网、中后台、H5 共用语义)。
* 中后台控件高度仍按规范锁定 px(按钮 32 等),勿用 vw/DPR 整站缩放。
*/
--app-font-base: 14px;
--app-font-sm: 12px;
--app-space-1: 4px;
--app-space-2: 8px;
--app-space-3: 12px;
--app-space-4: 16px;
--app-space-5: 24px;
/* 营销/宽内容页上限;列表壳不要套 max-width: var(--app-content-max) */
--app-content-max: 1200px;
/* 断点镜像(文档 / JS / 内联);@media 请用 breakpoint.less @screen-* */
--app-bp-xs: 480px;
--app-bp-sm: 576px;
--app-bp-md: 768px;
--app-bp-lg: 992px;
--app-bp-xl: 1200px;
--app-bp-xxl: 1600px;
--app-card-bg: #ffffff; --app-card-bg: #ffffff;
/* 块级外壳不要描边,靠底色/圆角区分层次 */ /* 块级外壳不要描边,靠底色/圆角区分层次 */
--app-card-border: transparent; --app-card-border: transparent;
@ -44,7 +66,7 @@
--app-acrylic-border: rgba(255, 255, 255, 0.72); --app-acrylic-border: rgba(255, 255, 255, 0.72);
--app-acrylic-border-strong: rgba(255, 255, 255, 0.92); --app-acrylic-border-strong: rgba(255, 255, 255, 0.92);
--app-acrylic-blur: blur(28px) saturate(160%); --app-acrylic-blur: blur(28px) saturate(160%);
--app-button-gap: 8px; /* 相邻按钮间距,规范统一 */ --app-button-gap: var(--app-space-2, 8px); /* 相邻按钮间距,规范统一 */
/* 同步 Arco Design 主色(rgb 分量) */ /* 同步 Arco Design 主色(rgb 分量) */
--primary-6: 5, 79, 116; --primary-6: 5, 79, 116;
--primary-5: 38, 103, 134; --primary-5: 38, 103, 134;
@ -56,7 +78,11 @@
box-sizing: border-box; box-sizing: border-box;
} }
/* 使用 SimpleAdmin 的字体栈,移除自定义 @font-face,避免字体加载失败导致方块 */ /*
* 字体栈跨平台回退;不改 html 根 rem(官网大量 rem 按 16px 设计)。
* 业务默认继承 body 的 --app-font-base。
* 禁止用 devicePixelRatio 改 zoom / font-size「抵消」系统缩放。
*/
html, html,
body { body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
@ -65,6 +91,50 @@ body {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
body {
font-size: var(--app-font-base, 14px);
}
/* 窄视口:只收紧页面壳留白,不缩放控件高度 */
@media (max-width: 991px) {
:root {
--app-page-padding-x: 12px;
--app-page-padding-bottom: 12px;
--app-page-padding-list-bottom: 12px;
}
}
@media (max-width: 767px) {
:root {
--app-page-padding-x: 8px;
--app-page-padding-bottom: 8px;
--app-page-padding-list-bottom: 8px;
}
}
/*
* 全局工具栏:未单独写样式的页面也能换行,避免 Win 125% 等效窄宽时挤爆。
* 页面已有 .table-toolbar 规则时,此处作增强(gap / min-width),不改其 padding 约定。
*/
.table-toolbar,
.list-toolbar {
min-width: 0;
max-width: 100%;
.toolbar-left,
.toolbar-right {
min-width: 0;
}
}
@media (max-width: 991px) {
.table-toolbar,
.list-toolbar {
flex-wrap: wrap;
row-gap: var(--app-space-2, 8px);
}
}
/* 全局空态:未配置吉祥物时不占位;有配置才显示图片 */ /* 全局空态:未配置吉祥物时不占位;有配置才显示图片 */
.arco-empty-image { .arco-empty-image {
.arco-icon { .arco-icon {

View File

@ -0,0 +1,41 @@
/**
* 全局响应式断点(CSS 像素 / 逻辑视口)。
* 必须与 `src/assets/style/breakpoint.less` 的 `@screen-*`、
* `global.less` 的 `--app-bp-*` 保持同一组数值。
*
* 适配与验收一律按 window.innerWidth(CSS px),
* 不要用 devicePixelRatio / 系统 DPI 去反缩放页面。
*/
export const APP_BREAKPOINTS = {
/** 手机 */
xs: 480,
/** 大手机 / 小平板 */
sm: 576,
/** 平板 / 窄屏桌面 */
md: 768,
/** 桌面(与 Arco Grid、useResponsive 一致) */
lg: 992,
/** 大屏 / 营销内容上限参考 */
xl: 1200,
/** 超大屏 */
xxl: 1600,
} as const;
export type AppBreakpoint = keyof typeof APP_BREAKPOINTS;
/** max-width 媒体查询字符串,如 `(max-width: 991px)` */
export function maxWidthQuery(bp: AppBreakpoint): string {
return `(max-width: ${APP_BREAKPOINTS[bp] - 1}px)`;
}
/** min-width 媒体查询字符串,如 `(min-width: 992px)` */
export function minWidthQuery(bp: AppBreakpoint): string {
return `(min-width: ${APP_BREAKPOINTS[bp]}px)`;
}
export function matchMaxWidth(bp: AppBreakpoint): boolean {
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') {
return false;
}
return window.matchMedia(maxWidthQuery(bp)).matches;
}

View File

@ -1,9 +1,11 @@
import { onMounted, onBeforeMount, onBeforeUnmount } from 'vue'; import { onMounted, onBeforeMount, onBeforeUnmount } from 'vue';
import { useDebounceFn } from '@vueuse/core'; import { useDebounceFn } from '@vueuse/core';
import { APP_BREAKPOINTS } from '@/constants/breakpoints';
import { useAppStore } from '@/store'; import { useAppStore } from '@/store';
import { addEventListen, removeEventListen } from '@/utils/event'; import { addEventListen, removeEventListen } from '@/utils/event';
const WIDTH = 992; // https://arco.design/vue/component/grid#responsivevalue /** 与 @screen-lg / --app-bp-lg 一致;https://arco.design/vue/component/grid#responsivevalue */
const WIDTH = APP_BREAKPOINTS.lg;
function queryDevice() { function queryDevice() {
const rect = document.body.getBoundingClientRect(); const rect = document.body.getBoundingClientRect();

View File

@ -109,7 +109,9 @@
.layout { .layout {
width: 100%; width: 100%;
max-width: 100%;
height: 100vh; height: 100vh;
min-height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: var(--app-page-bg, #f0f3f4); background: var(--app-page-bg, #f0f3f4);
@ -213,4 +215,22 @@
padding: 0 !important; padding: 0 !important;
} }
} }
/* 窄视口:门户 inset 与全局 --app-page-padding-x 同档收敛 */
@media (max-width: 991px) {
.layout-content--customer {
--portal-panel-inset: 12px;
}
.layout-content--customer .portal-tab-nav {
gap: var(--app-space-2, 8px);
padding-right: 8px;
}
}
@media (max-width: 767px) {
.layout-content--customer {
--portal-panel-inset: 8px;
}
}
</style> </style>

View File

@ -7,6 +7,8 @@
* - sessionStorage `oms_force_desktop` / `oms_force_h5`:同会话记忆 * - sessionStorage `oms_force_desktop` / `oms_force_h5`:同会话记忆
*/ */
import { matchMaxWidth } from '@/constants/breakpoints';
const FORCE_DESKTOP_KEY = 'oms_force_desktop'; const FORCE_DESKTOP_KEY = 'oms_force_desktop';
const FORCE_H5_KEY = 'oms_force_h5'; const FORCE_H5_KEY = 'oms_force_h5';
@ -121,9 +123,9 @@ export function preferH5Portal(): boolean {
const ua = navigator.userAgent || ''; const ua = navigator.userAgent || '';
if (isWeChatBrowser(ua) || isMobileUserAgent(ua)) return true; if (isWeChatBrowser(ua) || isMobileUserAgent(ua)) return true;
// 窄屏兜底(部分内嵌 WebView UA 不标准) // 窄屏兜底(部分内嵌 WebView UA 不标准);断点与 APP_BREAKPOINTS.md 同步
try { try {
if (window.matchMedia('(max-width: 768px)').matches) return true; if (matchMaxWidth('md')) return true;
} catch { } catch {
// ignore // ignore
} }

View File

@ -59,15 +59,23 @@ function portalRouteName(name: PortalRouteLike['name']) {
return name ? String(name) : ''; return name ? String(name) : '';
} }
const isPcLoginName = (name: string) =>
name === 'login' || name === 'adminLogin' || name === 'agentLogin';
/** /**
* 是否走中心展开:已武装的翻页、官网进登录、客户登录与管理登录互切。 * 是否走中心展开:已武装的翻页、官网进登录、登录回官网。
* 客户/管理/代理登录互切改为同壳更新(见 App portalViewKey=oms-pc-login),不走虹膜重挂。
* 只读标记,不消费;真正消费仍在 App 的导航守卫里。 * 只读标记,不消费;真正消费仍在 App 的导航守卫里。
*/ */
export function shouldPortalIris(to: PortalRouteLike, from: PortalRouteLike): boolean { export function shouldPortalIris(to: PortalRouteLike, from: PortalRouteLike): boolean {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return false; if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return false;
if (pageFlipOnce) return true;
const fromName = portalRouteName(from.name); const fromName = portalRouteName(from.name);
const toName = portalRouteName(to.name); const toName = portalRouteName(to.name);
// 登录互切优先:即使 click 武装了 flip 也不虹膜,避免整页卸载再挂显得很忙
if (isPcLoginName(fromName) && isPcLoginName(toName) && fromName !== toName) {
return false;
}
if (pageFlipOnce) return true;
if ( if (
fromName === 'siteRoot' && fromName === 'siteRoot' &&
(toName === 'login' || toName === 'H5Login') && (toName === 'login' || toName === 'H5Login') &&
@ -75,13 +83,8 @@ export function shouldPortalIris(to: PortalRouteLike, from: PortalRouteLike): bo
) { ) {
return true; return true;
} }
const isPcLogin = (name: string) => name === 'login' || name === 'adminLogin';
// 客户/管理登录互切
if (isPcLogin(fromName) && isPcLogin(toName) && fromName !== toName) {
return true;
}
// 登录页回官网(与门户切换同一套中心虹膜) // 登录页回官网(与门户切换同一套中心虹膜)
if (isPcLogin(fromName) && toName === 'siteRoot') { if (isPcLoginName(fromName) && toName === 'siteRoot') {
return true; return true;
} }
return false; return false;

View File

@ -28,7 +28,7 @@
--h5-primary-softer: color-mix(in srgb, var(--app-primary-color) 8%, #fff); --h5-primary-softer: color-mix(in srgb, var(--app-primary-color) 8%, #fff);
--h5-safe-bottom: env(safe-area-inset-bottom, 0px); --h5-safe-bottom: env(safe-area-inset-bottom, 0px);
--h5-dock-bottom-inset: max(8px, calc(var(--h5-safe-bottom) - 12px)); --h5-dock-bottom-inset: max(8px, calc(var(--h5-safe-bottom) - 12px));
--h5-dock-side-inset: 16px; --h5-dock-side-inset: var(--app-space-4, 16px);
--h5-dock-height: 68px; --h5-dock-height: 68px;
--h5-dock-radius: calc(var(--h5-dock-height) / 2); --h5-dock-radius: calc(var(--h5-dock-height) / 2);
--h5-dock-offset: calc(var(--h5-dock-height) + var(--h5-dock-bottom-inset) + 6px); --h5-dock-offset: calc(var(--h5-dock-height) + var(--h5-dock-bottom-inset) + 6px);

View File

@ -25,7 +25,7 @@
--h5-safe-bottom: env(safe-area-inset-bottom, 0px); --h5-safe-bottom: env(safe-area-inset-bottom, 0px);
/* 底部 dock:侧边 inset + 胶囊半径与 iPhone 连续圆角同心 */ /* 底部 dock:侧边 inset + 胶囊半径与 iPhone 连续圆角同心 */
--h5-dock-bottom-inset: max(8px, calc(var(--h5-safe-bottom) - 12px)); --h5-dock-bottom-inset: max(8px, calc(var(--h5-safe-bottom) - 12px));
--h5-dock-side-inset: 16px; --h5-dock-side-inset: var(--app-space-4, 16px);
--h5-dock-height: 68px; --h5-dock-height: 68px;
--h5-dock-fab-size: 56px; --h5-dock-fab-size: 56px;
--h5-dock-radius: calc(var(--h5-dock-height) / 2); --h5-dock-radius: calc(var(--h5-dock-height) / 2);

View File

@ -1,25 +1,69 @@
<template> <template>
<div <div
class="login-care-banner" class="login-care-banner"
:class="{ 'is-visible': visible && settingsEnabled }" :class="[
`is-${sky}`,
{
'is-visible': visible && settingsEnabled,
'is-after-hours': afterHours && !holidayId,
'is-holiday': !!holidayId,
},
]"
aria-live="polite" aria-live="polite"
> >
<!-- 角落天空:日出 / 午后 / 日落 / 夜间 -->
<div class="login-care-banner__sky" aria-hidden="true">
<span class="login-care-banner__sky-glow" />
<span class="login-care-banner__sky-band" />
<span class="login-care-banner__sky-core" />
</div>
<div class="login-care-banner__layout">
<div class="login-care-banner__mark" aria-hidden="true">
<icon-sun-fill
v-if="sky === 'sunrise' || sky === 'day'"
class="login-care-banner__icon"
:size="15"
/>
<icon-moon-fill
v-else
class="login-care-banner__icon"
:size="15"
/>
</div>
<div class="login-care-banner__body"> <div class="login-care-banner__body">
<div class="login-care-banner__meta">
<time class="login-care-banner__time" :datetime="clockIso">{{ clockLabel }}</time>
<span v-if="eyebrow" class="login-care-banner__chip">{{ eyebrow }}</span>
</div>
<p class="login-care-banner__greeting">{{ greeting }}</p> <p class="login-care-banner__greeting">{{ greeting }}</p>
<p class="login-care-banner__note">{{ note }}</p> <p class="login-care-banner__note">{{ note }}</p>
</div> </div>
</div> </div>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'; import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { IconMoonFill, IconSunFill } from '@arco-design/web-vue/es/icon';
import { getCarePeriod, getHolidayId, isAfterWorkHours } from '@/utils/admin-login-care'; import { getCarePeriod, getHolidayId, isAfterWorkHours } from '@/utils/admin-login-care';
import { getAdminCareSettings } from '@/utils/admin-care-settings'; import { getAdminCareSettings } from '@/utils/admin-care-settings';
import { isPortalIrisActive } from '@/utils/page-transition-flag'; import { isPortalIrisActive } from '@/utils/page-transition-flag';
defineOptions({ name: 'LoginCareBanner' }); defineOptions({ name: 'LoginCareBanner' });
const props = withDefaults(
defineProps<{
/** admin=运营侧;customer=客户门户,文案与开关分开 */
audience?: 'admin' | 'customer';
}>(),
{ audience: 'admin' },
);
type SkyMood = 'sunrise' | 'day' | 'sunset' | 'night';
const { t } = useI18n(); const { t } = useI18n();
const tick = ref(0); const tick = ref(0);
const visible = ref(false); const visible = ref(false);
@ -27,38 +71,67 @@ const settingsEnabled = ref(true);
let timer: ReturnType<typeof window.setInterval> | null = null; let timer: ReturnType<typeof window.setInterval> | null = null;
let enterTimer: ReturnType<typeof window.setTimeout> | null = null; let enterTimer: ReturnType<typeof window.setTimeout> | null = null;
const period = computed(() => { const isCustomer = computed(() => props.audience === 'customer');
const careNs = computed(() => (isCustomer.value ? 'login.care.customer' : 'login.care'));
const now = computed(() => {
void tick.value; void tick.value;
return getCarePeriod(); return new Date();
}); });
const afterHours = computed(() => { const period = computed(() => getCarePeriod(now.value));
void tick.value; const afterHours = computed(() => isAfterWorkHours(now.value));
return isAfterWorkHours(); const holidayId = computed(() => getHolidayId(now.value));
/** 天空情绪:图标与角落光晕共用 */
const sky = computed<SkyMood>(() => {
if (holidayId.value) return 'night';
if (afterHours.value || period.value === 'lateNight') return 'night';
if (period.value === 'morning') return 'sunrise';
if (period.value === 'evening') return 'sunset';
return 'day';
}); });
const holidayId = computed(() => { const clockLabel = computed(() => {
void tick.value; const d = now.value;
return getHolidayId(); return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
});
const clockIso = computed(() => now.value.toISOString());
const eyebrow = computed(() => {
if (holidayId.value) return t(`${careNs.value}.eyebrow.holiday`);
if (afterHours.value) return t(`${careNs.value}.eyebrow.afterHours`);
return '';
}); });
const greeting = computed(() => { const greeting = computed(() => {
if (holidayId.value) return t(`login.care.holiday.${holidayId.value}`); if (holidayId.value) return t(`${careNs.value}.holiday.${holidayId.value}`);
if (afterHours.value) return t('login.care.afterHoursGreeting'); if (afterHours.value) return t(`${careNs.value}.afterHoursGreeting`);
return t(`login.care.period.${period.value}`); return t(`${careNs.value}.period.${period.value}`);
}); });
const note = computed(() => { const note = computed(() => {
if (holidayId.value) return t(`login.care.holidayNote.${holidayId.value}`); if (holidayId.value) return t(`${careNs.value}.holidayNote.${holidayId.value}`);
if (afterHours.value) return t('login.care.afterHoursNote'); if (afterHours.value) return t(`${careNs.value}.afterHoursNote`);
return t(`login.care.periodNote.${period.value}`); return t(`${careNs.value}.periodNote.${period.value}`);
}); });
onMounted(async () => { function syncSettingsEnabled() {
if (isCustomer.value) {
// 客户侧默认开启,不吃运营本机开关
settingsEnabled.value = true;
return;
}
const s = getAdminCareSettings(); const s = getAdminCareSettings();
settingsEnabled.value = s.careEnabled && s.loginBannerEnabled; settingsEnabled.value = s.careEnabled && s.loginBannerEnabled;
if (!settingsEnabled.value) return; }
await nextTick();
function revealBanner() {
if (enterTimer) {
window.clearTimeout(enterTimer);
enterTimer = null;
}
const reveal = () => { const reveal = () => {
if (isPortalIrisActive()) { if (isPortalIrisActive()) {
enterTimer = window.setTimeout(reveal, 80); enterTimer = window.setTimeout(reveal, 80);
@ -66,10 +139,27 @@ onMounted(async () => {
} }
visible.value = true; visible.value = true;
}; };
enterTimer = window.setTimeout(reveal, 180); enterTimer = window.setTimeout(reveal, 120);
}
watch(
() => props.audience,
() => {
syncSettingsEnabled();
if (settingsEnabled.value && !visible.value) {
revealBanner();
}
},
);
onMounted(async () => {
syncSettingsEnabled();
if (!settingsEnabled.value) return;
await nextTick();
revealBanner();
timer = window.setInterval(() => { timer = window.setInterval(() => {
tick.value += 1; tick.value += 1;
}, 60_000); }, 30_000);
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {
@ -86,62 +176,289 @@ onBeforeUnmount(() => {
<style lang="less" scoped> <style lang="less" scoped>
.login-care-banner { .login-care-banner {
/* 与登录卡片同系:贴合页底 + 单层 inset,无彩斑 */ --care-ink: rgba(15, 23, 42, 0.78);
--care-ink: #1e293b; --care-muted: rgba(100, 116, 139, 0.82);
--care-muted: rgba(71, 85, 105, 0.88); --care-meta: rgba(100, 116, 139, 0.72);
--care-bg: var(--app-page-bg, #f0f3f4); --care-icon: #64748b;
--care-shadow: inset 0 3px 12px rgba(15, 23, 42, 0.1); --care-mark-bg: rgba(255, 255, 255, 0.55);
--care-bg: rgba(255, 255, 255, 0.52);
--care-border: rgba(15, 23, 42, 0.055);
--care-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
/* 天空层变量:各时段覆盖 */
--sky-glow: transparent;
--sky-band: transparent;
--sky-core: transparent;
--sky-glow-pos: 108% -18%;
--sky-band-pos: 92% 8%;
--sky-core-pos: 100% 0%;
position: absolute; position: absolute;
top: calc(16px + env(safe-area-inset-top, 0px)); top: calc(14px + env(safe-area-inset-top, 0px));
right: 20px; right: 16px;
z-index: 40; z-index: 40;
width: min(360px, calc(100vw - 40px)); width: min(288px, calc(100vw - 36px));
padding: 16px 18px; padding: 12px 13px;
border-radius: 20px; border-radius: 12px;
text-align: left; text-align: left;
pointer-events: none; pointer-events: none;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
isolation: isolate; isolation: isolate;
border: none; border: 1px solid var(--care-border);
background: var(--care-bg); background: var(--care-bg);
backdrop-filter: none; backdrop-filter: blur(12px) saturate(125%);
-webkit-backdrop-filter: none; -webkit-backdrop-filter: blur(12px) saturate(125%);
box-shadow: var(--care-shadow); box-shadow: var(--care-shadow);
opacity: 0; opacity: 0;
transform: translate3d(12px, -8px, 0); transform: translate3d(0, -4px, 0);
transform-origin: top right; transform-origin: top right;
transition: transition:
opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
box-shadow 0.3s ease;
&.is-visible { &.is-visible {
opacity: 1; opacity: 0.92;
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
box-shadow: inset 0 4px 14px rgba(15, 23, 42, 0.12); }
/* 日出:暖橙从右上抬起 */
&.is-sunrise {
--care-icon: #ea580c;
--care-mark-bg: rgba(255, 247, 237, 0.72);
--sky-glow: radial-gradient(
circle at var(--sky-glow-pos),
rgba(253, 186, 116, 0.42) 0%,
rgba(254, 215, 170, 0.18) 38%,
transparent 68%
);
--sky-band: radial-gradient(
ellipse 90% 70% at var(--sky-band-pos),
rgba(251, 146, 60, 0.22) 0%,
rgba(253, 224, 171, 0.1) 42%,
transparent 70%
);
--sky-core: radial-gradient(
circle at var(--sky-core-pos),
rgba(255, 237, 213, 0.55) 0%,
rgba(253, 186, 116, 0.2) 28%,
transparent 55%
);
}
/* 午后:清透天蓝 */
&.is-day {
--care-icon: color-mix(in srgb, var(--app-primary-color, #054f74) 75%, #38bdf8);
--care-mark-bg: rgba(240, 249, 255, 0.7);
--sky-glow: radial-gradient(
circle at var(--sky-glow-pos),
rgba(125, 211, 252, 0.28) 0%,
rgba(186, 230, 253, 0.12) 40%,
transparent 68%
);
--sky-band: radial-gradient(
ellipse 85% 65% at var(--sky-band-pos),
rgba(56, 189, 248, 0.14) 0%,
transparent 72%
);
--sky-core: radial-gradient(
circle at var(--sky-core-pos),
rgba(224, 242, 254, 0.5) 0%,
rgba(125, 211, 252, 0.16) 32%,
transparent 58%
);
}
/* 日落:橙 → 玫紫压在天际 */
&.is-sunset {
--care-icon: #c026d3;
--care-mark-bg: rgba(253, 242, 248, 0.72);
--sky-glow: radial-gradient(
circle at var(--sky-glow-pos),
rgba(251, 113, 133, 0.28) 0%,
rgba(192, 132, 252, 0.16) 36%,
transparent 70%
);
--sky-band: radial-gradient(
ellipse 95% 75% at 86% 18%,
rgba(249, 115, 22, 0.26) 0%,
rgba(244, 114, 182, 0.14) 34%,
rgba(167, 139, 250, 0.1) 58%,
transparent 78%
);
--sky-core: radial-gradient(
circle at 100% 4%,
rgba(254, 215, 170, 0.48) 0%,
rgba(251, 113, 133, 0.18) 30%,
transparent 56%
);
}
/* 夜间:靛紫月光 */
&.is-night,
&.is-after-hours {
--care-icon: #64748b;
--care-mark-bg: rgba(241, 245, 249, 0.65);
--sky-glow: radial-gradient(
circle at var(--sky-glow-pos),
rgba(148, 163, 184, 0.28) 0%,
rgba(99, 102, 241, 0.1) 40%,
transparent 70%
);
--sky-band: radial-gradient(
ellipse 80% 70% at 88% 10%,
rgba(51, 65, 85, 0.12) 0%,
rgba(99, 102, 241, 0.08) 45%,
transparent 72%
);
--sky-core: radial-gradient(
circle at 100% 0%,
rgba(226, 232, 240, 0.42) 0%,
rgba(148, 163, 184, 0.14) 28%,
transparent 52%
);
}
&.is-holiday {
--care-icon: #db2777;
--care-mark-bg: rgba(253, 242, 248, 0.72);
--sky-glow: radial-gradient(
circle at var(--sky-glow-pos),
rgba(244, 114, 182, 0.26) 0%,
rgba(251, 113, 133, 0.1) 42%,
transparent 70%
);
--sky-band: radial-gradient(
ellipse 85% 70% at 90% 12%,
rgba(251, 207, 232, 0.28) 0%,
transparent 72%
);
--sky-core: radial-gradient(
circle at 100% 0%,
rgba(252, 231, 243, 0.5) 0%,
rgba(244, 114, 182, 0.16) 30%,
transparent 55%
);
}
}
.login-care-banner__sky {
position: absolute;
inset: 0;
pointer-events: none;
overflow: hidden;
}
.login-care-banner__sky-glow,
.login-care-banner__sky-band,
.login-care-banner__sky-core {
position: absolute;
inset: -20%;
pointer-events: none;
}
.login-care-banner__sky-glow {
background: var(--sky-glow);
}
.login-care-banner__sky-band {
background: var(--sky-band);
opacity: 0.95;
}
.login-care-banner__sky-core {
background: var(--sky-core);
}
.login-care-banner__layout {
position: relative;
z-index: 1;
display: flex;
align-items: flex-start;
gap: 10px;
min-width: 0;
}
.login-care-banner__mark {
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
margin-top: 1px;
border-radius: 9px;
color: var(--care-icon);
background: var(--care-mark-bg);
border: none;
}
.login-care-banner__icon {
display: block;
color: inherit;
/* 只要实心填充,不要描边 */
stroke: none !important;
:deep(svg),
:deep(path),
:deep(circle) {
stroke: none !important;
} }
} }
.login-care-banner__body { .login-care-banner__body {
position: relative; display: flex;
z-index: 1; flex-direction: column;
gap: 3px;
min-width: 0;
flex: 1;
}
.login-care-banner__meta {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
}
.login-care-banner__time {
font-size: 10px;
font-weight: 600;
letter-spacing: 0.06em;
font-variant-numeric: tabular-nums;
line-height: 1.2;
color: var(--care-meta);
}
.login-care-banner__chip {
display: inline-flex;
align-items: center;
max-width: 100%;
padding: 1px 6px;
border-radius: 999px;
font-size: 10px;
font-weight: 500;
line-height: 1.35;
color: var(--care-meta);
background: rgba(15, 23, 42, 0.04);
border: 1px solid rgba(15, 23, 42, 0.05);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.login-care-banner__greeting { .login-care-banner__greeting {
margin: 0 0 6px; margin: 0;
font-size: 18px; font-size: 13px;
font-weight: 700; font-weight: 600;
letter-spacing: 0.01em; letter-spacing: -0.01em;
line-height: 1.35; line-height: 1.35;
color: var(--care-ink); color: var(--care-ink);
} }
.login-care-banner__note { .login-care-banner__note {
margin: 0; margin: 0;
font-size: 12px; font-size: 11px;
line-height: 1.55; font-weight: 400;
line-height: 1.45;
color: var(--care-muted); color: var(--care-muted);
} }
@ -154,7 +471,7 @@ onBeforeUnmount(() => {
transform-origin: top center; transform-origin: top center;
&:not(.is-visible) { &:not(.is-visible) {
transform: translate3d(0, -8px, 0); transform: translate3d(0, -6px, 0);
} }
} }
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="login-characters"> <div class="login-characters" :class="{ 'is-appear': appear }">
<div <div
ref="containerRef" ref="containerRef"
class="login-characters__stage" class="login-characters__stage"
@ -72,6 +72,14 @@ import { useLoginCharacters, type LoginCharactersApi } from '../composables/useL
defineOptions({ name: 'LoginCharacters' }); defineOptions({ name: 'LoginCharacters' });
const props = withDefaults(
defineProps<{
/** 父级在 register 后置 true,用于淡入 */
appear?: boolean;
}>(),
{ appear: false },
);
const CHAR_COLORS = { const CHAR_COLORS = {
orange: '#1f6f5f', orange: '#1f6f5f',
purple: '#2fa084', purple: '#2fa084',
@ -132,9 +140,21 @@ onMounted(async () => {
<style lang="less" scoped> <style lang="less" scoped>
.login-characters { .login-characters {
position: relative;
z-index: 2;
pointer-events: auto; pointer-events: auto;
user-select: none; user-select: none;
overflow: visible; overflow: visible;
opacity: 0;
transform: translate3d(0, 10px, 0);
transition:
opacity 0.4s ease,
transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
&.is-appear {
opacity: 1;
transform: translate3d(0, 0, 0);
}
} }
.login-characters__stage { .login-characters__stage {

View File

@ -33,21 +33,6 @@
{{ t('login.hero.track') }} {{ t('login.hero.track') }}
</button> </button>
</form> </form>
<div v-if="showRegisterQuoteCta" class="login-hero__actions">
<a class="login-hero__cta" href="/register" @click.prevent="goRegisterQuote">
{{ t('login.hero.cta.registerQuote') }}
<span class="login-hero__cta-arrow" aria-hidden="true">→</span>
</a>
<a
class="login-hero__cta login-hero__cta--ghost"
href="/"
@click.prevent="goExploreLanes"
>
{{ t('login.hero.cta.exploreLanes') }}
<span class="login-hero__cta-arrow" aria-hidden="true">→</span>
</a>
</div>
</div> </div>
</template> </template>
@ -116,7 +101,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeUnmount, onMounted, ref, type Component } from 'vue'; import { computed, onBeforeUnmount, onMounted, ref, type Component } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { Message } from '@arco-design/web-vue'; import { Message } from '@arco-design/web-vue';
import { brandCopy } from '@/utils/brandCopy'; import { brandCopy } from '@/utils/brandCopy';
@ -197,7 +182,6 @@ const props = withDefaults(
); );
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute();
const router = useRouter(); const router = useRouter();
const trackingNo = ref(''); const trackingNo = ref('');
const activePrinciple = ref(0); const activePrinciple = ref(0);
@ -205,10 +189,6 @@ const hovered = ref(false);
let cycleTimer: ReturnType<typeof window.setInterval> | null = null; let cycleTimer: ReturnType<typeof window.setInterval> | null = null;
const isCustomer = computed(() => props.portal === 'customer'); const isCustomer = computed(() => props.portal === 'customer');
/** 注册页复用同一 Hero,不再展示「去注册看价」 */
const showRegisterQuoteCta = computed(
() => !String(route.path || '').startsWith('/register'),
);
const activePillars = computed(() => const activePillars = computed(() =>
props.portal === 'agent' ? agentPillars : adminPillars, props.portal === 'agent' ? agentPillars : adminPillars,
); );
@ -241,20 +221,6 @@ function onTrackSubmit() {
void router.push({ path: '/track/query', query: { no } }); void router.push({ path: '/track/query', query: { no } });
} }
function goRegisterQuote() {
const query: Record<string, string> = {};
for (const key of ['agent', 'agentCode', 'ref', 'invite', 'advisor', 'redirect'] as const) {
const raw = route.query[key];
const value = typeof raw === 'string' ? raw.trim() : '';
if (value) query[key] = value;
}
void router.push({ path: '/register', query });
}
function goExploreLanes() {
void router.push({ name: 'siteRoot', hash: '#routes' });
}
onMounted(() => { onMounted(() => {
if (!isCustomer.value) startCycle(); if (!isCustomer.value) startCycle();
}); });
@ -404,7 +370,7 @@ onBeforeUnmount(() => {
.login-hero--customer .login-hero__tools { .login-hero--customer .login-hero__tools {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 14px; gap: 0;
padding-top: 4px; padding-top: 4px;
} }
@ -455,49 +421,6 @@ onBeforeUnmount(() => {
opacity: 0.92; opacity: 0.92;
} }
.login-hero__actions {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px 20px;
}
.login-hero__cta {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 13px;
font-weight: 600;
letter-spacing: 0.02em;
color: rgba(255, 255, 255, 0.88);
text-decoration: none;
transition: color 0.2s, gap 0.2s;
}
.login-hero__cta--ghost {
font-weight: 500;
color: rgba(255, 255, 255, 0.62);
}
.login-hero__cta:hover {
color: #fff;
gap: 10px;
}
.login-hero__cta--ghost:hover {
color: rgba(255, 255, 255, 0.9);
}
.login-hero__cta-arrow {
font-size: 14px;
line-height: 1;
transition: transform 0.2s;
}
.login-hero__cta:hover .login-hero__cta-arrow {
transform: translateX(2px);
}
.login-hero__heading { .login-hero__heading {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@ -861,19 +784,6 @@ onBeforeUnmount(() => {
color: rgba(26, 45, 74, 0.4); color: rgba(26, 45, 74, 0.4);
} }
.login-hero--light .login-hero__cta {
color: var(--app-primary-color, #007979);
}
.login-hero--light .login-hero__cta--ghost {
color: rgba(26, 45, 74, 0.55);
}
.login-hero--light .login-hero__cta:hover,
.login-hero--light .login-hero__cta--ghost:hover {
color: #006868;
}
.login-hero--light .login-hero__principle { .login-hero--light .login-hero__principle {
&::before { &::before {
background: rgba(26, 45, 74, 0.12); background: rgba(26, 45, 74, 0.12);

View File

@ -8,7 +8,6 @@
:aria-label="label" :aria-label="label"
@pointerenter="preloadTarget" @pointerenter="preloadTarget"
@focus="preloadTarget" @focus="preloadTarget"
@click="onSwitchClick"
> >
<icon-swap :size="14" /> <icon-swap :size="14" />
</router-link> </router-link>
@ -20,7 +19,6 @@ import { computed } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { IconSwap } from '@arco-design/web-vue/es/icon'; import { IconSwap } from '@arco-design/web-vue/es/icon';
import { ADMIN_LOGIN_PATH, CUSTOMER_LOGIN_PATH } from '@/utils/login-portal'; import { ADMIN_LOGIN_PATH, CUSTOMER_LOGIN_PATH } from '@/utils/login-portal';
import { armPageFlip } from '@/utils/page-transition-flag';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
@ -56,24 +54,13 @@ function preloadTarget() {
targetPreloaded = true; targetPreloaded = true;
const hero = new Image(); const hero = new Image();
hero.src = TARGET_HERO[props.target]; hero.src = TARGET_HERO[props.target];
// 切回客户登录时预拉角色包,避免点进去再等 // 悬停即预热对侧 chunk,点击同壳切换时几乎无等待
if (props.target === 'customer') { if (props.target === 'customer') {
void import('./LoginCharacters.vue'); void import('./LoginCharacters.vue');
} else {
void import('./LoginCareBanner.vue');
} }
} }
function onSwitchClick(e: MouseEvent) {
if (
e.button !== 0 ||
e.metaKey ||
e.ctrlKey ||
e.shiftKey ||
e.altKey
) {
return;
}
armPageFlip();
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

View File

@ -503,17 +503,22 @@ async function handleSubmit() {
.nova-login__header { .nova-login__header {
display: block; display: block;
text-align: center; text-align: center;
margin-bottom: 28px; margin-bottom: 20px;
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
} }
.nova-login__header :deep(.login-brand__img) {
width: 40px;
height: 40px;
}
.nova-login__brand-hint { .nova-login__brand-hint {
margin: 12px 0 0; margin: 8px 0 0;
font-size: 13px; font-size: 13px;
font-weight: 400; font-weight: 400;
line-height: 1.35; line-height: 1.3;
color: #86868b; color: #86868b;
letter-spacing: -0.01em; letter-spacing: -0.01em;
} }
@ -616,7 +621,7 @@ async function handleSubmit() {
.nova-login__row.is-focused .nova-login__float, .nova-login__row.is-focused .nova-login__float,
.nova-login__row.is-filled .nova-login__float, .nova-login__row.is-filled .nova-login__float,
.nova-login__row:has(input:-webkit-autofill) .nova-login__float { .nova-login__row:has(input:-webkit-autofill) .nova-login__float {
top: 6px; top: 5px;
font-size: 11px; font-size: 11px;
font-weight: 500; font-weight: 500;
color: #6e6e73; color: #6e6e73;
@ -634,8 +639,8 @@ async function handleSubmit() {
.nova-login__form :deep(.arco-input-wrapper), .nova-login__form :deep(.arco-input-wrapper),
.nova-login__form :deep(.arco-input-password) { .nova-login__form :deep(.arco-input-password) {
width: 100%; width: 100%;
min-height: 56px; min-height: 52px;
padding: 22px 12px 8px 14px; padding: 20px 12px 7px 14px;
border: none !important; border: none !important;
border-radius: 0; border-radius: 0;
background: transparent !important; background: transparent !important;
@ -711,13 +716,13 @@ async function handleSubmit() {
} }
.nova-login__captcha { .nova-login__captcha {
margin-top: 12px; margin-top: 10px;
} }
.nova-login__submit { .nova-login__submit {
width: 100%; width: 100%;
height: 44px; height: 42px;
margin-top: 24px; margin-top: 20px;
font-size: 15px; font-size: 15px;
font-weight: 600; font-weight: 600;
border-radius: 12px; border-radius: 12px;
@ -748,7 +753,7 @@ async function handleSubmit() {
} }
.agreement-area { .agreement-area {
margin: 12px 0 0; margin: 10px 0 0;
width: 100%; width: 100%;
min-width: 0; min-width: 0;
container-type: inline-size; container-type: inline-size;
@ -824,8 +829,8 @@ async function handleSubmit() {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
margin-top: 20px; margin-top: 16px;
padding-top: 16px; padding-top: 14px;
border-top: 1px solid #f0f0f2; border-top: 1px solid #f0f0f2;
} }

View File

@ -15,7 +15,8 @@
<div ref="rightSplitRef" class="login-split login-split--right" aria-hidden="true" /> <div ref="rightSplitRef" class="login-split login-split--right" aria-hidden="true" />
<LoginCareBanner <LoginCareBanner
v-if="shellReady && isAdminLogin && careBannerReady" v-if="shellReady && careBannerReady && (isAdminLogin || isCustomerLogin)"
:audience="isCustomerLogin ? 'customer' : 'admin'"
/> />
<div v-if="shellReady" ref="leftPaneRef" class="login-pane login-pane--left"> <div v-if="shellReady" ref="leftPaneRef" class="login-pane login-pane--left">
@ -26,7 +27,22 @@
/> />
</aside> </aside>
<div v-if="isCustomerLogin" class="login-characters-panel"> <div v-if="isCustomerLogin" class="login-characters-panel">
<LoginCharacters v-if="showCharacters" @register="registerLoginCharacters" /> <!-- 壳一出来就占位;勿限制面板高度,真角色布局盒仍是 550×400 -->
<div
class="login-characters-placeholder"
:class="{ 'is-gone': charactersReady }"
aria-hidden="true"
>
<span class="login-characters-placeholder__bar login-characters-placeholder__bar--purple" />
<span class="login-characters-placeholder__bar login-characters-placeholder__bar--black" />
<span class="login-characters-placeholder__bar login-characters-placeholder__bar--orange" />
<span class="login-characters-placeholder__bar login-characters-placeholder__bar--yellow" />
</div>
<LoginCharacters
v-if="showCharacters"
:appear="charactersReady"
@register="registerLoginCharacters"
/>
</div> </div>
</div> </div>
@ -97,6 +113,7 @@
import { import {
ref, ref,
computed, computed,
watch,
onMounted, onMounted,
onBeforeUnmount, onBeforeUnmount,
provide, provide,
@ -140,10 +157,16 @@ const loginType = computed(() => getLoginTypeFromRouteName(route.name as string)
const isCustomerLogin = computed(() => loginType.value === OmsLoginType.Customer); const isCustomerLogin = computed(() => loginType.value === OmsLoginType.Customer);
const isAgentLogin = computed(() => loginType.value === OmsLoginType.Agent); const isAgentLogin = computed(() => loginType.value === OmsLoginType.Agent);
const isAdminLogin = computed(() => loginType.value === OmsLoginType.User); const isAdminLogin = computed(() => loginType.value === OmsLoginType.User);
/** 角色动画偏重,首屏延后空闲再挂 */ /** 角色动画偏重:先占位,chunk 就绪后再挂真组件 */
const showCharacters = ref(false); const showCharacters = ref(false);
/** 真角色已 register,用于淡出剪影 */
const charactersReady = ref(false);
/** 管理端关怀条在翻页结束后再挂,避免展开过程中插入一块新图层 */ /** 管理端关怀条在翻页结束后再挂,避免展开过程中插入一块新图层 */
const careBannerReady = ref(!isPortalIrisActive()); const careBannerReady = ref(!isPortalIrisActive());
/** 客户登录尽早预取角色包(setup 阶段,不等 onMounted) */
if (isCustomerLogin.value) {
void loadLoginCharacters();
}
const activeKey = ref<'pwd' | 'wechat'>('pwd'); const activeKey = ref<'pwd' | 'wechat'>('pwd');
const wechatMounted = ref(false); const wechatMounted = ref(false);
const wechatLoginRef = ref<{ prefetch?: () => void } | null>(null); const wechatLoginRef = ref<{ prefetch?: () => void } | null>(null);
@ -257,6 +280,24 @@ provide(LOGIN_CHARACTERS_KEY, loginCharactersApi);
function registerLoginCharacters(api: LoginCharactersApi) { function registerLoginCharacters(api: LoginCharactersApi) {
loginCharactersApi.value = api; loginCharactersApi.value = api;
// 下一帧再标 ready,保证首屏 paint 后再淡入
requestAnimationFrame(() => {
charactersReady.value = true;
});
}
function mountLoginCharactersSoon() {
if (!isCustomerLogin.value || showCharacters.value) return;
void loadLoginCharacters()
.catch(() => undefined)
.finally(() => {
afterPortalIris(() => {
// 包已在内存时立刻挂;略延一帧让占位先 paint
requestAnimationFrame(() => {
showCharacters.value = true;
});
});
});
} }
function readStoredAppearance(): boolean { function readStoredAppearance(): boolean {
@ -312,22 +353,36 @@ function afterPortalIris(run: () => void) {
window.setTimeout(wait, 80); window.setTimeout(wait, 80);
} }
/** 同壳互切时按门户类型装卸装饰,避免整页 remount */
watch(isCustomerLogin, (customer) => {
if (customer) {
charactersReady.value = false;
showCharacters.value = false;
loginCharactersApi.value = null;
mountLoginCharactersSoon();
return;
}
showCharacters.value = false;
charactersReady.value = false;
loginCharactersApi.value = null;
});
watch([isAdminLogin, isCustomerLogin], ([admin, customer]) => {
if (admin || customer) {
careBannerReady.value = true;
}
});
onMounted(() => { onMounted(() => {
document.documentElement.classList.add(LOGIN_PAGE_SCROLL_LOCK_CLASS); document.documentElement.classList.add(LOGIN_PAGE_SCROLL_LOCK_CLASS);
shellReady.value = true; shellReady.value = true;
if (isCustomerLogin.value) { mountLoginCharactersSoon();
void loadLoginCharacters();
}
const idle = window.requestIdleCallback const idle = window.requestIdleCallback
? (cb: () => void, timeout = 1200) => window.requestIdleCallback(cb, { timeout }) ? (cb: () => void, timeout = 1200) => window.requestIdleCallback(cb, { timeout })
: (cb: () => void, timeout = 1200) => window.setTimeout(cb, Math.min(timeout, 400)); : (cb: () => void, timeout = 1200) => window.setTimeout(cb, Math.min(timeout, 400));
afterPortalIris(() => { afterPortalIris(() => {
if (isAdminLogin.value || isCustomerLogin.value) {
careBannerReady.value = true; careBannerReady.value = true;
// 角色尽早挂上;包已预取时几乎无缝
if (isCustomerLogin.value) {
window.setTimeout(() => {
showCharacters.value = true;
}, 120);
} }
idle(() => { idle(() => {
void import('@/locale').then(({ ensureFullLocaleMessages }) => { void import('@/locale').then(({ ensureFullLocaleMessages }) => {
@ -519,6 +574,82 @@ onBeforeUnmount(() => {
z-index: 6; z-index: 6;
pointer-events: auto; pointer-events: auto;
padding: 0 0 16px 8px; padding: 0 0 16px 8px;
overflow: visible;
}
/* 视觉尺寸约 198×144,叠在真角色同位置;面板本身不能锁死高度 */
.login-characters-placeholder {
position: absolute;
left: 8px;
bottom: 16px;
z-index: 1;
width: 198px;
height: 144px;
pointer-events: none;
opacity: 1;
transition: opacity 0.35s ease;
filter: saturate(0.92);
&.is-gone {
opacity: 0;
visibility: hidden;
}
}
.login-characters-placeholder__bar {
position: absolute;
bottom: 0;
border-radius: 4px 4px 0 0;
transform-origin: bottom center;
animation: login-chars-ph-breathe 1.6s ease-in-out infinite;
&--purple {
left: 25px;
width: 65px;
height: 144px;
background: #2fa084;
animation-delay: 0s;
}
&--black {
left: 86px;
width: 43px;
height: 112px;
background: #6fcf97;
animation-delay: 0.12s;
}
&--orange {
left: 0;
width: 61px;
height: 79px;
background: #1f6f5f;
z-index: 2;
animation-delay: 0.24s;
}
&--yellow {
left: 112px;
width: 72px;
height: 72px;
border-radius: 50%;
background: #eeeeee;
bottom: 0;
z-index: 3;
animation-delay: 0.36s;
}
}
@keyframes login-chars-ph-breathe {
0%,
100% {
opacity: 0.55;
transform: scaleY(0.98);
}
50% {
opacity: 0.85;
transform: scaleY(1);
}
} }
.login-hero-panel--admin { .login-hero-panel--admin {
@ -579,7 +710,7 @@ onBeforeUnmount(() => {
width: 100%; width: 100%;
max-width: 380px; max-width: 380px;
min-height: auto; min-height: auto;
padding: 44px 32px 32px; padding: 36px 30px 28px;
&.login-form--portal-row { &.login-form--portal-row {
padding-bottom: 12px; padding-bottom: 12px;
@ -674,7 +805,7 @@ onBeforeUnmount(() => {
.login-form { .login-form {
max-width: 97% !important; max-width: 97% !important;
padding: 36px 20px 52px; padding: 30px 20px 40px;
border-radius: 14px; border-radius: 14px;
} }
} }

View File

@ -55,6 +55,8 @@
'login.hero.agent.pillar.commission.desc': 'Accruals and payout status at a glance', 'login.hero.agent.pillar.commission.desc': 'Accruals and payout status at a glance',
'login.hero.agent.ai': 'login.hero.agent.ai':
'Focus on customers and commission: accrues on delivery, details stay visible, payouts settle offline.', 'Focus on customers and commission: accrues on delivery, details stay visible, payouts settle offline.',
'login.care.eyebrow.afterHours': 'Off hours',
'login.care.eyebrow.holiday': 'Holiday',
'login.care.period.morning': 'Good morning — a fresh start', 'login.care.period.morning': 'Good morning — a fresh start',
'login.care.period.afternoon': 'Good afternoon — steady wins', 'login.care.period.afternoon': 'Good afternoon — steady wins',
'login.care.period.evening': 'Good evening — thanks for today', 'login.care.period.evening': 'Good evening — thanks for today',
@ -84,6 +86,33 @@
'Systems can stay on duty; people still need care under the full moon.', 'Systems can stay on duty; people still need care under the full moon.',
'login.care.holidayNote.nationalDay': 'login.care.holidayNote.nationalDay':
'If you\'re still on, finish what\'s urgent — the rest can wait.', 'If you\'re still on, finish what\'s urgent — the rest can wait.',
/* Customer login care: welcome back only */
'login.care.customer.eyebrow.afterHours': 'Welcome back',
'login.care.customer.eyebrow.holiday': 'Happy holiday',
'login.care.customer.period.morning': 'Good morning — welcome back',
'login.care.customer.period.afternoon': 'Good afternoon — welcome back',
'login.care.customer.period.evening': 'Good evening — welcome back',
'login.care.customer.period.lateNight': 'It\'s late — welcome back',
'login.care.customer.periodNote.morning': 'Glad to see you again.',
'login.care.customer.periodNote.afternoon': 'Take your time — we\'re here.',
'login.care.customer.periodNote.evening': 'Welcome back. No rush.',
'login.care.customer.periodNote.lateNight': 'Take care of yourself — we\'ll be here.',
'login.care.customer.afterHoursGreeting': 'Welcome back',
'login.care.customer.afterHoursNote': 'Sign in anytime — no hurry.',
'login.care.customer.holiday.newYear': 'Happy New Year — welcome back',
'login.care.customer.holiday.springFestival': 'Happy Spring Festival — welcome back',
'login.care.customer.holiday.qingming': 'Qingming — welcome back',
'login.care.customer.holiday.laborDay': 'Happy Labor Day — welcome back',
'login.care.customer.holiday.dragonBoat': 'Happy Dragon Boat — welcome back',
'login.care.customer.holiday.midAutumn': 'Happy Mid-Autumn — welcome back',
'login.care.customer.holiday.nationalDay': 'Happy National Day — welcome back',
'login.care.customer.holidayNote.newYear': 'Wishing you well — come by anytime.',
'login.care.customer.holidayNote.springFestival': 'Happy holidays. Just glad you\'re here.',
'login.care.customer.holidayNote.qingming': 'Take care — welcome back anytime.',
'login.care.customer.holidayNote.laborDay': 'Enjoy the break — welcome back.',
'login.care.customer.holidayNote.dragonBoat': 'Warm wishes — welcome back.',
'login.care.customer.holidayNote.midAutumn': 'Under the full moon — welcome back.',
'login.care.customer.holidayNote.nationalDay': 'Enjoy the holiday — welcome back.',
'login.hero.trackPlaceholder': 'Enter tracking number', 'login.hero.trackPlaceholder': 'Enter tracking number',
'login.hero.track': 'Track', 'login.hero.track': 'Track',
'login.hero.trust.customer': 'US · EU · SEA · Warehousing · AI-assisted', 'login.hero.trust.customer': 'US · EU · SEA · Warehousing · AI-assisted',

View File

@ -53,6 +53,8 @@
'login.hero.agent.pillar.commission.title': '返佣明细', 'login.hero.agent.pillar.commission.title': '返佣明细',
'login.hero.agent.pillar.commission.desc': '计提与打款进度一目了然', 'login.hero.agent.pillar.commission.desc': '计提与打款进度一目了然',
'login.hero.agent.ai': '专注客户与返佣:订单签收计提、明细可查,结算由运营线下完成。', 'login.hero.agent.ai': '专注客户与返佣:订单签收计提、明细可查,结算由运营线下完成。',
'login.care.eyebrow.afterHours': '非工作时间',
'login.care.eyebrow.holiday': '节日快乐',
'login.care.period.morning': '早上好,新的一天开始了', 'login.care.period.morning': '早上好,新的一天开始了',
'login.care.period.afternoon': '下午好,稳稳推进就好', 'login.care.period.afternoon': '下午好,稳稳推进就好',
'login.care.period.evening': '傍晚好,今天也辛苦了', 'login.care.period.evening': '傍晚好,今天也辛苦了',
@ -77,6 +79,33 @@
'login.care.holidayNote.dragonBoat': '粽香里也别忘了喝水,稳稳推进就好。', 'login.care.holidayNote.dragonBoat': '粽香里也别忘了喝水,稳稳推进就好。',
'login.care.holidayNote.midAutumn': '月圆人圆,系统可以值守,你也要照顾好自己。', 'login.care.holidayNote.midAutumn': '月圆人圆,系统可以值守,你也要照顾好自己。',
'login.care.holidayNote.nationalDay': '假期里若仍在岗,先把最急的办好,其余明天再说。', 'login.care.holidayNote.nationalDay': '假期里若仍在岗,先把最急的办好,其余明天再说。',
/* 客户登录人文关怀:只欢迎回来,不说运营口吻 */
'login.care.customer.eyebrow.afterHours': '欢迎回来',
'login.care.customer.eyebrow.holiday': '节日快乐',
'login.care.customer.period.morning': '早上好,欢迎回来',
'login.care.customer.period.afternoon': '下午好,欢迎回来',
'login.care.customer.period.evening': '傍晚好,欢迎回来',
'login.care.customer.period.lateNight': '夜深了,欢迎回来',
'login.care.customer.periodNote.morning': '很高兴又见到你。',
'login.care.customer.periodNote.afternoon': '继续你的行程,我们在这儿。',
'login.care.customer.periodNote.evening': '回来就好,慢慢来就行。',
'login.care.customer.periodNote.lateNight': '先照顾好自己,我们一直在。',
'login.care.customer.afterHoursGreeting': '欢迎回来',
'login.care.customer.afterHoursNote': '随时登录都欢迎,不着急。',
'login.care.customer.holiday.newYear': '元旦快乐,欢迎回来',
'login.care.customer.holiday.springFestival': '新春快乐,欢迎回来',
'login.care.customer.holiday.qingming': '清明时节,欢迎回来',
'login.care.customer.holiday.laborDay': '劳动节快乐,欢迎回来',
'login.care.customer.holiday.dragonBoat': '端午安康,欢迎回来',
'login.care.customer.holiday.midAutumn': '中秋快乐,欢迎回来',
'login.care.customer.holiday.nationalDay': '国庆快乐,欢迎回来',
'login.care.customer.holidayNote.newYear': '新的一年,仍欢迎你常来。',
'login.care.customer.holidayNote.springFestival': '过年好。回来坐坐就好。',
'login.care.customer.holidayNote.qingming': '愿你安好,欢迎随时回来。',
'login.care.customer.holidayNote.laborDay': '假期愉快,欢迎回来。',
'login.care.customer.holidayNote.dragonBoat': '端午安康,欢迎回来。',
'login.care.customer.holidayNote.midAutumn': '月圆人圆,欢迎回来。',
'login.care.customer.holidayNote.nationalDay': '假期愉快,欢迎回来。',
'login.hero.trackPlaceholder': '请输入跟踪单号', 'login.hero.trackPlaceholder': '请输入跟踪单号',
'login.hero.track': '查询物流', 'login.hero.track': '查询物流',
'login.hero.trust.customer': '美欧东南亚 · 仓配一体 · AI 陪跑', 'login.hero.trust.customer': '美欧东南亚 · 仓配一体 · AI 陪跑',

View File

@ -33,7 +33,8 @@
const isNarrow = window.matchMedia('(max-width: 640px)').matches; const isNarrow = window.matchMedia('(max-width: 640px)').matches;
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
const dprCap = 1.5; /* Retina 提到 2,避免 Mac 标题比 Win 更糊;尺寸仍由 --ai-title-h 统一 */
const dprCap = 2;
const ENTER_DELAY = 80; const ENTER_DELAY = 80;
const TEXT_AT = 120; const TEXT_AT = 120;
@ -290,10 +291,10 @@
.ai-runway { .ai-runway {
position: relative; position: relative;
z-index: 2; z-index: 2;
/* 宽度由脚本按文字实测写入;这里只定高度兜底 */ /* 宽度由脚本按文字实测写入;高度与官网 --ai-title-h 对齐,勿再按矮屏砍到 42px */
width: auto; width: auto;
max-width: 100%; max-width: 100%;
height: clamp(44px, 5.5vw, 64px); height: var(--ai-title-h, clamp(48px, min(5.5vw, 7vh), 64px));
margin: 0 auto; margin: 0 auto;
pointer-events: none; pointer-events: none;
} }
@ -304,15 +305,9 @@
height: 100%; height: 100%;
} }
@media (max-height: 900px) {
.ai-runway {
height: 42px;
}
}
@media (max-width: 640px) { @media (max-width: 640px) {
.ai-runway { .ai-runway {
height: 46px; height: var(--ai-title-h, clamp(44px, min(8vw, 6vh), 52px));
} }
} }
</style> </style>

View File

@ -50,7 +50,8 @@
--ai-muted: var(--ai-text-2); --ai-muted: var(--ai-text-2);
--ai-line: var(--ai-border); --ai-line: var(--ai-border);
--ai-glass: var(--ai-surface); --ai-glass: var(--ai-surface);
--ai-content-max: 1200px; /* 与全局 --app-content-max 对齐;官网可单独覆盖 */
--ai-content-max: var(--app-content-max, 1200px);
--ai-guide-panel-w: 760px; --ai-guide-panel-w: 760px;
--ai-routes-panel-w: 1280px; --ai-routes-panel-w: 1280px;
--ai-acrylic-bg: rgba(255, 255, 255, 0.32); --ai-acrylic-bg: rgba(255, 255, 255, 0.32);
@ -123,6 +124,11 @@ body.command-home {
--ai-action-hover: #e25557; --ai-action-hover: #e25557;
--ai-action-rgb: 245, 102, 104; --ai-action-rgb: 245, 102, 104;
--ai-accent-rgb: 245, 102, 104; --ai-accent-rgb: 245, 102, 104;
/* 内容列随视口伸缩(顶栏 / 舞台 / 页脚同源);超宽封顶防行过长 */
--ai-content-max: min(1600px, calc(100vw - 40px));
/* 欢迎区飞机/标题:Mac/Win 共用流体尺寸,勿再按 max-height 砍半 */
--ai-plane-w: clamp(280px, min(40vw, 48vh), 448px);
--ai-title-h: clamp(48px, min(5.5vw, 7vh), 64px);
--ai-text: #121820; --ai-text: #121820;
--ai-text-2: #3d4754; --ai-text-2: #3d4754;
--ai-text-3: #6a7380; --ai-text-3: #6a7380;
@ -809,11 +815,20 @@ body.command-home #ai-advisor-shell {
left: 0; left: 0;
right: 0; right: 0;
bottom: auto; bottom: auto;
height: var(--ai-vv-height, 100%); /* 优先 visualViewport;无 JS 时用动态视口高度,随屏高伸缩 */
height: var(--ai-vv-height, 100dvh);
max-height: var(--ai-vv-height, 100dvh);
z-index: 10; z-index: 10;
overflow: hidden; overflow: hidden;
} }
/* 首页欢迎态:内容高于视口时可滚,避免矮屏被裁切 */
body.command-home #ai-advisor-shell:not(:has(.ai-stage-tools)) {
overflow-x: hidden;
overflow-y: auto;
overscroll-behavior: contain;
}
.ai-shell-bg { .ai-shell-bg {
position: absolute; position: absolute;
inset: 0; inset: 0;
@ -827,7 +842,7 @@ body.command-home #ai-advisor-shell {
top: var(--ai-vv-offset-top, 0px); top: var(--ai-vv-offset-top, 0px);
left: 0; left: 0;
width: 100%; width: 100%;
height: var(--ai-vv-height, 100%); height: var(--ai-vv-height, 100dvh);
z-index: 0; z-index: 0;
inset: auto; inset: auto;
overflow: visible; overflow: visible;
@ -839,7 +854,7 @@ body.command-home #ai-advisor-shell {
top: calc(var(--ai-vv-offset-top, 0px) - 48px); top: calc(var(--ai-vv-offset-top, 0px) - 48px);
left: -48px; left: -48px;
width: calc(100vw + 96px); width: calc(100vw + 96px);
height: calc(var(--ai-vv-height, 100%) + 96px); height: calc(var(--ai-vv-height, 100dvh) + 96px);
overflow: hidden; overflow: hidden;
background: #eef1f4; background: #eef1f4;
} }
@ -942,13 +957,21 @@ body.command-home #ai-advisor-shell {
z-index: 1; z-index: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%;
height: 100%; height: 100%;
min-height: 0;
max-width: var(--ai-content-max); max-width: var(--ai-content-max);
margin: 0 auto; margin: 0 auto;
padding: calc(var(--ai-header-h) + 8px) 20px 0; padding: calc(var(--ai-header-h) + 8px) 20px 0;
box-sizing: border-box; box-sizing: border-box;
} }
/* 欢迎态随内容增高;会话态仍吃满 shell 高度做内部滚动 */
body.command-home #ai-advisor-shell:not(:has(.ai-stage-tools)) .ai-advisor-layout {
height: auto;
min-height: 100%;
}
.ai-advisor-app { .ai-advisor-app {
position: relative; position: relative;
display: flex; display: flex;
@ -2471,7 +2494,7 @@ body.command-home #navbar .site-nav-avatar:hover {
justify-content: center; justify-content: center;
width: 100%; width: 100%;
margin: 2px auto 0; margin: 2px auto 0;
min-height: 64px; min-height: var(--ai-title-h, 64px);
box-sizing: border-box; box-sizing: border-box;
} }
@ -2803,7 +2826,8 @@ body.command-home #ai-advisor-shell:not(:has(.ai-stage-tools)) .ai-composer-dock
gap: 10px; gap: 10px;
width: 100%; width: 100%;
max-width: var(--ai-content-max, 1200px); max-width: var(--ai-content-max, 1200px);
margin: clamp(14px, 2.2vh, 24px) auto 0; /* 相对原 clamp 顶距整体上移 50px */
margin: calc(clamp(14px, 2.2vh, 24px) - 50px) auto 0;
padding: 0 0 4px; padding: 0 0 4px;
box-sizing: border-box; box-sizing: border-box;
isolation: isolate; isolation: isolate;
@ -3955,7 +3979,11 @@ body.command-home .ai-composer-slot--welcome .ai-composer {
.ai-welcome-plane img { .ai-welcome-plane img {
position: relative; position: relative;
z-index: 2; z-index: 2;
width: min(448px, 40vw); /*
* 统一视觉比例:用 vw+vh 流体尺寸,避免「高度 <900 直接砍半」
* (MacBook 逻辑高度常 800–880,旧规则会变成 180px,Win 外接屏却仍 448px)
*/
width: var(--ai-plane-w, clamp(280px, min(40vw, 48vh), 448px));
height: auto; height: auto;
display: block; display: block;
/* 去掉常驻 drop-shadow / 无限呼吸,减少首页持续合成开销 */ /* 去掉常驻 drop-shadow / 无限呼吸,减少首页持续合成开销 */
@ -4031,8 +4059,10 @@ body.command-home .ai-composer-slot--welcome .ai-composer {
body.command-home .ai-welcome-plane { body.command-home .ai-welcome-plane {
margin-bottom: -18px; margin-bottom: -18px;
} }
body.command-home .ai-welcome-plane img { /* 矮屏只略收,不再砍飞机/标题(与桌面同一套流体变量) */
width: min(180px, 20vw); body.command-home {
--ai-plane-w: clamp(260px, min(38vw, 42vh), 400px);
--ai-title-h: clamp(46px, min(5.2vw, 6.5vh), 58px);
} }
} }
@ -5163,8 +5193,8 @@ body.command-home .ai-composer-slot--welcome .ai-composer {
width: 13px; width: 13px;
height: 13px; height: 13px;
} }
.ai-welcome-plane img { body.command-home {
width: min(280px, 42vw); --ai-plane-w: clamp(240px, min(42vw, 40vh), 320px);
} }
} }
@ -5172,6 +5202,8 @@ body.command-home .ai-composer-slot--welcome .ai-composer {
/* 仅官网:勿写裸 :root / .ai-advisor-layout,避免串到 H5 EdiAssistant */ /* 仅官网:勿写裸 :root / .ai-advisor-layout,避免串到 H5 EdiAssistant */
body.command-home { body.command-home {
--ai-header-h: 64px; --ai-header-h: 64px;
--ai-plane-w: clamp(180px, min(62vw, 36vh), 260px);
--ai-title-h: clamp(44px, min(8vw, 6vh), 52px);
} }
body.command-home #header { body.command-home #header {
padding-top: env(safe-area-inset-top, 0px); padding-top: env(safe-area-inset-top, 0px);
@ -5214,12 +5246,9 @@ body.command-home .ai-composer-slot--welcome .ai-composer {
display: flex; display: flex;
margin: 0 0 -14px; margin: 0 0 -14px;
} }
body.command-home .ai-welcome-plane img {
width: min(220px, 62vw);
}
.ai-welcome-title-wrap { .ai-welcome-title-wrap {
margin-top: 4px; margin-top: 4px;
min-height: 56px; min-height: var(--ai-title-h, 52px);
} }
.ai-welcome-cta { .ai-welcome-cta {
min-height: 32px; min-height: 32px;