0408更新版本

main
huyuanxiang 2 weeks ago
parent b8f226a722
commit 92b8f73ec6

@ -6,13 +6,39 @@
<?php get_header() ?>
<!-- 新闻搜索功能模块 -->
<div class="news-search-section">
<div class="search-container">
<div class="search-header mt-[8rem]">
<h2 class="font-display text-[2.66rem] font-black text-slate-800 tracking-widest leading-[1.2] mb-6">新闻中心</h2>
<div class="w-16 h-1 bg-primary mx-auto mb-6 transition-all duration-700 group-hover:w-32"></div>
<section class="mt-[80px] relative w-full h-[45vh] min-h-[400px] max-h-[500px] flex flex-col justify-center overflow-hidden bg-slate-50 border-b border-slate-200/60">
<!-- 背景网格特效 -->
<div class="absolute inset-0 opacity-[0.03] pointer-events-none" style="background-image: linear-gradient(#10b981 1px, transparent 1px), linear-gradient(90deg, #10b981 1px, transparent 1px); background-size: 32px 32px;"></div>
<!-- 左上角光晕 -->
<div class="absolute top-0 left-0 w-[600px] h-[600px] bg-primary-light/40 rounded-full mix-blend-multiply filter blur-[100px] opacity-70 -translate-x-1/2 -translate-y-1/2 pointer-events-none"></div>
<!-- 右下角光晕 -->
<div class="absolute bottom-0 right-0 w-[500px] h-[500px] bg-accent-light/20 rounded-full mix-blend-multiply filter blur-[80px] opacity-60 translate-x-1/3 translate-y-1/3 pointer-events-none"></div>
<!-- 核心内容区 -->
<div class="relative z-10 max-w-7xl mx-auto px-6 lg:px-8 w-full text-center aos-init aos-animate" data-aos="fade-up" data-aos-duration="1000">
<!-- 标签栏 -->
<div class="inline-flex items-center justify-center gap-2 px-4 py-1.5 rounded-full bg-white shadow-sm border border-primary/10 text-primary-dark text-sm font-bold tracking-widest mb-6">
<span class="material-symbols-outlined text-[16px] text-primary">newspaper</span>
最新资讯
</div>
<div class="search-form-wrapper">
<!-- 主标题 -->
<h1 class="font-display text-[2.66rem] md:text-5xl font-black text-slate-800 tracking-wide leading-tight mb-4">
新闻中心
</h1>
<!-- 描述文本 -->
<p class="text-slate-500 text-[1rem] max-w-2xl mx-auto leading-relaxed font-medium mb-10">
关注企业最新动态、行业前沿资讯及重大活动报道,与您分享我们的成长与洞察。
</p>
<!-- 整合的 WordPress 搜索表单 -->
<div class="search-form-wrapper max-w-3xl mx-auto">
<?php
$form_action = home_url('/');
if (is_page()) {
@ -21,17 +47,19 @@
$form_action = get_category_link(get_queried_object_id());
}
?>
<form class="news-search-form" method="get" action="<?php echo esc_url($form_action); ?>">
<div class="search-controls">
<form class="news-search-form relative" method="get" action="<?php echo esc_url($form_action); ?>">
<!-- 添加了 Tailwind 样式构建一体式圆角搜索栏 -->
<div class="search-controls flex items-center bg-white rounded-full shadow-lg hover:shadow-xl transition-shadow duration-300 border border-slate-200/60 p-1.5">
<!-- 分类选择下拉菜单 -->
<div class="category-selector">
<div class="category-selector relative flex-shrink-0 border-slate-200 ">
<?php
$current_cat = isset($_GET['category']) ? $_GET['category'] : '';
if (empty($current_cat) && is_category()) {
$current_cat = get_queried_object()->slug;
}
?>
<select name="category" id="news-category" class="category-dropdown">
<select name="category" id="news-category" class="category-dropdown w-38 bg-transparent border-none text-slate-600 text-sm font-medium focus:ring-0 cursor-pointer pl-5 pr-8 py-3 appearance-none outline-none">
<option value="" data-url="<?php echo esc_url(home_url('/category/news-center/')); ?>" <?php selected(empty($current_cat) || $current_cat === 'news-center', true); ?>>显示全部</option>
<?php
$categories = get_categories(array(
@ -46,42 +74,53 @@
}
?>
</select>
<!-- 自定义下拉箭头图标 -->
<div class="absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
</div>
</div>
<!-- 搜索输入框 -->
<div class="search-input-wrapper">
<input type="text" name="search_keyword" id="news-search" class="search-input"
placeholder="关键词"
<div class="search-input-wrapper relative flex-grow">
<input type="text" name="search_keyword" id="news-search"
class="search-input w-full bg-transparent border-none text-slate-700 text-[15px] placeholder-slate-400 focus:ring-0 px-5 py-3 outline-none"
placeholder="输入关键词搜索新闻资讯..."
value="<?php echo isset($_GET['search_keyword']) ? esc_attr($_GET['search_keyword']) : ''; ?>"
autocomplete="off">
<div class="search-suggestions" id="search-suggestions"></div>
<div class="search-suggestions absolute top-full left-0 w-full mt-2 bg-white rounded-xl shadow-xl z-50" id="search-suggestions"></div>
</div>
<!-- 搜索按钮 -->
<button type="submit" class="search-button">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
<path d="M19 19L13 13M15 8C15 11.866 11.866 15 8 15C4.134 15 1 11.866 1 8C1 4.134 4.134 1 8 1C11.866 1 15 4.134 15 8Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<button type="submit" class="search-button flex items-center justify-center w-12 h-12 bg-primary hover:bg-primary-dark active:scale-95 text-white rounded-full transition-all duration-200 flex-shrink-0 group">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" class="group-hover:scale-110 transition-transform duration-200">
<path d="M19 19L13 13M15 8C15 11.866 11.866 15 8 15C4.134 15 1 11.866 1 8C1 4.134 4.134 1 8 1C11.866 1 15 4.134 15 8Z" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
<input type="hidden" name="post_type" value="post">
</form>
</div>
</div>
</div>
<!-- 文章展示组件 -->
<!-- 底部渐变线条 -->
<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-1/3 h-[2px] bg-gradient-to-r from-transparent via-primary/40 to-transparent"></div>
</section>
<!-- ================= 1. 新闻中心头部 & 搜索区 ================= -->
<!-- 文章列表板块 -->
<div class="article-list-section mt-[5rem]">
<div class="container">
<!-- ================= 2. 文章列表区 ================= -->
<div class="article-list-section py-16 md:py-24 bg-background">
<div class="container max-w-6xl mx-auto px-6 lg:px-8">
<div class="article-list-wrapper">
<?php
// 获取当前页码(用于分页,兼容页面模板)
// 获取当前页码
$paged = get_query_var('paged') ? get_query_var('paged') : (get_query_var('page') ? get_query_var('page') : 1);
// 获取文章列表(支持数字分页)
// 构建查询参数
$args = array(
'post_type' => 'post',
'posts_per_page' => 5,
@ -91,16 +130,13 @@
'paged' => $paged
);
// 如果是分类归档页面,添加分类筛选
if (is_category()) {
$args['cat'] = get_query_var('cat');
}
// 处理分类筛选URL参数优先
// 处理分类筛选
if (isset($_GET['category']) && !empty($_GET['category'])) {
$args['category_name'] = sanitize_text_field($_GET['category']);
// 修复:如果有明确的分类筛选参数,且该参数与当前归档分类不同,则移除归档分类限制
// 这样可以避免 "在分类A下搜索分类B" 导致的结果为空(除非文章同时属于两个分类)
if (isset($args['cat'])) {
unset($args['cat']);
}
@ -115,71 +151,82 @@
if ($articles_query->have_posts()) :
while ($articles_query->have_posts()) : $articles_query->the_post();
// 获取文章特色图片
$featured_image = get_the_post_thumbnail_url(get_the_ID(), 'medium');
$featured_image = get_the_post_thumbnail_url(get_the_ID(), 'medium_large');
if (!$featured_image) {
$featured_image = get_template_directory_uri() . '/assets/images/default-post.jpg';
}
// 获取文章摘要
$excerpt = get_the_excerpt();
if (empty($excerpt)) {
$excerpt = wp_trim_words(get_the_content(), 20, '...');
}
// 获取发布时间
$post_date = get_the_date('Y-m-d');
?>
<div class="article-list-item">
<div class="article-image">
<a href="<?php echo esc_url(get_permalink()); ?>">
<img src="<?php echo esc_url($featured_image); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">
<!-- 单个文章卡片 -->
<div class="article-list-item group flex flex-col md:flex-row gap-6 md:gap-8 mb-8 p-4 md:p-5 bg-white rounded-2xl border border-slate-100 shadow-[0_4px_20px_-4px_rgba(0,0,0,0.03)] hover:shadow-[0_8px_30px_-4px_rgba(0,0,0,0.08)] transition-all duration-300">
<!-- 左侧:文章图片 -->
<div class="article-image w-full md:w-[280px] lg:w-[320px] aspect-[4/3] md:aspect-[3/2] flex-shrink-0 rounded-xl overflow-hidden relative">
<a href="<?php echo esc_url(get_permalink()); ?>" class="block w-full h-full">
<img src="<?php echo esc_url($featured_image); ?>" alt="<?php echo esc_attr(get_the_title()); ?>" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-700 ease-out">
</a>
</div>
<div class="article-content">
<div class="article-meta">
<span class="article-date"><?php echo esc_html($post_date); ?></span>
<!-- 右侧:文章内容 -->
<div class="article-content flex flex-col justify-center flex-grow py-2 md:pr-4">
<div class="article-meta flex items-center gap-2 mb-3">
<span class="inline-block px-3 py-1 bg-slate-50 text-slate-500 rounded-md text-sm font-medium">
<?php echo esc_html($post_date); ?>
</span>
</div>
<h3 class="article-title">
<a href="<?php echo esc_url(get_permalink()); ?>"><?php echo esc_html(get_the_title()); ?></a>
<h3 class="article-title text-xl md:text-2xl font-bold text-slate-800 mb-3 line-clamp-2">
<a href="<?php echo esc_url(get_permalink()); ?>" class="hover:text-primary transition-colors duration-200">
<?php echo esc_html(get_the_title()); ?>
</a>
</h3>
<p class="article-excerpt"><?php echo esc_html($excerpt); ?></p>
<div class="article-actions">
<a href="<?php echo esc_url(get_permalink()); ?>" class="read-more-btn">
<span class="btn-circle"></span>
<p class="article-excerpt text-slate-500 leading-relaxed mb-6 line-clamp-2 flex-grow">
<?php echo esc_html($excerpt); ?>
</p>
<div class="article-actions mt-auto">
<a href="<?php echo esc_url(get_permalink()); ?>" class=" inline-flex items-center gap-2 text-sm font-bold text-slate-800 hover:text-primary transition-colors">
阅读详情
<span class="flex items-center justify-center w-8 h-8 rounded-full bg-slate-100 group-hover:bg-primary group-hover:text-white transition-colors duration-300">
&rarr;
</span>
</a>
</div>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
// 数字分页 - 修复静态首页模式下的分页URL问题
// 强大的分页器美化 (使用 Tailwind 的级联任意选择器)
$total_pages = $articles_query->max_num_pages;
if ($total_pages > 1) {
echo '<nav class="pagination">';
$big = 999999999; // 需要一个不太可能碰撞的整数
echo '<nav class="pagination mt-14 flex flex-wrap justify-center items-center gap-2
[&>a]:flex [&>a]:items-center [&>a]:justify-center [&>a]:w-10 [&>a]:h-10 [&>a]:rounded-lg [&>a]:bg-white [&>a]:border [&>a]:border-slate-200 [&>a]:text-slate-600 [&>a]:font-medium [&>a]:transition-colors hover:[&>a]:bg-primary hover:[&>a]:text-white hover:[&>a]:border-primary
[&>span.current]:flex [&>span.current]:items-center [&>span.current]:justify-center [&>span.current]:w-10 [&>span.current]:h-10 [&>span.current]:rounded-lg [&>span.current]:bg-primary [&>span.current]:text-white [&>span.current]:font-bold [&>span.current]:shadow-md
[&>.prev]:w-auto [&>.prev]:px-4 [&>.next]:w-auto [&>.next]:px-4">';
// 获取当前页面URLarchive.php的URL
$big = 999999999;
global $wp;
$current_url = home_url($wp->request);
// 如果是根目录访问archive.php需要特殊处理
if (empty($wp->request) || $wp->request === '/') {
// 为archive页面创建专门的URL结构
$base_url = home_url('/news'); // 使用/news作为归档页面的基础URL
$base_url = home_url('/news');
$format = '/page/%#%/';
} else {
$base_url = $current_url;
$format = '/page/%#%/';
}
// 检查是否使用了永久链接
if (get_option('permalink_structure')) {
$base = str_replace($big, '%#%', esc_url(get_pagenum_link($big)));
// 确保base URL不会与首页冲突
if (strpos($base, home_url('/page/')) === 0) {
$base = home_url('/news/page/%#%/');
}
@ -188,17 +235,16 @@
$format = '';
}
// 获取当前查询参数
$current_query = $_GET;
unset($current_query['paged']); // 移除paged参数避免重复
unset($current_query['paged']);
echo paginate_links(array(
'base' => $base,
'format' => $format,
'current' => max(1, $paged),
'total' => $articles_query->max_num_pages,
'prev_text' => '&laquo; 上一页',
'next_text' => '下一页 &raquo;',
'prev_text' => '&larr; 上一页',
'next_text' => '下一页 &rarr;',
'add_args' => $current_query,
'add_fragment' => false,
));
@ -206,14 +252,22 @@
}
?>
<?php else : ?>
<div class="no-articles">
<p>暂无文章发布</p>
<!-- 暂无文章空状态 -->
<div class="no-articles py-20 text-center bg-slate-50/50 rounded-2xl border border-dashed border-slate-200">
<div class="inline-flex items-center justify-center w-16 h-16 rounded-full bg-white shadow-sm mb-4">
<span class="material-symbols-outlined text-[32px] text-slate-300">article</span>
</div>
<h3 class="text-xl font-bold text-slate-700 mb-2">暂无相关资讯</h3>
<p class="text-slate-500">抱歉,目前没有找到相关的文章或新闻,请稍后再来看看吧。</p>
</div>
<?php endif; ?>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
var categorySelect = document.getElementById('news-category');

@ -303,9 +303,9 @@
transition: opacity 0.3s ease;
}
.transition-transform {
/* .transition-transform {
transition: transform 0.3s ease;
}
} */
.transition-colors {
transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;

@ -12,7 +12,7 @@
/* 页脚容器 */
.footer-container {
max-width: 1200px;
max-width: 1320px;
margin: 0 auto;
padding: 0 20px;
}
@ -23,7 +23,7 @@
justify-content: space-between;
align-items: flex-start;
margin-bottom: 40px;
gap: 60px;
gap: 100px;
}
/* 左侧Logo区域 */
@ -44,6 +44,7 @@
flex: 1;
display: flex;
gap: 4rem;
justify-content: space-between;
}
/* 导航列 */

@ -11,7 +11,8 @@
/* 确保不受全局样式影响 */
.single-page-container {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
/* font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; */
background-color: rgb(248,250,252);
}
.single-page-container a {
@ -28,7 +29,7 @@
/* 主容器布局 */
.single-page-container {
display: flex;
max-width: 1400px;
max-width: 1320px;
margin: 0 auto;
gap: 40px;
padding: 20px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 KiB

After

Width:  |  Height:  |  Size: 354 KiB

@ -10,7 +10,7 @@
</a>
<!-- 社交媒体矩阵模块 (已替换为您提供的原版 SVG 源码) -->
<div class="flex items-center gap-4 mt-6">
<div class="flex items-center gap-4 mt-6 justify-center">
<!-- 1. 微信公众号 (您提供的SVG) -->
<div class="relative group cursor-pointer">
@ -28,7 +28,7 @@
<!-- 二维码悬浮弹窗 -->
<div class="absolute bottom-[120%] left-1/2 -translate-x-1/2 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-300 z-50 translate-y-2 group-hover:translate-y-0">
<div class="w-32 bg-white rounded-xl shadow-[0_15px_40px_rgba(0,0,0,0.12)] border border-slate-100 p-2.5 relative flex flex-col items-center">
<img src="https://via.placeholder.com/150?text=QR+Code" alt="微信公众号" class="w-full aspect-square object-cover rounded-lg border border-slate-100">
<img src="https://cn.nenghui.com/wp-content/uploads/2026/04/wechat-qrcode.png" alt="微信公众号" class="w-full aspect-square object-cover rounded-lg border border-slate-100">
<span class="text-[13px] font-bold text-slate-700 mt-2 mb-1">微信公众号</span>
<div class="absolute -bottom-2 left-1/2 -translate-x-1/2 w-4 h-4 bg-white border-b border-r border-slate-100 transform rotate-45"></div>
</div>
@ -46,7 +46,7 @@
<!-- 二维码悬浮弹窗 -->
<div class="absolute bottom-[120%] left-1/2 -translate-x-1/2 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-300 z-50 translate-y-2 group-hover:translate-y-0">
<div class="w-32 bg-white rounded-xl shadow-[0_15px_40px_rgba(0,0,0,0.12)] border border-slate-100 p-2.5 relative flex flex-col items-center">
<img src="https://via.placeholder.com/150?text=QR+Code" alt="官方视频号" class="w-full aspect-square object-cover rounded-lg border border-slate-100">
<img src="https://cn.nenghui.com/wp-content/uploads/2026/04/wechat-vedio-qrcode.png" alt="官方视频号" class="w-full aspect-square object-cover rounded-lg border border-slate-100">
<span class="text-[13px] font-bold text-slate-700 mt-2 mb-1">官方视频号</span>
<div class="absolute -bottom-2 left-1/2 -translate-x-1/2 w-4 h-4 bg-white border-b border-r border-slate-100 transform rotate-45"></div>
</div>
@ -64,7 +64,7 @@
<!-- 二维码悬浮弹窗 -->
<div class="absolute bottom-[120%] left-1/2 -translate-x-1/2 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-300 z-50 translate-y-2 group-hover:translate-y-0">
<div class="w-32 bg-white rounded-xl shadow-[0_15px_40px_rgba(0,0,0,0.12)] border border-slate-100 p-2.5 relative flex flex-col items-center">
<img src="https://via.placeholder.com/150?text=QR+Code" alt="官方抖音号" class="w-full aspect-square object-cover rounded-lg border border-slate-100">
<img src="https://cn.nenghui.com/wp-content/uploads/2026/04/wechat-dy-qrcode.png" alt="官方抖音号" class="w-full aspect-square object-cover rounded-lg border border-slate-100">
<span class="text-[13px] font-bold text-slate-700 mt-2 mb-1">官方抖音号</span>
<div class="absolute -bottom-2 left-1/2 -translate-x-1/2 w-4 h-4 bg-white border-b border-r border-slate-100 transform rotate-45"></div>
</div>
@ -82,10 +82,10 @@
<h3 class="footer-nav-title">关于能辉</h3>
<ul class="footer-nav-list">
<li><a href="/about/">公司介绍</a></li>
<li><a href="/henghui-core/">资质与荣誉</a></li>
<li><a href="/sustainable-evelopment/">企业文化</a></li>
<li><a href="/sustainable-evelopment/">可持续发展</a></li>
<li><a href="/sustainable-evelopment/">加入我们</a></li>
<li><a href="/certs-honors/">资质与荣誉</a></li>
<li><a href="/corporate-culture/">企业文化</a></li>
<li><a href="/sustainable-evelopment-2/">可持续发展</a></li>
<li><a href="/join-us/">加入我们</a></li>
</ul>
</div>
@ -96,19 +96,26 @@
<div class="footer-nav-column">
<h3 class="footer-nav-title">产品与服务</h3>
<ul class="footer-nav-list">
<li><a href="/about/">光伏和风力发电</a></li>
<li><a href="/solar-wind/">光伏和风力发电</a></li>
<li><a href="/products/">储能</a></li>
<li><a href="/charge-change/">商用车充换电</a></li>
<li><a href="/sustainable-evelopment/">综合能源</a></li>
<li><a href="/multi-energy/">综合能源</a></li>
</ul>
</div>
<!-- 投资者关系 -->
<div class="footer-nav-column">
<h3 class="footer-nav-title">
<a href="/investing/">投资者关系</a>
<h3 class="footer-nav-title">投资者关系
</h3>
<ul class="footer-nav-list">
<li><a href="/investing/">公司治理</a></li>
<li><a href="/investing/">公司公告</a></li>
<li><a href="/investing/">投资者交流</a></li>
</ul>
</div>

@ -38,8 +38,8 @@
"slate-heading": "#0f172a"
},
fontFamily: {
"display": ["Montserrat", "sans-serif"],
"sans": ["Inter", "sans-serif"],
"display": ['PingFang SC', "Montserrat", 'Microsoft YaHei',"sans-serif"],
"sans": [ 'PingFang SC', "Montserrat", 'Microsoft YaHei', "sans-serif"],
},
boxShadow: {
'soft': '0 20px 40px -15px rgba(0,0,0,0.05)',
@ -49,7 +49,11 @@
textShimmer: { '0%': { backgroundPosition: '0% 50%' }, '100%': { backgroundPosition: '100% 50%' } },
scroll: { '0%': { transform: 'translateX(0)' }, '100%': { transform: 'translateX(-50%)' } },
scrollLeft: { '0%': { transform: 'translateX(0)' }, '100%': { transform: 'translateX(-50%)' } },
scrollRight: { '0%': { transform: 'translateX(-50%)' }, '100%': { transform: 'translateX(0)' } }
scrollRight: { '0%': { transform: 'translateX(-50%)' }, '100%': { transform: 'translateX(0)' } },
flowMove: {
'0%': { transform: 'translateX(-100%)' },
'100%': { transform: 'translateX(600%)' }
}
},
animation: {
'text-shimmer': 'textShimmer 3s ease-out infinite alternate',
@ -58,6 +62,7 @@
'scroll-reverse': 'scroll-reverse 45s linear infinite',
'scroll-left': 'scrollLeft 40s linear infinite',
'scroll-right': 'scrollRight 45s linear infinite',
}
},
},
@ -74,6 +79,9 @@
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
[data-aos] {
transition-property: all !important;
}
}
</style>
</head>

