地图BUG修改
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
@beforeleave="onBeforeLeave"
|
||||
>
|
||||
<!-- @afterShow="onAfterShow"
|
||||
@afterHide="onAfterHide" -->
|
||||
@afterHide="onAfterHide" -->
|
||||
<view class="right-panel" @tap.native.stop="banIosChuanTou">
|
||||
<view class="panel-header">
|
||||
<view class="panel-title"
|
||||
@@ -403,14 +403,14 @@
|
||||
<cover-view class="popup" v-if="showPopup">
|
||||
<cover-view class="popup-header">
|
||||
<!-- <cover-view style="display: flex" :show-location="true"
|
||||
><cover-image
|
||||
:src="
|
||||
current === 0 ? '/static/kachetou.png' : '/static/jiaqingzhan.png'
|
||||
"
|
||||
style="width: 40rpx; height: 40rpx; margin: 5px"
|
||||
></cover-image
|
||||
>1111</cover-view
|
||||
> -->
|
||||
><cover-image
|
||||
:src="
|
||||
current === 0 ? '/static/kachetou.png' : '/static/jiaqingzhan.png'
|
||||
"
|
||||
style="width: 40rpx; height: 40rpx; margin: 5px"
|
||||
></cover-image
|
||||
>1111</cover-view
|
||||
> -->
|
||||
<cover-view style="display: flex; padding: 5px; flex: 1">
|
||||
<cover-image
|
||||
:src="
|
||||
@@ -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) {
|
||||
this._mapContext.off("markerClusterCreate");
|
||||
this._mapContext.off("markerClusterClick");
|
||||
// 直接移除所有监听器,不需要传递回调函数
|
||||
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) {
|
||||
this._mapContext.off("markerClusterCreate");
|
||||
this._mapContext.off("markerClusterClick");
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user