tanghaolin
7 天以前 9bee4f48db0c5b99b5683545fac737856d94d082
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<template>
    <div class="container mx-auto px-4 py-8 bg-white" style="padding-top: 40px">
        <!-- 面包屑导航 -->
        <div class="mb-6 text-gray-500">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item>联系我们</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <el-row class="w-full">
            <el-col :span="10">
                <div id="my_map"></div>
            </el-col>
            <el-col :span="12">
                <!-- 联系信息卡片 -->
                <div class="mx-auto bg-white rounded-lg ml-[6rem] py-10">
                    <h1 class="w-[487px] text-2xl font-bold mb-6 text-center text-[#222222] text-[24px] mb-[26px]">
                        上海义维流体科技有限公司</h1>
 
                    <div class="space-y-4 flex flex-col items-center justify-center gap-[10px]">
                        <div class="flex text-[16px] items-start justify-center w-[487px] line-height-16">
                            <div class="w-24 text-align-right">地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址:</div>
                            <div class="flex-1 text-ellipsis-style">上海市闵行区浦江镇江月路999号1幢615室</div>
                        </div>
 
                        <div class="flex text-[16px] items-start justify-center w-[487px] line-height-16">
                            <div class="w-24  text-align-right">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;编:
                            </div>
                            <div class="flex-1 text-ellipsis-style">201108</div>
                        </div>
 
                        <div class="flex text-[16px] items-start justify-center w-[487px] line-height-16">
                            <div class="w-24  text-align-right">工作时间:</div>
                            <div class="flex-1 text-ellipsis-style">周一至周五 8:30 - 17:30</div>
                        </div>
 
                        <div class="flex text-[16px] items-start justify-center w-[487px] line-height-16">
                            <div class="w-24  text-align-right">售后电话:</div>
                            <div class="flex-1 text-ellipsis-style">021-34306562</div>
                        </div>
 
                        <div class="flex text-[16px] items-start justify-center w-[487px] line-height-16">
                            <div class="w-24  text-align-right">售后邮箱:</div>
                            <div class="flex-1 text-ellipsis-style">
                                <a href="mailto:eventech@163.com" class="text-blue-600 hover:text-blue-800">
                                    eventech@163.com
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </el-col>
        </el-row>
    </div>
</template>
 
<script setup lang="ts">
import { onMounted } from 'vue';
import { ElRow, ElCol } from 'element-plus';
import AMapLoader from '@amap/amap-jsapi-loader';
 
let map = null;
 
onMounted(() => {
    AMapLoader.load({
        key: '3627ed9deaac2622e26a7169f0c36b1b',
        version: '2.0',
        plugins: ['AMap.Geolocation'],
    }).then((AMap) => {
        map = new AMap.Map('my_map', {
            zoom: 15,
            center: [121.52, 31.09],
        });
 
        map.on('complete', () => {
            console.log('地图加载成功')
            let marker = new AMap.Marker({
                position: [121.52, 31.09],
                offset: new AMap.Pixel(0, 0),
                anchor:'bottom-center',
            });
 
            // 自定义点标记内容
            let markerContent = document.createElement("div");
            // 点标记中的图标
            let markerImg = document.createElement("img");
            markerImg.className = "markerlnglat";
            markerImg.src = "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png";
            markerImg.setAttribute('width', '25px');
            markerImg.setAttribute('height', '34px');
            markerContent.appendChild(markerImg);
 
            // 点标记中的文本
            let markerSpan = document.createElement("span");
            markerSpan.className = 'custom-marker';
            markerSpan.innerHTML = "上海义维流体科技有限公司";
            markerContent.appendChild(markerSpan);
 
            marker.setContent(markerContent); //更新点标记内容
            marker.setPosition([121.52, 31.09]); //更新点标记位置
 
    
            map.add(marker)
        })
    });
})
</script>
 
<style scoped>
#my_map {
    width: 100%;
    height: 500px;
}
 
.line-height-16 {
    line-height: 16px;
}
 
.text-ellipsis-style {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
</style>
<style>
.custom-marker {
    position: absolute;
    top: 33px;
    right: -70px;
    color: #fff;
    padding: 4px 10px;
    box-shadow: 1px 1px 1px rgba(10, 10, 10, .2);
    white-space: nowrap;
    font-size: 12px;
    font-family: "";
    background-color: #003a8f;
    border-radius: 3px;
    }
</style>