fix img dark

This commit is contained in:
xiaoma
2026-02-09 18:58:25 +08:00
parent ff5f2cea98
commit 5948e2998d
4 changed files with 66 additions and 33 deletions

View File

@@ -82,20 +82,6 @@ const ProductDetail = () => {
return { obj: p.model_3d_url };
}
// 如果有静态图,且没有特定的 3D 模型 URL则优先显示静态图不进入下方的通用 3D 模板匹配
if (p.static_image_url) {
return null;
}
const text = (p.name + p.description).toLowerCase();
if (text.includes('mini')) {
return { obj: '/3dmimi/3D_PCB_V3-mini.obj', mtl: '/3dmimi/3D_PCB_V3-mini.mtl' };
} else if (text.includes('v2')) {
return { obj: '/3dV2/xiaoliangV2.obj', mtl: '/3dV2/xiaoliangV2.mtl' };
} else if (text.includes('vision') || text.includes('视觉') || text.includes('camera')) {
return { obj: '/3dmodo/xiaoliang1.obj', mtl: '/3dmodo/xiaoliang1.mtl' };
}
return null;
};
@@ -207,8 +193,15 @@ const ProductDetail = () => {
)}
{product.display_detail_image ? (
<div style={{ margin: '60px 0', width: '100%', overflow: 'hidden', borderRadius: 12 }}>
<img src={product.display_detail_image} alt="产品详情" style={{ width: '100%', display: 'block' }} />
<div style={{
margin: '60px auto',
maxWidth: '900px',
width: '100%',
overflow: 'hidden',
borderRadius: 12,
boxShadow: '0 10px 40px rgba(0,0,0,0.5)'
}}>
<img src={product.display_detail_image} alt="产品详情" style={{ width: '100%', display: 'block', height: 'auto' }} />
</div>
) : (
<div style={{ margin: '60px 0', height: 800, background: '#111', display: 'flex', alignItems: 'center', justifyContent: 'center', color: '#333', fontSize: 24, border: '1px dashed #333' }}>

View File

@@ -132,16 +132,18 @@ const ServiceDetail = () => {
{service.display_detail_image ? (
<div style={{
width: '100%',
maxWidth: '900px',
margin: '0 auto',
background: '#111',
borderRadius: 12,
overflow: 'hidden',
boxShadow: `0 0 30px ${service.color}22`,
boxShadow: `0 10px 40px ${service.color}22`,
border: `1px solid ${service.color}33`
}}>
<img
src={service.display_detail_image}
alt={service.title}
style={{ width: '100%', display: 'block' }}
style={{ width: '100%', display: 'block', height: 'auto' }}
/>
</div>
) : (