diff --git a/app/common.php b/app/common.php index 6f788bd..99322f6 100644 --- a/app/common.php +++ b/app/common.php @@ -318,6 +318,24 @@ function getLang() return $firstPath; } +/** + * 按当前语言取前台语义 ID(config/ui_ids.php) + * @param string $key 如 nav_header / product + * @param string|null $lang 默认 getLang();zh-cn 会归一为 zh + */ +function uiId(string $key, ?string $lang = null): int +{ + $lang = $lang ?: getLang(); + if ($lang === 'zh-cn' || $lang === config('lang.simplified_chinese')) { + $lang = 'zh'; + } + $row = config('ui_ids.' . $key); + if (!is_array($row)) { + return (int)$row; + } + return (int)($row[$lang] ?? $row['zh'] ?? 0); +} + function optEventLog($id, $title, $operation) { diff --git a/config/ui_ids.php b/config/ui_ids.php new file mode 100644 index 0000000..9555ae0 --- /dev/null +++ b/config/ui_ids.php @@ -0,0 +1,25 @@ + ['zh' => 47, 'en' => 49], // 顶部导航_新 + 'nav_footer' => ['zh' => 48, 'en' => 50], // 睿能科技底部导航 + + // 栏目(header / footer 业务判断与标签查询) + 'home' => ['zh' => 36, 'en' => 706], // 首页 + 'product' => ['zh' => 333, 'en' => 704], // 产品 + 'solution' => ['zh' => 345, 'en' => 716], // 解决方案 + 'support' => ['zh' => 355, 'en' => 724], // 服务支持 + 'news' => ['zh' => 361, 'en' => 730], // 新闻动态 + 'exhibition' => ['zh' => 364, 'en' => 733], // 展会与活动 + 'invest' => ['zh' => 365, 'en' => 734], // 投资者关系 + 'about' => ['zh' => 371, 'en' => 740], // 关于睿能 + 'search_hot' => ['zh' => 679, 'en' => 748], // 搜索-热门搜索词 + 'social_channel' => ['zh' => 707, 'en' => 749], // 社交频道 +]; diff --git a/public/themes/dist_static/static/css/common.css b/public/themes/dist_static/static/css/common.css index 035983d..c44ea00 100644 --- a/public/themes/dist_static/static/css/common.css +++ b/public/themes/dist_static/static/css/common.css @@ -292,7 +292,7 @@ font-display: swap; } */@font-face { font-family: "MiSans VF"; - src: url("../fonts/MiSans-VF-DESbBZLB.ttf") format("truetype"); + src: url("../fonts/MiSans-VF.subset.woff") format("woff"); font-weight: 100 900; font-style: normal; font-display: swap; @@ -1531,6 +1531,9 @@ body { grid-template-columns: repeat(7, max-content); justify-content: start; gap: 6.25rem; +} +html[lang="en"] .nav-mega__cols--solution { + gap: 2rem; }.nav-mega__col { display: flex; flex-direction: column; @@ -1741,6 +1744,9 @@ body { .nav-mega__cols--solution { gap: 32Px 24Px; } + html[lang="en"] .nav-mega__cols--solution { + gap: 2rem; + } }@media (max-width: 1439px) { .site-header__top, .site-header__nav, .site-header__search, .site-header__cta { display: none; @@ -1871,7 +1877,11 @@ body { gap: 1.5rem; }.site-footer__col { min-width: 0; -}.site-footer__colTitle { +} +html[lang="en"] .site-footer__col { + flex: 1; +} +.site-footer__colTitle { margin-bottom: 1.25rem; color: var(--color-text); font-family: "MiSans VF", sans-serif; diff --git a/public/themes/dist_static/static/fonts/MiSans-VF.subset.woff b/public/themes/dist_static/static/fonts/MiSans-VF.subset.woff new file mode 100644 index 0000000..8359771 Binary files /dev/null and b/public/themes/dist_static/static/fonts/MiSans-VF.subset.woff differ diff --git a/public/themes/dist_static/static/js/common.js b/public/themes/dist_static/static/js/common.js index bcd6ba0..9d04526 100644 --- a/public/themes/dist_static/static/js/common.js +++ b/public/themes/dist_static/static/js/common.js @@ -194,7 +194,7 @@ $(function() { if (!targetLang || targetLang === defaultLang) { path = rest ? `/${rest}` : "/"; } else { - path = rest ? `/${targetLang}/${rest}` : `/${targetLang}/`; + path = rest ? `/${targetLang}/${rest}` : `/${targetLang}`; } return path + location.search + location.hash; }; diff --git a/public/themes/website/1/en/demo/components/footer.html b/public/themes/website/1/en/demo/components/footer.html index 417382e..798f4f7 100644 --- a/public/themes/website/1/en/demo/components/footer.html +++ b/public/themes/website/1/en/demo/components/footer.html @@ -27,9 +27,13 @@