加入我们
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>联系我们 - 山东德润新材料科技有限公司</title>
<style>
/* 全局样式重置 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Microsoft Yahei", "PingFang SC", Arial, sans-serif;
background: #f7f7f7;
color: #333;
}
/* 联系模块主容器 */
.contact-wrap {
max-width: 800px;
margin: 30px auto;
padding: 25px;
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
/* 标题样式 - 品牌绿 */
.contact-header {
color: #2e7d32;
font-size: 20px;
font-weight: 600;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #2e7d32;
}
/* 联系信息列表 */
.contact-info {
list-style: none;
margin-bottom: 25px;
}
.contact-info li {
font-size: 14px;
line-height: 2;
text-align: left;
margin-bottom: 8px;
}
.contact-info .label {
display: inline-block;
width: 70px;
font-weight: 600;
color: #2e7d32;
}
/* 地图区域 */
.map-box {
width: 100%;
}
.map-title {
color: #2e7d32;
font-size: 16px;
font-weight: 600;
margin-bottom: 12px;
}
#amap-container {
width: 100%;
height: 400px;
border-radius: 6px;
border: 1px solid #e0e0e0;
}
/* 响应式适配 */
@media (max-width: 768px) {
.contact-wrap {
margin: 15px;
padding: 20px;
}
#amap-container {
height: 320px;
}
.contact-info li {
font-size: 13px;
}
}
</style>
<!-- 引入高德地图API(加载超时兜底) -->
<script type="text/javascript">
// 提前加载高德地图,增加超时处理
(function() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://webapi.amap.com/maps?v=2.0&key=a902683380a8d9a2edaadc9d66c634ea';
script.async = true;
script.onerror = function() {
alert('地图加载失败,请检查网络或API Key是否有效');
};
document.head.appendChild(script);
})();
</script>
</head>
<body>
<div class="contact-wrap">
<h3 class="contact-header">联系我们</h3>
<!-- 联系信息 -->
<ul class="contact-info">
<li><span class="label">公司名称:</span>山东德润新材料科技有限公司</li>
<li><span class="label">地 址:</span>山东省德州市天衢新区崇德五大道与尚德三路交叉口西北50米</li>
<li><span class="label">邮 编:</span>253084</li>
<li><span class="label">销售部:</span>0086-534-8028208</li>
<li><span class="label">人资部:</span>0086-534-8028207</li>
</ul>
<!-- 高德地图 -->
<div class="map-box">
<h4 class="map-title">公司位置</h4>
<div id="amap-container"></div>
</div>
</div>
<script type="text/javascript">
// 核心地图初始化函数(双重保障)
function initMap() {
// 1. 确认高德地图API已加载
if (!window.AMap) {
setTimeout(initMap, 500); // 重试加载
return;
}
// 2. 手动获取的精准经纬度(德州市天衢新区该地址的实际经纬度)
var preciseLngLat = [116.372588, 37.456895]; // 替换为精准值,确保位置显示
// 3. 初始化地图
var map = new AMap.Map('amap-container', {
center: preciseLngLat, // 直接用精准经纬度,不依赖解析
zoom: 17, // 放大级别,清晰显示
resizeEnable: true,
scrollWheel: true // 开启滚轮缩放
});
// 4. 添加基础控件
map.addControl(new AMap.ToolBar());
map.addControl(new AMap.Scale());
// 5. 创建并添加标记点(必显示)
var marker = new AMap.Marker({
position: preciseLngLat,
title: '山东德润新材料科技有限公司',
map: map,
icon: new AMap.Icon({
size: new AMap.Size(30, 40),
image: 'https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
imageSize: new AMap.Size(30, 40)
})
});
// 6. 添加信息窗口
var infoWindow = new AMap.InfoWindow({
content: '<div style="padding:10px;font-size:14px;">' +
'<strong>山东德润新材料科技有限公司</strong><br/>' +
'地址:山东省德州市天衢新区崇德五大道与尚德三路交叉口西北50米' +
'</div>',
offset: new AMap.Pixel(0, -30)
});
// 7. 绑定标记点点击事件
marker.on('click', function() {
infoWindow.open(map, preciseLngLat);
});
// 8. 自动打开信息窗口
infoWindow.open(map, preciseLngLat);
// 9. 备用:尝试地址解析(如果手动经纬度有偏差)
var geocoder = new AMap.Geocoder({ city: '德州市' });
geocoder.getLocation('山东省德州市天衢新区崇德五大道与尚德三路交叉口西北50米', function(status, res) {
if (status === 'complete' && res.info === 'OK') {
var lnglat = res.geocodes[0].location;
map.setCenter(lnglat);
marker.setPosition(lnglat);
infoWindow.open(map, lnglat);
}
});
}
// 页面加载完成后初始化
window.addEventListener('load', function() {
// 延迟1秒确保API完全加载
setTimeout(initMap, 1000);
});
</script>
</body>
</html>