地图BUG修改
This commit is contained in:
@@ -80,7 +80,7 @@
|
|||||||
@beforeleave="onBeforeLeave"
|
@beforeleave="onBeforeLeave"
|
||||||
>
|
>
|
||||||
<!-- @afterShow="onAfterShow"
|
<!-- @afterShow="onAfterShow"
|
||||||
@afterHide="onAfterHide" -->
|
@afterHide="onAfterHide" -->
|
||||||
<view class="right-panel" @tap.native.stop="banIosChuanTou">
|
<view class="right-panel" @tap.native.stop="banIosChuanTou">
|
||||||
<view class="panel-header">
|
<view class="panel-header">
|
||||||
<view class="panel-title"
|
<view class="panel-title"
|
||||||
@@ -403,14 +403,14 @@
|
|||||||
<cover-view class="popup" v-if="showPopup">
|
<cover-view class="popup" v-if="showPopup">
|
||||||
<cover-view class="popup-header">
|
<cover-view class="popup-header">
|
||||||
<!-- <cover-view style="display: flex" :show-location="true"
|
<!-- <cover-view style="display: flex" :show-location="true"
|
||||||
><cover-image
|
><cover-image
|
||||||
:src="
|
:src="
|
||||||
current === 0 ? '/static/kachetou.png' : '/static/jiaqingzhan.png'
|
current === 0 ? '/static/kachetou.png' : '/static/jiaqingzhan.png'
|
||||||
"
|
"
|
||||||
style="width: 40rpx; height: 40rpx; margin: 5px"
|
style="width: 40rpx; height: 40rpx; margin: 5px"
|
||||||
></cover-image
|
></cover-image
|
||||||
>1111</cover-view
|
>1111</cover-view
|
||||||
> -->
|
> -->
|
||||||
<cover-view style="display: flex; padding: 5px; flex: 1">
|
<cover-view style="display: flex; padding: 5px; flex: 1">
|
||||||
<cover-image
|
<cover-image
|
||||||
:src="
|
:src="
|
||||||
@@ -419,7 +419,7 @@
|
|||||||
style="width: 40rpx; height: 40rpx; margin-right: 5px"
|
style="width: 40rpx; height: 40rpx; margin-right: 5px"
|
||||||
></cover-image>
|
></cover-image>
|
||||||
<cover-view style="flex: 1">{{
|
<cover-view style="flex: 1">{{
|
||||||
currMarker.plateNumber || currMarker.name
|
currMarker.plateNumber || currMarker.shortName || currMarker.name
|
||||||
}}</cover-view>
|
}}</cover-view>
|
||||||
<cover-image
|
<cover-image
|
||||||
v-if="current === 0"
|
v-if="current === 0"
|
||||||
@@ -449,7 +449,7 @@
|
|||||||
</cover-view>
|
</cover-view>
|
||||||
</cover-view>
|
</cover-view>
|
||||||
<cover-view class="popup-content">
|
<cover-view class="popup-content">
|
||||||
<cover-view style="display: flex">
|
<cover-view style="display: flex; white-space: normal">
|
||||||
<u-icon
|
<u-icon
|
||||||
name="map"
|
name="map"
|
||||||
size="45"
|
size="45"
|
||||||
@@ -473,6 +473,15 @@
|
|||||||
</cover-view>
|
</cover-view>
|
||||||
</cover-view>
|
</cover-view>
|
||||||
<cover-view v-else>
|
<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 class="content-items" style="text-align: left">
|
||||||
<cover-view style="flex: 1">
|
<cover-view style="flex: 1">
|
||||||
氢源:{{ currMarker.hydrogenSource || "--" }}
|
氢源:{{ currMarker.hydrogenSource || "--" }}
|
||||||
@@ -661,7 +670,6 @@ export default {
|
|||||||
onPullDownRefresh(event) {},
|
onPullDownRefresh(event) {},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log("mounted");
|
console.log("mounted");
|
||||||
this.$store.state.current = "map";
|
|
||||||
this.sectionChange(this.current);
|
this.sectionChange(this.current);
|
||||||
this.getOrgList();
|
this.getOrgList();
|
||||||
this.getAreaList();
|
this.getAreaList();
|
||||||
@@ -678,8 +686,13 @@ export default {
|
|||||||
}
|
}
|
||||||
// 清理地图事件监听器
|
// 清理地图事件监听器
|
||||||
if (this._mapContext) {
|
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;
|
this._mapContext = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1154,8 +1167,12 @@ export default {
|
|||||||
createMapContext() {
|
createMapContext() {
|
||||||
// 清理之前的地图上下文,防止重复创建
|
// 清理之前的地图上下文,防止重复创建
|
||||||
if (this._mapContext) {
|
if (this._mapContext) {
|
||||||
this._mapContext.off("markerClusterCreate");
|
try {
|
||||||
this._mapContext.off("markerClusterClick");
|
this._mapContext.off("markerClusterCreate");
|
||||||
|
this._mapContext.off("markerClusterClick");
|
||||||
|
} catch (e) {
|
||||||
|
console.log("移除地图事件监听器失败:", e);
|
||||||
|
}
|
||||||
this._mapContext = null;
|
this._mapContext = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1272,7 +1289,7 @@ export default {
|
|||||||
iconPath = item.cooperate
|
iconPath = item.cooperate
|
||||||
? `/static/maph.png`
|
? `/static/maph.png`
|
||||||
: `/static/maph2.png`;
|
: `/static/maph2.png`;
|
||||||
calloutText = item.stationName;
|
calloutText = item.shortName || item.stationName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// let flag = false;
|
// let flag = false;
|
||||||
@@ -1624,6 +1641,7 @@ export default {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
margin: 8rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
.item {
|
.item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user