地图BUG修改

This commit is contained in:
lnljyang
2026-01-09 13:19:13 +08:00
parent b1128b9adf
commit 51b927d29a

View File

@@ -419,7 +419,7 @@
style="width: 40rpx; height: 40rpx; margin-right: 5px"
></cover-image>
<cover-view style="flex: 1">{{
currMarker.plateNumber || currMarker.name
currMarker.plateNumber || currMarker.shortName || currMarker.name
}}</cover-view>
<cover-image
v-if="current === 0"
@@ -449,7 +449,7 @@
</cover-view>
</cover-view>
<cover-view class="popup-content">
<cover-view style="display: flex">
<cover-view style="display: flex; white-space: normal">
<u-icon
name="map"
size="45"
@@ -473,6 +473,15 @@
</cover-view>
</cover-view>
<cover-view v-else>
<cover-view
class="content-items"
style="text-align: left"
v-if="currMarker.shortName"
>
<cover-view style="flex: 1; white-space: normal">
加氢站全称{{ currMarker.name || "--" }}
</cover-view>
</cover-view>
<cover-view class="content-items" style="text-align: left">
<cover-view style="flex: 1">
氢源{{ currMarker.hydrogenSource || "--" }}
@@ -661,7 +670,6 @@ export default {
onPullDownRefresh(event) {},
mounted() {
console.log("mounted");
this.$store.state.current = "map";
this.sectionChange(this.current);
this.getOrgList();
this.getAreaList();
@@ -678,8 +686,13 @@ export default {
}
// 清理地图事件监听器
if (this._mapContext) {
// 直接移除所有监听器,不需要传递回调函数
try {
this._mapContext.off("markerClusterCreate");
this._mapContext.off("markerClusterClick");
} catch (e) {
console.log("移除地图事件监听器失败:", e);
}
this._mapContext = null;
}
},
@@ -1154,8 +1167,12 @@ export default {
createMapContext() {
// 清理之前的地图上下文,防止重复创建
if (this._mapContext) {
try {
this._mapContext.off("markerClusterCreate");
this._mapContext.off("markerClusterClick");
} catch (e) {
console.log("移除地图事件监听器失败:", e);
}
this._mapContext = null;
}
@@ -1272,7 +1289,7 @@ export default {
iconPath = item.cooperate
? `/static/maph.png`
: `/static/maph2.png`;
calloutText = item.stationName;
calloutText = item.shortName || item.stationName;
break;
}
// let flag = false;
@@ -1624,6 +1641,7 @@ export default {
justify-content: space-between;
align-items: center;
text-align: center;
margin: 8rpx;
font-size: 24rpx;
.item {
flex: 1;