@ -26,10 +26,10 @@ function load_theme_assets() {
'font-awesome' => '/assets/fontawesome/css/all.min.css',
'theme-header-css' => '/assets/css/header.css',
'theme-index-css' => '/assets/css/index.css',
'animate-css' => '/assets/css/animate.min.css',
'custom-animations' => '/assets/css/animations.css',
'scroll-animations-css' => '/assets/css/scroll-animations.css',
'smooth-scroll-css' => '/assets/css/smooth-scroll.css',
// 'animate-css' => '/assets/css/animate.min.css',
// 'custom-animations' => '/assets/css/animations.css',
// 'scroll-animations-css' => '/assets/css/scroll-animations.css',
// 'smooth-scroll-css' => '/assets/css/smooth-scroll.css',
'search-css' => '/assets/css/search.css',
'navigation-menu-css' => '/assets/css/navigation-menu.css',
'footer-css' => '/assets/css/footer.css',
@ -59,8 +59,8 @@ function load_theme_assets() {
// 安全加载JavaScript文件 - 优化GSAP和Swiper兼容性
$js_files = array(
// 基础库 - 最先加载
'smoothscroll' => array('file' => '/assets/js/smoothscroll.min.js', 'deps' => array(), 'ver' => '1.4.10'),
'smooth-scroll-init' => array('file' => '/assets/js/smooth-scroll-init.js', 'deps' => array('smoothscroll'), 'ver' => '1.0.0'),
// 'smoothscroll' => array('file' => '/assets/js/smoothscroll.min.js', 'deps' => array(), 'ver' => '1.4.10'),
// 'smooth-scroll-init' => array('file' => '/assets/js/smooth-scroll-init.js', 'deps' => array('smoothscroll'), 'ver' => '1.0.0'),
// GSAP核心库 - 已启用,优化加载顺序
'gsap' => array('file' => '/assets/js/gsap.min.js', 'deps' => array('jquery'), 'ver' => '3.12.2'),

@ -14,21 +14,22 @@ wp_enqueue_style('about-features-css', get_template_directory_uri() . '/assets/c
wp_enqueue_script('about-features-js', get_template_directory_uri() . '/assets/js/about-features.js', array(), '1.0.0', true);
?>
<div class="page-full-width mt-[80px]">
<div class="relative page-full-width mt-[80px] bg-slate-50 border-slate-200/60">
<!-- 关于能辉Banner -->
<section class="relative w-full h-[30vh] flex flex-col items-center justify-center z-10 border-slate-100">
<div class="about-banner-content">
<section class="relative w-full flex flex-col items-center justify-center z-10 border-slate-100">
<div class="about-banner-content !pb-[5rem]">
<h2 class="font-display text-[2.66rem] font-black text-slate-800 tracking-widest leading-[1.2] mb-2">公司介绍</h1>
<div class="w-16 h-1 bg-primary mx-auto mb-6 transition-all duration-700 group-hover:w-32"></div>
<div class="w-20 h-1.5 bg-gradient-to-r from-primary to-teal-400 mx-auto mt-6 rounded-full"></div>
</div>
</section>
<div class="absolute inset-0 opacity-[0.03] pointer-events-none" style="background-image: linear-gradient(#10b981 1px, transparent 1px), linear-gradient(90deg, #10b981 1px, transparent 1px); background-size: 32px 32px;"></div>
<div class="absolute top-0 left-0 w-[600px] h-[600px] bg-primary-light/40 rounded-full mix-blend-multiply filter blur-[100px] opacity-70 -translate-x-1/2 -translate-y-1/2 pointer-events-none"></div>
<div class="absolute bottom-0 right-0 w-[500px] h-[500px] bg-accent-light/20 rounded-full mix-blend-multiply filter blur-[80px] opacity-60 translate-x-1/3 translate-y-1/3 pointer-events-none"></div>
<!-- 页面内容区域 -->
<!-- ===================== 模块:企业简介 ===================== -->
<section id="section-about" class="scroll-section relative w-full px-6 lg:px-16 xl:px-24 py-24 bg-white border-b border-slate-200/60 scroll-mt-0">
<section id="section-about" class="scroll-section relative w-full px-6 lg:px-16 xl:px-24 py-24 border-b border-slate-200/60 scroll-mt-0">
<div class="grid grid-cols-1 lg:grid-cols-12 gap-12 lg:gap-20 items-center max-w-[100rem] mx-auto">
<!-- 左侧:文本与介绍 -->
@ -112,10 +113,10 @@ wp_enqueue_script('about-features-js', get_template_directory_uri() . '/assets/j
<!-- 短线条 + 标题 -->
<div class="flex items-center gap-4 mb-6">
<div class="w-1.5 h-10 bg-primary rounded-full shadow-[0_4px_10px_rgba(16,185,129,0.4)]"></div>
<h3 class="text-3xl lg:text-4xl font-display font-bold text-slate-heading">技术领先</h3>
<h3 class="text-3xl font-display font-bold text-slate-heading">设计一流</h3>
</div>
<p class="text-lg text-slate-text leading-relaxed mb-8">
公司拥有超过200项各类知识产权与清华大学、浙江大学、上海交通大学建立了长期技术合作伙伴关系在光伏、储能、充换电、综合能源等领域深耕多年具备全面技术领先优势
创始人及核心管理团队均来自于省级电力设计院,且长期致力于智慧能源和环保领域的设计与研究,有较强的专业背景,特别体现在电力设计、工程设计等领域具备一流能力
</p>
</div>
@ -127,17 +128,18 @@ wp_enqueue_script('about-features-js', get_template_directory_uri() . '/assets/j
<div class="order-1 lg:order-1 flex flex-col justify-center" data-aos="fade-right">
<div class="flex items-center gap-4 mb-6">
<div class="w-1.5 h-10 bg-accent rounded-full shadow-[0_4px_10px_rgba(249,115,22,0.4)]"></div>
<h3 class="text-3xl lg:text-4xl font-display font-bold text-slate-heading">设计一流</h3>
<h3 class="text-3xl font-display font-bold text-slate-heading"> 技术领先</h3>
</div>
<p class="text-lg text-slate-text leading-relaxed mb-8">
创始人及核心管理团队均来自于省级电力设计院,且长期致力于智慧能源和环保领域的设计与研究,有较强的专业背景,特别体现在电力设计、工程设计等领域具备一流能力。
公司拥有超过200项各类知识产权与清华大学、浙江大学、上海交通大学建立了长期技术合作伙伴关系在光伏、储能、充换电、综合能源等领域深耕多年具备全面技术领先优势
</p>
</div>
<div class="order-2 lg:order-2 relative rounded-[2rem] overflow-hidden shadow-2xl shadow-slate-200/60 border border-slate-100 group" data-aos="fade-left">
<img src="https://cn.nenghui.com/wp-content/uploads/2026/04/about-1.png" alt="Data Analytics" class="w-full aspect-[6/3] object-cover group-hover:scale-105 transition-transform duration-700"/>
<img src="https://cn.nenghui.com/wp-content/uploads/2026/04/about-2.png" alt="Data Analytics" class="w-full aspect-[6/3] object-cover group-hover:scale-105 transition-transform duration-700"/>
</div>
</div>
@ -147,17 +149,17 @@ wp_enqueue_script('about-features-js', get_template_directory_uri() . '/assets/j
<div class="order-2 lg:order-1 relative rounded-[2rem] overflow-hidden shadow-2xl shadow-slate-200/60 border border-slate-100 group bg-white p-2" data-aos="fade-right">
<!-- 微交互视差框 -->
<div data-tilt data-tilt-max="3" data-tilt-speed="400" data-tilt-glare="true" data-tilt-max-glare="0.1" class="w-full h-full rounded-[1.5rem] overflow-hidden">
<img src="https://cn.nenghui.com/wp-content/uploads/2026/04/about-2.png" alt="API Integration" class="w-full aspect-[6/3] object-cover"/>
<img src="https://cn.nenghui.com/wp-content/uploads/2026/04/about-1.png" alt="API Integration" class="w-full aspect-[6/3] object-cover"/>
</div>
</div>
<div class="order-1 lg:order-2 flex flex-col justify-center" data-aos="fade-left">
<div class="flex items-center gap-4 mb-6">
<div class="w-1.5 h-10 bg-gradient-to-r from-primary to-blue-500 rounded-full shadow-[0_4px_10px_rgba(16,185,129,0.3)]"></div>
<h3 class="text-3xl lg:text-4xl font-display font-bold text-slate-heading">产品可靠</h3>
<h3 class="text-3xl font-display font-bold text-slate-heading">产品可靠</h3>
</div>
<p class="text-lg text-slate-text leading-relaxed mb-8">
公司已经累计为客户提供了近200个中大型新能源电站、一大批电力环保及电网工程的总包服务也为海内外客户提供高性能储能产品和电动重卡充换电设备质量可靠
公司已经累计为客户提供了近200个中大型新能源电站、一大批电力环保及电网工程的总包服务也为海内外客户提供高性能储能产品和电动重卡充换电设备质量可靠
</p>

@ -9,7 +9,7 @@
<aside class="sidebar-left" role="complementary" aria-label="相关文章">
<header class="sidebar-header">
<nav aria-label="返回导航">
<a href="<?php echo esc_url(get_post_type_archive_link('post')); ?>"
<a href="/category/news-center"
class="back-link"
aria-label="返回新闻中心">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">

@ -8,7 +8,7 @@ get_header(); ?>
<div class="news-search-section">
<div class="search-container">
<div class="search-header">
<h2 class="font-display text-[2.66rem] font-black text-slate-800 tracking-widest leading-[1.2] mb-6">新闻中心</h2>
<h2 class="font-display text-[2.66rem] font-black text-slate-800 tracking-widest leading-[1.2] mb-6">新闻中心2</h2>
<div class="w-12 h-1 bg-primary mx-auto"></div>
</div>
<div class="search-form-wrapper">

@ -4,28 +4,59 @@
*/
?>
<?php get_header(); ?>
<!-- 新闻搜索功能模块 -->
<div class="news-search-section">
<div class="search-container">
<div class="search-header">
<h2 class="search-title">新闻中心</h2>
<div class="w-12 h-1 bg-primary mx-auto"></div>
<section class="mt-[80px] relative w-full h-[45vh] min-h-[400px] max-h-[500px] flex flex-col justify-center overflow-hidden bg-slate-50 border-b border-slate-200/60">
<!-- 背景网格特效 -->
<div class="absolute inset-0 opacity-[0.03] pointer-events-none" style="background-image: linear-gradient(#10b981 1px, transparent 1px), linear-gradient(90deg, #10b981 1px, transparent 1px); background-size: 32px 32px;"></div>
<!-- 左上角光晕 -->
<div class="absolute top-0 left-0 w-[600px] h-[600px] bg-primary-light/40 rounded-full mix-blend-multiply filter blur-[100px] opacity-70 -translate-x-1/2 -translate-y-1/2 pointer-events-none"></div>
<!-- 右下角光晕 -->
<div class="absolute bottom-0 right-0 w-[500px] h-[500px] bg-accent-light/20 rounded-full mix-blend-multiply filter blur-[80px] opacity-60 translate-x-1/3 translate-y-1/3 pointer-events-none"></div>
<!-- 核心内容区 -->
<div class="relative z-10 max-w-7xl mx-auto px-6 lg:px-8 w-full text-center aos-init aos-animate" data-aos="fade-up" data-aos-duration="1000">
<!-- 标签栏 -->
<div class="inline-flex items-center justify-center gap-2 px-4 py-1.5 rounded-full bg-white shadow-sm border border-primary/10 text-primary-dark text-sm font-bold tracking-widest mb-6">
<span class="material-symbols-outlined text-[16px] text-primary">newspaper</span>
最新资讯
</div>
<div class="search-form-wrapper">
<!-- 主标题 -->
<h1 class="font-display text-[2.66rem] md:text-5xl font-black text-slate-800 tracking-wide leading-tight mb-4">
新闻中心
</h1>
<!-- 描述文本 -->
<p class="text-slate-500 text-[1rem] max-w-2xl mx-auto leading-relaxed font-medium mb-10">
关注企业最新动态、行业前沿资讯及重大活动报道,与您分享我们的成长与洞察。
</p>
<!-- 整合的 WordPress 搜索表单 -->
<div class="search-form-wrapper max-w-3xl mx-auto">
<?php
$form_action = home_url('/');
if (is_page()) {
$form_action = get_permalink(get_queried_object_id());
} elseif (is_category()) {
$form_action = get_category_link(get_queried_object_id());
}
?>
<form class="news-search-form" method="get" action="<?php echo esc_url($form_action); ?>">
<div class="search-controls">
<form class="news-search-form relative" method="get" action="<?php echo esc_url($form_action); ?>">
<!-- 添加了 Tailwind 样式构建一体式圆角搜索栏 -->
<div class="search-controls flex items-center bg-white rounded-full shadow-lg hover:shadow-xl transition-shadow duration-300 border border-slate-200/60 p-1.5">
<!-- 分类选择下拉菜单 -->
<div class="category-selector">
<div class="category-selector relative flex-shrink-0 border-slate-200 ">
<?php
$current_cat = isset($_GET['category']) ? $_GET['category'] : '';
if (empty($current_cat) && is_category()) {
$current_cat = get_queried_object()->slug;
}
?>
<select name="category" id="news-category" class="category-dropdown">
<select name="category" id="news-category" class="category-dropdown w-38 bg-transparent border-none text-slate-600 text-sm font-medium focus:ring-0 cursor-pointer pl-5 pr-8 py-3 appearance-none outline-none">
<option value="" data-url="<?php echo esc_url(home_url('/category/news-center/')); ?>" <?php selected(empty($current_cat) || $current_cat === 'news-center', true); ?>>显示全部</option>
<?php
$categories = get_categories(array(
@ -40,36 +71,48 @@
}
?>
</select>
<!-- 自定义下拉箭头图标 -->
<div class="absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path></svg>
</div>
</div>
<!-- 搜索输入框 -->
<div class="search-input-wrapper">
<input type="text" name="s" id="news-search" class="search-input"
placeholder="关键词"
value="<?php echo get_search_query(); ?>"
<div class="search-input-wrapper relative flex-grow">
<input type="text" name="search_keyword" id="news-search"
class="search-input w-full bg-transparent border-none text-slate-700 text-[15px] placeholder-slate-400 focus:ring-0 px-5 py-3 outline-none"
placeholder="输入关键词搜索新闻资讯..."
value="<?php echo isset($_GET['search_keyword']) ? esc_attr($_GET['search_keyword']) : ''; ?>"
autocomplete="off">
<div class="search-suggestions" id="search-suggestions"></div>
<div class="search-suggestions absolute top-full left-0 w-full mt-2 bg-white rounded-xl shadow-xl z-50" id="search-suggestions"></div>
</div>
<!-- 搜索按钮 -->
<button type="submit" class="search-button">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
<path d="M19 19L13 13M15 8C15 11.866 11.866 15 8 15C4.134 15 1 11.866 1 8C1 4.134 4.134 1 8 1C11.866 1 15 4.134 15 8Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<button type="submit" class="search-button flex items-center justify-center w-12 h-12 bg-primary hover:bg-primary-dark active:scale-95 text-white rounded-full transition-all duration-200 flex-shrink-0 group">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" class="group-hover:scale-110 transition-transform duration-200">
<path d="M19 19L13 13M15 8C15 11.866 11.866 15 8 15C4.134 15 1 11.866 1 8C1 4.134 4.134 1 8 1C11.866 1 15 4.134 15 8Z" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</button>
</div>
<input type="hidden" name="post_type" value="post">
</form>
</div>
</div>
</div>
<!-- 底部渐变线条 -->
<div class="absolute bottom-0 left-1/2 -translate-x-1/2 w-1/3 h-[2px] bg-gradient-to-r from-transparent via-primary/40 to-transparent"></div>
</section>
<!-- 新闻搜索功能模块 -->
<div class="single-page-container">
<!-- 左侧文章列表侧边栏 -->
<aside class="sidebar-left" role="complementary" aria-label="相关文章">
<header class="sidebar-header">
<nav aria-label="返回导航">
<a href="https://cn.nenghui.com/news-center/"
<a href="/category/news-center"
class="back-link"
aria-label="返回新闻中心">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">

@ -23,7 +23,7 @@ html, body {
}
body {
background: #f7f7f7 !important;
background: rgb(248,250,252) !important;
}
@ -105,13 +105,13 @@ p.article-time{
}
.nav-container {
max-width: 1200px;
max-width: 1320px;
margin: 0 auto;
padding: 0 20px;
height: 100%;
display: flex;
align-items: center;
/* justify-content: space-between; */
justify-content: space-between;
overflow: visible;
}
@ -137,8 +137,7 @@ p.article-time{
}
.nav-logo img {
height: 30px;
width: auto;
width: 200px;
}
.nav-logo span {

@ -48,7 +48,7 @@ if (!empty($block['align'])) {
</div>
<h2 class="text-3xl md:text-4xl font-display font-bold text-slate-heading">生态合作伙伴</h2>
<div class="w-12 h-1 bg-gradient-to-r from-primary to-teal-400 mx-auto mt-4 rounded-full shadow-md"></div>
<p class="mt-6 text-slate-500 max-w-2xl mx-auto text-base">与全球顶尖企业并肩,共同驱动能源产业的数字化变革</p>
<p class="mt-6 text-slate-500 max-w-2xl mx-auto text-base">与全球顶尖企业并肩,共同驱动能源产业的数字化变革</p>
</div>
</div>
@ -60,7 +60,7 @@ if (!empty($block['align'])) {
<div class="absolute right-0 top-0 bottom-0 w-24 md:w-48 bg-gradient-to-l from-white via-white/80 to-transparent z-30 pointer-events-none"></div>
<!-- ================= 第一行轨道:向左滚动 (animate-scroll-left) ================= -->
<div class="flex w-max animate-scroll-left hover:\[animation-play-state:paused\] group relative z-20">
<div class="flex w-max animate-scroll-left hover:[animation-play-state:paused] group relative z-20">
<!-- 【第一组数据】 hzhb1 - hzhb12 -->
<div class="flex items-center gap-10 md:gap-16 px-5 md:px-8">
@ -158,7 +158,7 @@ if (!empty($block['align'])) {
</div>
<!-- ================= 第二行轨道:向右滚动 (animate-scroll-right) ================= -->
<div class="flex w-max animate-scroll-right hover:\[animation-play-state:paused\] group relative z-20 -ml-16 lg:-ml-32">
<div class="flex w-max animate-scroll-right hover:[animation-play-state:paused] group relative z-20 -ml-16 lg:-ml-32">
<!-- 【第一组数据】 hzhb13 - hzhb23 -->
<div class="flex items-center gap-10 md:gap-16 px-5 md:px-8">
@ -249,6 +249,7 @@ if (!empty($block['align'])) {
</section>
<style>
.group > div > div:hover > div[class*="blur-md"] {
@ -256,7 +257,7 @@ if (!empty($block['align'])) {
transform: translateX(-50%) scaleX(1.3);
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.js"></script>
<script>
// AOS 初始化

Loading…
Cancel
Save