feat: 统一文件上传接口 + 模板图片展示 + 导航页 + 侧边栏调整

This commit is contained in:
admin
2026-07-10 20:43:02 +08:00
parent cbd0430452
commit ce6823e282
25 changed files with 933 additions and 166 deletions

View File

@@ -747,6 +747,13 @@ function renderCompany(c){
document.getElementById('ctAddr').textContent=c.address||'--';
document.getElementById('mapAddr').textContent=c.address||'--';
document.getElementById('mapDesc').textContent=c.description||'欢迎莅临我司总部,共商合作。';
/* 企业 Logo 图片注入 */
if(c.logo){
document.querySelectorAll('.logo-mark').forEach(function(lm){
lm.style.overflow='hidden';
lm.insertAdjacentHTML('beforeend','<img src="'+escapeHtml(c.logo)+'" alt="logo" style="position:absolute;inset:0;width:100%;height:100%;object-fit:cover" onerror="this.remove()">');
});
}
// 页脚
document.getElementById('footDesc').textContent=c.description?c.description.slice(0,90)+'...':'致力于为全球客户提供智能制造与工业自动化解决方案。';
document.getElementById('footPhone').textContent=c.phone||'--';
@@ -781,7 +788,8 @@ function renderServices(services){
<div class="cap-visual">
<div class="cap-number">${idx}</div>
<div class="cap-visual-card">
<div class="cap-icon-big">${icon}</div>
${s.image?`<img src="${escapeHtml(s.image)}" alt="${escapeHtml(s.title)}" style="position:absolute;inset:0;width:100%;height:100%;object-fit:cover" onerror="this.style.display='none';this.nextElementSibling.style.display=''">`:''}
<div class="cap-icon-big" style="${s.image?'display:none':''}">${icon}</div>
<span class="badge">CAP ${idx}</span>
</div>
</div>
@@ -881,6 +889,7 @@ function renderNews(news){
<div class="ym">${dt.ym}</div>
</div>
<div class="news-body">
${n.image?`<div style="margin-bottom:12px;border-radius:8px;overflow:hidden"><img src="${escapeHtml(n.image)}" alt="${escapeHtml(n.title)}" style="width:100%;height:140px;object-fit:cover;display:block" onerror="this.parentElement.style.display='none'"></div>`:''}
<span class="news-cat">${escapeHtml(cat)}</span>
<h3>${escapeHtml(n.title)}</h3>
<p>${escapeHtml(n.summary||'')}</p>
@@ -912,7 +921,7 @@ function renderTeam(team){
return `
<div class="team-card reveal d${(i%3)+1}">
<div class="team-num">${pad(i+1)}</div>
<div class="team-avatar" style="background:${grad}">${escapeHtml(initial)}</div>
<div class="team-avatar" style="background:${grad};overflow:hidden">${escapeHtml(initial)}${m.avatar?`<img src="${escapeHtml(m.avatar)}" alt="${escapeHtml(m.name)}" style="position:absolute;inset:0;width:100%;height:100%;border-radius:50%;object-fit:cover" onerror="this.remove()">`:''}</div>
<div class="team-name">${escapeHtml(m.name)}</div>
<div class="team-pos">${escapeHtml(m.position||'')}</div>
<p class="team-bio">${escapeHtml(m.bio||'')}</p>