269 lines
8.1 KiB
HTML
269 lines
8.1 KiB
HTML
<!doctype html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<link rel="icon" type="image/svg+xml" href="/crm-favicon.svg" />
|
||
<title>Sales-Channel-Customer</title>
|
||
<meta name="theme-color" content="#f3f6ff" />
|
||
<style>
|
||
/*
|
||
* 首屏占位(pre-JS boot splash):SPA 在 JS/CSS 下载解析完之前是纯白页,
|
||
* 免密进系统时这段最容易被当成「打开就是白的/挂了」,企业微信里尤其明显。
|
||
* 这里只放内联静态样式与一个 spinner,不引任何外部资源,HTML 一到就有画面,
|
||
* 配色与 src/pages/login.css 的 --crm-login-* 默认值对齐;应用挂载后由
|
||
* src/lib/appBootSplash.ts 淡出并移除。类名带 boot 前缀,避免和打包后的样式互相影响。
|
||
*/
|
||
#app-boot {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 2147483000;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 1.5rem 1.25rem;
|
||
background-color: #f5f6fa;
|
||
background-image:
|
||
radial-gradient(120% 100% at 8% 0%, #fff, #fff0 58%),
|
||
linear-gradient(105deg, #f3f6ff, #eaf2ff 30%, #d7ecff 64%, #bfe4ff);
|
||
color: #1c2b3e;
|
||
font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
|
||
text-align: center;
|
||
opacity: 1;
|
||
transition: opacity 0.18s ease;
|
||
}
|
||
|
||
html.crm-boot-dark #app-boot {
|
||
background-color: #0d141f;
|
||
background-image:
|
||
radial-gradient(110% 90% at 10% 0%, #3f8cff2e, #3f8cff00 62%),
|
||
linear-gradient(105deg, #0b1220, #101c30 42%, #16294a 78%, #1c3559);
|
||
color: #b0c2d9;
|
||
}
|
||
|
||
#app-boot.crm-boot-hide {
|
||
opacity: 0;
|
||
pointer-events: none;
|
||
}
|
||
|
||
#app-boot .boot-stack {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
gap: 1rem;
|
||
}
|
||
|
||
#app-boot .boot-scope {
|
||
position: relative;
|
||
display: grid;
|
||
width: 4.5rem;
|
||
height: 4.5rem;
|
||
place-items: center;
|
||
}
|
||
|
||
#app-boot .boot-track {
|
||
position: absolute;
|
||
inset: 0.4375rem;
|
||
border: 2px solid #eef5ff;
|
||
border-radius: 9999px;
|
||
}
|
||
|
||
#app-boot .boot-arc {
|
||
position: absolute;
|
||
inset: 0.4375rem;
|
||
border: 2px solid #ffffff00;
|
||
border-top-color: #2f74e6;
|
||
border-radius: 9999px;
|
||
animation: crm-boot-spin 0.9s linear infinite;
|
||
}
|
||
|
||
#app-boot .boot-mark {
|
||
position: relative;
|
||
display: grid;
|
||
width: 2.5rem;
|
||
height: 2.5rem;
|
||
place-items: center;
|
||
overflow: hidden;
|
||
border-radius: 0.875rem;
|
||
background-image: linear-gradient(135deg, #3f8cff, #2f74e6);
|
||
color: #fff;
|
||
box-shadow: 0 8px 20px rgba(47, 116, 230, 0.28);
|
||
}
|
||
|
||
#app-boot .boot-mark svg {
|
||
width: 1.375rem;
|
||
height: 1.375rem;
|
||
}
|
||
|
||
#app-boot .boot-name {
|
||
font-size: 1rem;
|
||
font-weight: 600;
|
||
letter-spacing: -0.01em;
|
||
}
|
||
|
||
#app-boot .boot-status {
|
||
margin: 0;
|
||
color: #7d8bab;
|
||
font-size: 0.875rem;
|
||
line-height: 1.375rem;
|
||
}
|
||
|
||
/* 慢网络下的第二句提示:纯 CSS 延时出现,不占 JS 时间线 */
|
||
#app-boot .boot-late {
|
||
margin: 0;
|
||
max-width: 20rem;
|
||
color: #93a4c0;
|
||
font-size: 0.75rem;
|
||
line-height: 1.25rem;
|
||
opacity: 0;
|
||
animation: crm-boot-fade-in 0.4s ease 5s forwards;
|
||
}
|
||
|
||
/* 卡住(JS 没跑起来 / 资源挂了)时的说法与出口:15s 后由内联脚本挂上 stalled 类 */
|
||
#app-boot .boot-stalled,
|
||
#app-boot .boot-reload {
|
||
display: none;
|
||
}
|
||
|
||
#app-boot.crm-boot-stalled .boot-late {
|
||
display: none;
|
||
}
|
||
|
||
#app-boot.crm-boot-stalled .boot-stalled {
|
||
display: block;
|
||
margin: 0;
|
||
max-width: 20rem;
|
||
color: #b45309;
|
||
font-size: 0.75rem;
|
||
line-height: 1.25rem;
|
||
}
|
||
|
||
#app-boot.crm-boot-stalled .boot-reload {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
min-height: 2.25rem;
|
||
margin-top: 0.25rem;
|
||
padding: 0 1rem;
|
||
border: 1px solid #e6ecf5;
|
||
border-radius: 0.5rem;
|
||
background-color: #ffffffb3;
|
||
color: #2f74e6;
|
||
font-size: 0.8125rem;
|
||
font-weight: 500;
|
||
text-decoration: none;
|
||
}
|
||
|
||
html.crm-boot-dark #app-boot .boot-track {
|
||
border-color: #2b3849;
|
||
}
|
||
|
||
html.crm-boot-dark #app-boot.crm-boot-stalled .boot-stalled {
|
||
color: #fcd34d;
|
||
}
|
||
|
||
html.crm-boot-dark #app-boot.crm-boot-stalled .boot-reload {
|
||
border-color: #2b3849;
|
||
background-color: #151f2cb3;
|
||
color: #93c0ff;
|
||
}
|
||
|
||
html.crm-boot-dark #app-boot .boot-status {
|
||
color: #97a9c3;
|
||
}
|
||
|
||
html.crm-boot-dark #app-boot .boot-late {
|
||
color: #6a7d97;
|
||
}
|
||
|
||
@keyframes crm-boot-spin {
|
||
to {
|
||
transform: rotate(360deg);
|
||
}
|
||
}
|
||
|
||
@keyframes crm-boot-fade-in {
|
||
to {
|
||
opacity: 1;
|
||
}
|
||
}
|
||
|
||
@media (prefers-reduced-motion: reduce) {
|
||
#app-boot {
|
||
transition: none;
|
||
}
|
||
|
||
#app-boot .boot-arc {
|
||
animation: none;
|
||
border-top-color: #2f74e64d;
|
||
}
|
||
|
||
#app-boot .boot-late {
|
||
animation: none;
|
||
opacity: 1;
|
||
}
|
||
}
|
||
</style>
|
||
<script>
|
||
// 与 ThemeProvider(storageKey: crm-theme, defaultTheme: light) 同一判据,
|
||
// 只为占位层选色,不改全局主题类,避免和打包后的主题逻辑抢时序。
|
||
(function () {
|
||
try {
|
||
var stored = localStorage.getItem("crm-theme") || "light";
|
||
var dark =
|
||
stored === "dark" ||
|
||
(stored === "system" &&
|
||
typeof window.matchMedia === "function" &&
|
||
window.matchMedia("(prefers-color-scheme: dark)").matches);
|
||
if (dark) {
|
||
document.documentElement.classList.add("crm-boot-dark");
|
||
}
|
||
} catch (error) {
|
||
// 读不到存储就用浅色
|
||
}
|
||
|
||
// 入口 chunk 挂了 / 依赖成环 TDZ 时应用不会挂载,这里给一句实话和一个刷新出口,
|
||
// 比让人对着一片白或一个永远在转的圈猜要好用。挂载成功后 #app-boot 会被移除,计时器自然无害。
|
||
window.setTimeout(function () {
|
||
var boot = document.getElementById("app-boot");
|
||
if (boot) {
|
||
boot.classList.add("crm-boot-stalled");
|
||
}
|
||
}, 15000);
|
||
})();
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<div id="root"></div>
|
||
<div id="app-boot" role="status" aria-live="polite">
|
||
<div class="boot-stack">
|
||
<span class="boot-scope">
|
||
<span class="boot-track"></span>
|
||
<span class="boot-arc"></span>
|
||
<span class="boot-mark">
|
||
<svg
|
||
viewBox="0 0 24 24"
|
||
fill="none"
|
||
stroke="currentColor"
|
||
stroke-width="1.8"
|
||
stroke-linecap="round"
|
||
stroke-linejoin="round"
|
||
aria-hidden="true"
|
||
>
|
||
<path d="M12 2.5 4.5 5.2v5.3c0 4.6 3.1 8.4 7.5 9.9 4.4-1.5 7.5-5.3 7.5-9.9V5.2L12 2.5Z" />
|
||
<path d="m9 11.8 2.1 2.1L15.2 9.8" />
|
||
</svg>
|
||
</span>
|
||
</span>
|
||
<span class="boot-name">Sales-Channel-Customer</span>
|
||
<p class="boot-status">正在加载 CRM…</p>
|
||
<p class="boot-late">网络较慢时请稍等;若是从统一门户免密进入,也可回到门户重新进入。</p>
|
||
<p class="boot-stalled">页面资源加载超时,可能是网络不稳定或前端资源版本已更新,请刷新重试。</p>
|
||
<!-- 用 reload 而不是 href:href="." 会把 /sso?ticket=… 折成 /,票据直接丢掉 -->
|
||
<a class="boot-reload" href="#" onclick="window.location.reload();return false;">刷新重试</a>
|
||
</div>
|
||
</div>
|
||
<script type="module" src="/src/main.tsx"></script>
|
||
</body>
|
||
</html>
|