Browse Source

feat(about-history): 更新关于历史页面的内容和链接,添加动态内容展示功能

master
peijunlei 2 weeks ago
parent
commit
29779b5011
  1. 2
      config/ui_ids.php
  2. 119
      public/themes/website/1/en/demo/about-history.html
  3. 7
      public/themes/website/1/en/demo/about.html

2
config/ui_ids.php

@ -33,7 +33,7 @@ return [
'about' => ['zh' => 371, 'en' => 740], // 关于睿能 'about' => ['zh' => 371, 'en' => 740], // 关于睿能
'about_intro' => ['zh' => 372, 'en' => 741], // 公司简介 'about_intro' => ['zh' => 372, 'en' => 741], // 公司简介
'about_history' => ['zh' => 373, 'en' => 742], // 发展历史 'about_history' => ['zh' => 373, 'en' => 742], // 发展历史
'about_history_page' => ['zh' => 759, 'en' => 0], // 发展历程详情页(栏目路由)
'about_history_page' => ['zh' => 759, 'en' => 760], // 发展历程详情页(栏目路由)
'about_culture' => ['zh' => 374, 'en' => 743], // 企业文化 'about_culture' => ['zh' => 374, 'en' => 743], // 企业文化
'about_global' => ['zh' => 375, 'en' => 744], // 全球布局 'about_global' => ['zh' => 375, 'en' => 744], // 全球布局
'about_members' => ['zh' => 376, 'en' => 745], // 集团成员 'about_members' => ['zh' => 376, 'en' => 745], // 集团成员

119
public/themes/website/1/en/demo/about-history.html

@ -0,0 +1,119 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{$current_cate.seo_title}</title>
<meta name="keywords" content="{$current_cate.seo_keywords}">
<meta name="description" content="{$current_cate.seo_description}">
<!-- 公共CSS 自动被打包进页面 -->
<link rel="icon" href="./favicon.ico" type="image/x-icon">
<script>
// 设计稿 1920px 宽度下 1rem = 16Px;放在 head 里避免刷新时 rem 闪动
(function () {
var h = document.documentElement
// 设计稿宽度
var DESIGN_WIDTH = 1920
// 设计稿1rem = 16Px
var REM_AT_DESIGN = 16
// 最小字体大小-限制, 同时注意所有的box的大小也有了最小限制
var MIN_ROOT_FONT_SIZE = 14
function setRootFontSize() {
// 当前屏幕可视宽度(每次计算都取最新值)
var W = h.getBoundingClientRect().width
var size = (W / DESIGN_WIDTH) * REM_AT_DESIGN
if (size < MIN_ROOT_FONT_SIZE) size = MIN_ROOT_FONT_SIZE
h.style.fontSize = size + 'px'
}
setRootFontSize()
var resizeRaf = 0
window.addEventListener('resize', function () {
if (resizeRaf) return
resizeRaf = requestAnimationFrame(function () {
resizeRaf = 0
setRootFontSize()
})
})
})()
</script>
<link rel="stylesheet" href="https://unpkg.com/lenis@1.3.23/dist/lenis.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net.cn/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link href="https://cdn.jsdelivr.net.cn/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css">
<script type="module" crossorigin src="/themes/dist_static/static/js/about-history.js"></script>
<link rel="modulepreload" crossorigin href="/themes/dist_static/static/js/common.js">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/common.css">
<link rel="stylesheet" crossorigin href="/themes/dist_static/static/css/about-history.css">
</head>
<body>
<!-- 引入公共头部 -->
<!-- header -->
{include file="components/header"}
<main class="main-about-history" data-header-dark data-nav="About Raynen">
{php}
$ui_about_history = uiId('about_history');
$seller_id = (int)($seller_id ?? 1);
$history_items = getContentByCategory($ui_about_history, $seller_id, 9999, 'sort desc', []);
if (!is_array($history_items)) {
$history_items = [];
}
usort($history_items, function ($a, $b) {
return (int)($b['sub_title'] ?? 0) - (int)($a['sub_title'] ?? 0);
});
foreach ($history_items as &$history_item) {
if (!empty($history_item['content'])) {
$history_item['content'] = htmlspecialchars_decode($history_item['content']);
}
}
unset($history_item);
{/php}
<div class="ah-page section__wrap">
<div class="ah-layout" data-ah-spy>
<nav class="ah-nav__years" aria-label="Year navigation">
{volist name="history_items" id="item" key="hk"}
{php}$year = trim((string)($item['sub_title'] ?? ''));{/php}
{if $year !== ''}
<a class="ah-nav__item{if $hk == 1} is-active{/if}" href="#year-{$year}" data-year="{$year}">
<span class="ah-nav__year">{$year}</span>
</a>
{/if}
{/volist}
</nav>
<div class="ah-nav__rail" aria-hidden="true">
<span class="ah-nav__indicator"></span>
</div>
<div class="ah-content">
{volist name="history_items" id="item"}
{php}$year = trim((string)($item['sub_title'] ?? ''));{/php}
{if $year !== ''}
<section class="ah-block" id="year-{$year}" data-year="{$year}">
<div class="ah-richtext">
{$item.content|raw}
</div>
</section>
{/if}
{/volist}
</div>
</div>
</div>
</main>
{include file="components/mask"}
{include file="components/footer"}
<script src="https://unpkg.com/lenis@1.3.23/dist/lenis.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3/dist/ScrollTrigger.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net.cn/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/aos@2.3.4/dist/aos.min.js"></script>
</body>
</html>

7
public/themes/website/1/en/demo/about.html

@ -135,7 +135,12 @@
<time class="ab-history__year" datetime="2025">{$case_top.sub_title}</time> <time class="ab-history__year" datetime="2025">{$case_top.sub_title}</time>
<div class="ab-history__dot" aria-hidden="true"></div> <div class="ab-history__dot" aria-hidden="true"></div>
<h3 class="ab-history__slide-title">{$case_top.title}</h3> <h3 class="ab-history__slide-title">{$case_top.title}</h3>
<!-- <p class="ab-history__slide-desc">{$case_top.content|strip_tags|raw}</p>-->
<a class="ab-history__more" href="{:getMuiLangUrl('/about-history.html')}#year-{$case_top.sub_title}">
<span>Learn more</span>
<svg viewBox="0 0 16.502 6.66113" xmlns="http://www.w3.org/2000/svg" width="16.502" height="6.661" fill="none" aria-hidden="true">
<path d="M0 2.83057L16 2.83057L16 3.83057L0 3.83057L0 2.83057ZM15.2929 3.33057L12.818 0.855693C12.62 0.657703 12.62 0.346575 12.818 0.148586C13.016 -0.0494041 13.3271 -0.0494046 13.5251 0.148585L16.3536 2.97701C16.5515 3.175 16.5515 3.48613 16.3536 3.68412L13.5251 6.51255C13.3271 6.71054 13.016 6.71054 12.818 6.51255C12.62 6.31456 12.62 6.00343 12.818 5.80544L15.2929 3.33057Z" fill="currentColor" fill-rule="nonzero" />
</svg>
</a>
<div class="ab-history__media"> <div class="ab-history__media">
<img src="{$case_top.thumbnail.url ?? ''}" alt="" width="400" height="260" loading="lazy" /> <img src="{$case_top.thumbnail.url ?? ''}" alt="" width="400" height="260" loading="lazy" />
</div> </div>

Loading…
Cancel
Save