@@ -118,6 +118,7 @@ const imgList = ref([
'https://example.com/img2.jpg',
'https://example.com/img3.jpg',
])
+import centerImg from '@/assets/images/maker.png'
const HouseApartmentList = ref([])
const houseId = route.query.id;
const houseDetail = ref({}); // 存储房屋详情数据
@@ -214,12 +215,35 @@ const initMap = async () => {
zoom: 13,
center: [residentialDetail.value.longtitude, residentialDetail.value.latitude],
});
- const marker = new AMap.Marker({
+ // 创建自定义标记,包含图标和文字
+ const customMarker = new AMap.Marker({
position: [residentialDetail.value.longtitude, residentialDetail.value.latitude],
- title: '公寓位置', // 鼠标悬停文字
- icon: '../../assets/images/maker.png' // 自定义图标
+ title: '公寓位置',
+ icon: centerImg,
+ // 使用自定义内容
+ content: `
+
+

+
+ ${residentialDetail.value.deptName || '公寓名称'}
+
+
+ `
});
- map.add(marker);
+ map.add(customMarker);
} catch (err) {
diff --git a/src/views/showings/components/HouseList.vue b/src/views/showings/components/HouseList.vue
index 66ec09d..c73ea10 100644
--- a/src/views/showings/components/HouseList.vue
+++ b/src/views/showings/components/HouseList.vue
@@ -3,20 +3,23 @@
选择乐业社区
-
-
![]()
-
-
{{ item.apartmentName }}
-
共{{ item.total }}间
-
{{ item.address }}
-
-
- {{ getLabel(tag) }}
+
+
+
![]()
+
+
{{ item.apartmentName }}
+
共{{ item.total }}间
+
{{ item.address }}
+
+
+ {{ getLabel(tag) }}
+
+
-
+