@@ -461,11 +464,11 @@
diff --git a/frontend/website/js/main.js b/frontend/website/js/main.js
index 964a022..df40cbf 100644
--- a/frontend/website/js/main.js
+++ b/frontend/website/js/main.js
@@ -28,20 +28,65 @@ document.addEventListener('DOMContentLoaded', function() {
});
// 新闻轮播
- const newsItems = document.querySelectorAll('#news .card');
+ const newsContainer = document.querySelector('#news .row');
+ const newsItems = document.querySelectorAll('#news .col-md-4');
+
if (newsItems.length > 0) {
+ // 创建轮播指示器
+ const indicatorsContainer = document.createElement('div');
+ indicatorsContainer.className = 'carousel-indicators d-flex justify-content-center mt-3';
+
+ // 为每个新闻项创建指示器
+ newsItems.forEach((item, index) => {
+ const indicator = document.createElement('button');
+ indicator.type = 'button';
+ indicator.className = index === 0 ? 'active' : '';
+ indicator.setAttribute('data-bs-target', '#news');
+ indicator.setAttribute('data-bs-slide-to', index.toString());
+
+ indicator.addEventListener('click', () => {
+ showNews(index);
+ });
+
+ indicatorsContainer.appendChild(indicator);
+ });
+
+ // 将指示器添加到新闻区域
+ newsContainer.parentNode.insertBefore(indicatorsContainer, newsContainer.nextSibling);
+
let currentIndex = 0;
- function showNextNews() {
- newsItems[currentIndex].classList.remove('active');
- currentIndex = (currentIndex + 1) % newsItems.length;
- newsItems[currentIndex].classList.add('active');
+ function showNews(index) {
+ // 隐藏所有新闻项
+ newsItems.forEach(item => {
+ item.classList.remove('d-block');
+ item.classList.add('d-none');
+ });
+
+ // 显示指定新闻项
+ newsItems[index].classList.remove('d-none');
+ newsItems[index].classList.add('d-block');
+
+ // 更新指示器
+ const indicators = indicatorsContainer.querySelectorAll('button');
+ indicators.forEach((indicator, i) => {
+ if (i === index) {
+ indicator.classList.add('active');
+ } else {
+ indicator.classList.remove('active');
+ }
+ });
+
+ currentIndex = index;
}
// 初始化第一个新闻项
- newsItems[0].classList.add('active');
+ showNews(0);
// 每5秒自动轮播
- setInterval(showNextNews, 5000);
+ setInterval(() => {
+ const nextIndex = (currentIndex + 1) % newsItems.length;
+ showNews(nextIndex);
+ }, 5000);
}
});
\ No newline at end of file
diff --git a/frontend/website/news.html b/frontend/website/news.html
new file mode 100644
index 0000000..49272ff
--- /dev/null
+++ b/frontend/website/news.html
@@ -0,0 +1,246 @@
+
+
+
+
+
+
新闻资讯 - 锡林郭勒盟畜牧数字化管理平台
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
行业动态
+
了解畜牧业最新政策与市场资讯
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
政策解读
+
锡林郭勒盟出台畜牧业数字化发展三年规划
+
2025-08-15
+
规划提出到2027年实现全盟畜牧业数字化覆盖率90%以上,建设完善的畜牧业数字化管理体系...
+
阅读全文
+
+
+
+
+
+
+
+

+
+
市场动态
+
优质牛肉价格连续三月上涨
+
2025-08-10
+
受市场需求增加影响,优质牛肉价格环比上涨8.5%,养殖户收益显著提升...
+
阅读全文
+
+
+
+
+
+
+
+

+
+
技术前沿
+
区块链技术在畜牧业追溯系统中的应用
+
2025-08-05
+
新型区块链技术可实现牲畜从养殖到餐桌的全流程追溯,保障食品安全...
+
阅读全文
+
+
+
+
+
+
+
+

+
+
行业报告
+
2025年上半年锡林郭勒盟畜牧业发展报告
+
2025-07-20
+
报告显示,上半年全盟畜牧业总产值同比增长6.8%,数字化转型成效显著...
+
阅读全文
+
+
+
+
+
+
+
+

+
+
政策解读
+
国家出台草原生态保护补助奖励政策
+
2025-07-15
+
新政将为锡林郭勒盟牧民提供每亩草原生态补偿,促进可持续发展...
+
阅读全文
+
+
+
+
+
+
+
+

+
+
市场动态
+
锡林郭勒盟羊肉获欧盟有机认证
+
2025-07-10
+
本地优质羊肉成功获得欧盟有机食品认证,将扩大出口市场...
+
阅读全文
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file