front/index.html
zzh a7993c12b6
All checks were successful
Build and Deploy Front / deploy (push) Successful in 4m18s
feat: 品牌/收款码图可清除,未配置显示 LOGO 文字
去掉本地默认品牌图回退;配置弹窗原生拖拽预览并支持清除;登录/顶栏/官网/侧栏统一走配置图。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-19 19:30:02 +08:00

502 lines
17 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN" class="app-booting">
<head>
<meta charset="UTF-8" />
<script>
/* 首屏前判定 H5/语言,避免 body 绘出后再改「BCD」→「BCD客户中心」造成字号/布局抖 */
(function () {
var path = location.pathname || '';
var search = location.search || '';
var hash = location.hash || '';
var isH5Path =
path === '/h5' ||
path.indexOf('/h5/') === 0 ||
path.indexOf('/wechat/') === 0 ||
path === '/track/query' ||
path.indexOf('/track/query/') === 0;
if (path === '/' || path === '') {
document.documentElement.classList.remove('app-booting');
document.documentElement.classList.add('app-boot-site');
}
/* 手机/微信访问客户登录:首屏前直达 H5。官网 `/` 走 Vue 站点,不要跳到 H5。 */
if (path === '/login') {
try {
var forcePc =
sessionStorage.getItem('oms_force_desktop') === '1' ||
/[?&](desktop|forcePc)=1(?:&|$)/.test(search);
var forceH5 =
sessionStorage.getItem('oms_force_h5') === '1' ||
/[?&]h5=1(?:&|$)/.test(search);
var ua = navigator.userAgent || '';
var mobile =
forceH5 ||
(!forcePc &&
(/MicroMessenger/i.test(ua) ||
/Android|iPhone|iPod|iPad|Mobile/i.test(ua) ||
(window.matchMedia &&
window.matchMedia('(max-width: 768px)').matches)));
if (mobile) {
var token =
localStorage.getItem('rbac_access_token') ||
localStorage.getItem('token') ||
'';
var target = token ? '/h5/orders' : '/h5/login';
if (search && !token) {
/* 保留 redirect 等查询,避免微信回跳丢参 */
location.replace(target + search + hash);
} else {
location.replace(target + hash);
}
return;
}
} catch (e0) {}
}
var isH5 = isH5Path;
var isAdminH5 =
path === '/h5/admin' || path.indexOf('/h5/admin/') === 0;
var isEn = false;
var pageBg = '#f0f3f4';
try {
var locale =
localStorage.getItem('arco-locale') || localStorage.getItem('locale') || '';
isEn = /^en/i.test(locale);
var storedBg = localStorage.getItem('app-page-background-color');
if (storedBg && /^#?[0-9a-fA-F]{6}$/.test(storedBg)) {
pageBg = storedBg.charAt(0) === '#' ? storedBg : '#' + storedBg;
}
} catch (e) {}
var root = document.documentElement;
if (isH5) root.classList.add('app-boot-h5');
if (isEn) root.classList.add('app-boot-en');
/* Mac 桌面:供 CSS 弱化自定义滚动条,尽量贴近系统叠加条(不含 iPad) */
try {
var ua0 = navigator.userAgent || '';
var isPad =
/iPad/i.test(ua0) ||
(/Macintosh/i.test(ua0) && navigator.maxTouchPoints > 1);
if (!isPad && /Macintosh|Mac OS X/i.test(ua0) && !/iPhone|iPod/i.test(ua0)) {
root.classList.add('platform-mac');
}
} catch (eMac) {}
/* 加载页与 OMS/官网共用页面背景配置,首屏前写入避免闪色 */
root.style.setProperty('--app-page-bg', pageBg);
root.style.setProperty('--kc-page-bg', pageBg);
root.style.setProperty('--ai-bg', pageBg);
root.style.setProperty('--ai-canvas', pageBg);
try {
/* 运营端 /h5/admin 勿复用客户中心标题,避免浏览器顶栏串文案 */
document.title = isAdminH5
? isEn
? 'BCD Ops Center'
: 'BCD运营中心'
: isH5
? isEn
? 'BCD Customer Center'
: 'BCD客户中心'
: 'BCD I Faster & Simpler';
} catch (e2) {}
if (path === '/login') {
var plane = document.createElement('link');
plane.rel = 'preload';
plane.as = 'image';
plane.href = '/login-assets/hero-plane.webp';
plane.type = 'image/webp';
document.head.appendChild(plane);
}
})();
</script>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
/>
<title>BCD I Faster &amp; Simpler</title>
<link rel="stylesheet" type="text/css" media="print" href="/print-lock.css" />
<!-- DNS 预解析,加速资源加载 -->
<link rel="dns-prefetch" href="//43.139.210.35" />
<!-- 预连接,提前建立连接 -->
<link rel="preconnect" href="//43.139.210.35" crossorigin />
<style>
/*
* 右→左偏移根因:Vue 挂载后页面出现纵向滚动条,视口变窄,
* fixed 居中点左移约半个滚动条宽度。仅 boot 期间预留 gutter;
* 常驻 stable 会在右侧留出约 15px 空缝,贯穿 fixed 顶栏。
*/
html {
background: var(--app-page-bg, #f0f3f4);
}
html.app-boot-site #app-boot {
display: none !important;
}
html.app-booting {
scrollbar-gutter: stable;
}
html.app-booting,
html.app-booting body {
overflow: hidden !important;
overscroll-behavior: none;
}
html,
body,
#app {
margin: 0;
min-height: 100%;
background: var(--app-page-bg, #f0f3f4);
}
#app-boot {
position: fixed;
inset: 0;
z-index: 99999;
margin: 0;
padding: 0;
box-sizing: border-box;
/* 用 100% 相对自身,避免 100vw 把滚动条宽度算进去 */
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: var(--app-page-bg, #f0f3f4);
/*
* 必须与 global.less 首屏后状态一致:
* Vue 加载后 html 会带上 antialiased,若 boot 首帧没有,中文会突然变细像「字号缩小」。
*/
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
'Microsoft YaHei', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 16px;
color: #4e5969;
text-align: center;
opacity: 1;
transition: opacity 0.28s ease;
pointer-events: auto;
}
#app-boot.is-leaving {
opacity: 0;
pointer-events: none;
}
#app-boot .boot-panel {
width: 300px;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
/* 不用 left:50% + translate,避免视口宽度变化时二次偏移 */
flex-shrink: 0;
}
#app-boot .boot-brand {
display: flex;
flex-direction: column;
align-items: center;
flex-shrink: 0;
}
#app-boot .boot-logo-wrap {
min-width: 96px;
min-height: 72px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 0;
background: transparent;
box-shadow: none;
box-sizing: border-box;
padding: 0;
overflow: visible;
}
#app-boot .boot-logo {
display: block;
width: 96px;
height: 96px;
object-fit: contain;
animation: app-boot-bounce 1.4s ease-in-out infinite;
}
#app-boot .boot-logo[hidden] {
display: none !important;
}
#app-boot .boot-text-logo {
display: block;
font-size: 36px;
font-weight: 700;
letter-spacing: 0.12em;
line-height: 1;
color: #86909c;
animation: app-boot-bounce 1.4s ease-in-out infinite;
user-select: none;
}
#app-boot .boot-text-logo[hidden] {
display: none !important;
}
#app-boot .boot-status {
margin-top: 12px;
width: 100%;
height: 96px;
display: flex;
flex-direction: column;
align-items: center;
}
#app-boot .boot-spinner-slot {
position: relative;
width: 120px;
height: 32px;
flex-shrink: 0;
}
#app-boot .boot-spinner {
display: none;
}
#app-boot .boot-retry {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
height: 32px;
padding: 0 16px;
border: 1px solid #e5e6eb;
border-radius: 4px;
background: #fff;
color: #1d2129;
font-size: 14px;
font-weight: 500;
cursor: pointer;
opacity: 0;
visibility: hidden;
pointer-events: none;
white-space: nowrap;
}
#app-boot .boot-retry:hover {
border-color: var(--app-primary-color, #054f74);
color: var(--app-primary-color, #054f74);
}
#app-boot.is-timeout .boot-logo,
#app-boot.is-timeout .boot-text-logo {
animation: none;
}
#app-boot.is-timeout .boot-retry {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
#app-boot .boot-title {
margin: 10px 0 0;
height: 20px;
font-size: 14px;
font-weight: 500;
color: #86909c;
line-height: 20px;
}
#app-boot .boot-sub {
margin: 6px 0 0;
height: 36px;
font-size: 12px;
line-height: 18px;
color: #c9cdd4;
width: 100%;
overflow: hidden;
}
#app-boot.is-timeout .boot-title {
color: #1d2129;
font-weight: 600;
}
#app-boot.is-timeout .boot-sub {
color: #86909c;
}
/* H5:样式挂在 html.app-boot-h5 上,首屏即正确,不再二次改字号/Logo;背景随页面背景配置 */
html.app-boot-h5 {
background: var(--app-page-bg, #f0f3f4);
}
html.app-boot-h5.app-booting {
scrollbar-gutter: stable;
}
html.app-boot-h5,
html.app-boot-h5 body,
html.app-boot-h5 #app {
background: var(--app-page-bg, #f0f3f4);
}
html.app-boot-h5 #app-boot {
background: var(--app-page-bg, #f0f3f4);
padding: env(safe-area-inset-top, 0) 24px env(safe-area-inset-bottom, 0);
}
html.app-boot-h5 #app-boot .boot-panel {
width: min(300px, 100%);
}
html.app-boot-h5 #app-boot .boot-status {
height: 104px;
}
/* boot 盖住期间禁止登录页入场动画,避免淡出瞬间叠 rise 抖动 */
html.app-booting .h5-login-main,
html.app-booting .h5-login-error {
animation: none !important;
}
@keyframes app-boot-bounce {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-8px);
}
}
@media (prefers-reduced-motion: reduce) {
#app-boot .boot-logo,
#app-boot .boot-text-logo {
animation: none;
}
}
</style>
</head>
<body>
<div id="app-boot" role="status" aria-live="polite">
<div class="boot-panel">
<div class="boot-brand">
<div class="boot-logo-wrap">
<img
class="boot-logo"
width="96"
height="96"
alt=""
decoding="sync"
fetchpriority="high"
hidden
/>
<span class="boot-text-logo" aria-hidden="true">LOGO</span>
</div>
</div>
<div class="boot-status">
<div class="boot-spinner-slot">
<div class="boot-spinner" aria-hidden="true"></div>
<button type="button" class="boot-retry" id="app-boot-retry" onclick="location.reload()">
重新加载
</button>
</div>
<p class="boot-title" id="app-boot-title">正在加载系统…</p>
<p class="boot-sub" id="app-boot-sub">首次打开或网络较慢时可能稍等片刻</p>
</div>
</div>
</div>
<div id="app"></div>
<script>
(function () {
var boot = document.getElementById('app-boot');
var title = document.getElementById('app-boot-title');
var sub = document.getElementById('app-boot-sub');
var retry = document.getElementById('app-boot-retry');
if (!boot) return;
var root = document.documentElement;
var isH5 = root.classList.contains('app-boot-h5');
var isEn = root.classList.contains('app-boot-en');
var copy = isH5
? isEn
? {
title: 'Loading…',
sub: 'Please wait a moment',
slow: 'Still loading, please wait…',
timeoutTitle: 'Taking too long',
timeoutSub: 'Check your network and try again',
retry: 'Reload',
}
: {
title: '正在加载…',
sub: '请稍候',
slow: '仍在加载,请稍候…',
timeoutTitle: '加载时间过长',
timeoutSub: '请检查网络后重试',
retry: '重新加载',
}
: isEn
? {
title: 'Loading…',
sub: 'First open or slow network may take a moment',
slow: 'Still loading resources…',
timeoutTitle: 'Taking too long',
timeoutSub: 'Check your network and try again',
retry: 'Reload',
}
: {
title: '正在加载系统…',
sub: '首次打开或网络较慢时可能稍等片刻',
slow: '仍在加载资源,请稍候…',
timeoutTitle: '加载时间过长',
timeoutSub: '请检查网络后重试;若持续失败,可刷新页面或稍后再试',
retry: '重新加载',
};
if (title) title.textContent = copy.title;
if (sub) sub.textContent = copy.sub;
if (retry) retry.textContent = copy.retry;
/* 冷启动优先用缓存吉祥物,避免等 Vue/API(与 brandLogo.ts MASCOT_CACHE_KEY 一致) */
try {
var cachedMascot = (localStorage.getItem('oms_brand_mascot_url') || '').trim();
var logoImg = boot.querySelector('.boot-logo');
var logoText = boot.querySelector('.boot-text-logo');
var isLegacyDefault =
!cachedMascot ||
cachedMascot === '/app-mascot.png' ||
cachedMascot.indexOf('/app-mascot.png?') === 0 ||
cachedMascot.indexOf('app-mascot.png') >= 0 ||
cachedMascot === '/empty-placeholder.svg' ||
cachedMascot.indexOf('/empty-placeholder.svg') === 0;
if (isLegacyDefault) {
try {
localStorage.removeItem('oms_brand_mascot_url');
} catch (eClear) {}
root.classList.remove('has-app-mascot');
root.style.removeProperty('--app-mascot-bg');
if (logoImg) {
logoImg.hidden = true;
logoImg.removeAttribute('src');
}
if (logoText) logoText.removeAttribute('hidden');
} else if (
logoImg &&
(/^https?:\/\//i.test(cachedMascot) ||
cachedMascot.charAt(0) === '/' ||
cachedMascot.indexOf('data:') === 0)
) {
logoImg.hidden = false;
logoImg.src = cachedMascot;
if (logoText) logoText.setAttribute('hidden', '');
root.classList.add('has-app-mascot');
root.style.setProperty(
'--app-mascot-bg',
'url("' + cachedMascot.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '")',
);
}
} catch (eMascot) {}
window.__dismissAppBoot = function () {
if (!boot || boot.classList.contains('is-leaving')) return;
boot.classList.add('is-leaving');
var done = false;
function removeBoot() {
if (done) return;
done = true;
document.documentElement.classList.remove('app-booting');
document.documentElement.classList.remove('app-boot-h5');
document.documentElement.classList.remove('app-boot-en');
if (boot && boot.parentNode) boot.parentNode.removeChild(boot);
}
boot.addEventListener('transitionend', removeBoot, { once: true });
window.setTimeout(removeBoot, 360);
};
window.setTimeout(function () {
if (window.__APP_MOUNTED__ || !document.getElementById('app-boot')) return;
if (sub) sub.textContent = copy.slow;
}, 4000);
window.setTimeout(function () {
if (window.__APP_MOUNTED__ || !document.getElementById('app-boot')) return;
boot.classList.add('is-timeout');
if (title) title.textContent = copy.timeoutTitle;
if (sub) sub.textContent = copy.timeoutSub;
}, 20000);
})();
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>