107 lines
8.9 KiB
JavaScript
107 lines
8.9 KiB
JavaScript
/* ============================================================
|
||
HESU — News detail page (vanilla JS, no dependencies)
|
||
One page serves all articles: news-detail.html?id=N
|
||
Renders meta / title / text-image blocks / prev-next.
|
||
blocks: { t:'p', text:'…' } | { t:'img', src:'…' }
|
||
============================================================ */
|
||
(function () {
|
||
'use strict';
|
||
|
||
/* ---------- article content (id matches news.js href ?id=N) ---------- */
|
||
var ARTICLES = [
|
||
{ id: 1, cat: 'Company News', date: '2025.04.15',
|
||
title: 'Hesu Industrial Participates in the 139th Canton Fair',
|
||
blocks: [
|
||
{ t: 'p', text: 'The 139th China Import and Export Fair (Canton Fair) was successfully held in Guangzhou. As a key enterprise in the foreign trade industry, Hesu Industrial organized a professional team to attend the exhibition. Taking the opportunity of the Canton Fair’s global business platform, the company fully displayed its core products, customized production solutions and one-stop foreign trade service system, demonstrating its strong manufacturing strength, reliable product quality and global service capabilities.' },
|
||
{ t: 'img', src: 'image/news/detiles1-01.jpg' },
|
||
{ t: 'p', text: 'As an important window for the company to expand the international market, the 139th Canton Fair has further expanded Hesu Industrial’s global customer channels and consolidated the foundation of overseas market layout. In the future, adhering to professional manufacturing advantages, the company will seize foreign trade development opportunities, meet global customer needs with high-quality products and considerate services, and steadily increase its share in the international market.' },
|
||
{ t: 'img', src: 'image/news/detiles1-02.jpg' }
|
||
] },
|
||
{ id: 2, cat: 'Company News', date: '2025.03.02',
|
||
title: 'Hesu Industrial Dubai Branch Officially Opens for Business',
|
||
blocks: [
|
||
{ t: 'p', text: 'Recently, Hesu Industrial Dubai Branch was officially put into operation, marking the official implementation of the company’s localized development strategy in the Middle East and the further improvement of its global overseas service network.' },
|
||
{ t: 'img', src: 'image/news/detiles2-01.jpg' },
|
||
{ t: 'p', text: 'Dubai is located at the core business hub of Asia, Europe and Africa, with superior geographical advantages, serving as an important transit center radiating the Gulf countries, West Asia and North Africa markets. Integrating local office, product warehousing, customer reception and one-stop pre-sales and after-sales services, the Dubai branch has established a localized operation team. It can provide local customers with efficient services including sample docking, order performance, fast delivery and on-site technical support, effectively shortening the supply cycle, reducing cross-border trade costs and quickly responding to local market demands.' },
|
||
{ t: 'img', src: 'image/news/detiles2-02.jpg' },
|
||
{ t: 'p', text: 'The opening of the Dubai branch has built a complete overseas operation model of "domestic production + overseas warehousing and distribution + localized services" for Hesu Industrial. Going forward, the company will take Dubai as the core base to deeply cultivate the Middle East market, continuously optimize the regional supply chain, and carry out long-term and win-win business cooperation with local partners.' }
|
||
] },
|
||
{ id: 3, cat: 'Company News', date: '2025.02.10',
|
||
title: 'Hesu Industrial West Africa Factory Officially Put into Use',
|
||
blocks: [
|
||
{ t: 'p', text: 'After systematic planning and construction, equipment installation, commissioning and trial production, Hesu Industrial’s self-built production factory in West Africa has been officially completed and put into formal operation, becoming a core manufacturing base for the company to take root in the African market.' },
|
||
{ t: 'img', src: 'image/news/detiles3-01.jpg' },
|
||
{ t: 'p', text: 'Equipped with standardized fully automatic production lines, the West Africa factory strictly follows the unified production technology and quality control standards of the headquarters. It mainly realizes localized production and regional distribution for markets in West Africa and surrounding regions. The local factory effectively solves the problems of long cross-border shipping cycles and high tariff costs, greatly improves regional supply efficiency, and actively absorbs local labor employment. By adhering to the localized operation concept, the factory accurately meets the market demand for infrastructure and building materials in West Africa.' },
|
||
{ t: 'img', src: 'image/news/detiles3-02.jpg' },
|
||
{ t: 'p', text: 'From domestic production bases and Dubai overseas branches to local manufacturing bases in West Africa, Hesu Industrial has gradually built a global production and marketing network covering the Middle East and Africa. The official operation of the West Africa factory will further release the company’s overseas production capacity, enhance core competitiveness in the African market, and help high-quality Chinese manufacturing products take deeper root in West Africa.' }
|
||
] },
|
||
{ id: 4, cat: 'Company News', date: '2025.01.18',
|
||
title: 'Global Customers Visit Hesu Industrial Headquarters in China',
|
||
blocks: [
|
||
{ t: 'p', text: 'Recently, long-term cooperative customers from the Middle East and West Africa visited the headquarters of Hesu Industrial in China for on-site investigation and exchange. The two sides conducted in-depth business discussions to summarize previous cooperation achievements and clarify the development direction of long-term strategic cooperation.' },
|
||
{ t: 'img', src: 'image/news/detiles4-01.jpg' },
|
||
{ t: 'p', text: 'The visiting customers successively inspected the company’s production workshops, raw material warehouses, quality inspection laboratories and product exhibition halls. They had a comprehensive understanding of the whole production process, strict quality inspection standards and new product R&D strength, and spoke highly of the company’s standardized production management and large-scale production capacity. During the forum, both sides fully communicated on key issues such as customized product iteration, bulk order scheduling, exclusive regional agency and after-sales technical support, confirmed the annual framework cooperation plan, and reached a number of consensus on new product localization adaptation.' },
|
||
{ t: 'img', src: 'image/news/detiles4-02.jpg' },
|
||
{ t: 'p', text: 'The in-person visit of overseas customers fully reflects the high recognition and trust of global partners in Hesu Industrial’s brand strength and product quality. In the future, Hesu Industrial will always adhere to quality-oriented development, maintain open and win-win cooperation concepts, continuously optimize the global production and service system, and create stable and long-term value for all global partners.' }
|
||
] }
|
||
];
|
||
|
||
function byId(id) {
|
||
for (var i = 0; i < ARTICLES.length; i++) {
|
||
if (ARTICLES[i].id === id) return ARTICLES[i];
|
||
}
|
||
return null;
|
||
}
|
||
|
||
/* ---------- resolve ?id= (fallback: first article) ---------- */
|
||
var match = window.location.search.match(/[?&]id=(\d+)/);
|
||
var id = match ? parseInt(match[1], 10) : ARTICLES[0].id;
|
||
var a = byId(id) || ARTICLES[0];
|
||
var idx = ARTICLES.indexOf(a);
|
||
var prev = ARTICLES[idx - 1] || null;
|
||
var next = ARTICLES[idx + 1] || null;
|
||
|
||
/* ---------- render ---------- */
|
||
function esc(s) {
|
||
return String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||
}
|
||
|
||
document.title = 'HESU — ' + a.title;
|
||
|
||
var catEl = document.getElementById('ndCat');
|
||
var dateEl = document.getElementById('ndDate');
|
||
var titleEl = document.getElementById('ndTitle');
|
||
var artEl = document.getElementById('ndArticle');
|
||
var navEl = document.getElementById('ndNav');
|
||
|
||
if (catEl) catEl.textContent = a.cat;
|
||
if (dateEl) dateEl.textContent = a.date;
|
||
if (titleEl) titleEl.textContent = a.title;
|
||
|
||
if (artEl) {
|
||
artEl.innerHTML = a.blocks.map(function (b) {
|
||
if (b.t === 'img') {
|
||
return '<figure class="nd-figure"><img loading=\"lazy\" src="' + esc(b.src) + '" alt="' + esc(a.title) + '" loading="lazy" /></figure>';
|
||
}
|
||
return '<p>' + esc(b.text) + '</p>';
|
||
}).join('');
|
||
}
|
||
|
||
if (navEl) {
|
||
var html = '';
|
||
if (prev) {
|
||
html += '<a href="news-detail.html?id=' + prev.id + '" class="nd-nav__item nd-nav__prev">' +
|
||
'<span class="nd-nav__label">Previous</span>' +
|
||
'<span class="nd-nav__title">' + esc(prev.title) + '</span></a>';
|
||
}
|
||
if (next) {
|
||
html += '<a href="news-detail.html?id=' + next.id + '" class="nd-nav__item nd-nav__next">' +
|
||
'<span class="nd-nav__label">Next</span>' +
|
||
'<span class="nd-nav__title">' + esc(next.title) + '</span></a>';
|
||
}
|
||
navEl.innerHTML = html;
|
||
}
|
||
|
||
|
||
})();
|