task#10595,点标记上方显示地址,记录tab切点入进去的index

This commit is contained in:
2024-01-31 15:00:01 +08:00
parent 3694c8e94d
commit 7ad521ae1e
2 changed files with 53 additions and 32 deletions

View File

@ -57,6 +57,7 @@ export default {
this.id = this.$route.params.id || urlParams.get('id'); this.id = this.$route.params.id || urlParams.get('id');
}, },
async mounted() { async mounted() {
this.activeIndex=this.$route.params?.activeIndex || 0
await this.batchOrderCount(); await this.batchOrderCount();
await this.getList() await this.getList()
}, },
@ -89,7 +90,15 @@ export default {
tab.num = res.data.auditFailCount; tab.num = res.data.auditFailCount;
} }
}); });
console.log("数量",res) },
goPageDetail(id){
this.$router.push({
name: 'caseDetail', // 目标路由的名称
params: {
id:id,
index:this.activeIndex,
}
});
}, },
getStatus(i){ getStatus(i){
switch (i){ switch (i){
@ -126,14 +135,6 @@ export default {
return 'yelColor' return 'yelColor'
} }
}, },
goPageDetail(id){
this.$router.push({
name: 'caseDetail', // 目标路由的名称
params: {
id:id,
}
});
},
} }
} }
</script> </script>

View File

@ -8,7 +8,7 @@
:border="false" :border="false"
:fixed="true" :fixed="true"
:safe-area-inset-top="true" :safe-area-inset-top="true"
@click-left="h5GoBack" @click-left="goPrePage"
/> />
</div> </div>
<div class="listWrap"> <div class="listWrap">
@ -140,11 +140,13 @@ export default {
state:'',//审核状态 state:'',//审核状态
map: '', map: '',
abPath:[], abPath:[],
bcPath:[] bcPath:[],
activeIndex:'',
} }
}, },
created() { created() {
this.id = this.$route.params.id; this.id = this.$route.params.id;
this.activeIndex=this.$route.params.index;
}, },
async mounted(){ async mounted(){
await this.getOrderDetail() await this.getOrderDetail()
@ -153,6 +155,15 @@ export default {
}); });
}, },
methods:{ methods:{
goPrePage(){
this.$router.push({
name: 'caseAuditList', // 目标路由的名称
params: {
id:this.id,
activeIndex:this.activeIndex,
}
});
},
initMap() { initMap() {
this.map = new AMap.Map('container',{ this.map = new AMap.Map('container',{
zoom:14,//级别(缩放比例 3-20 ) zoom:14,//级别(缩放比例 3-20 )
@ -193,11 +204,7 @@ export default {
imageSize: new AMap.Size(43, 43) // 图片的实际尺寸 imageSize: new AMap.Size(43, 43) // 图片的实际尺寸
}), }),
}); });
let infoWindow = new AMap.InfoWindow({ this.setLabel(marker,this.detailInfo.apointAddress)
content: this.detailInfo?.apointAddress, // 替换为实际的地址文本
offset: new AMap.Pixel(0, -30) // 设置信息窗体的偏移量,使其显示在点的上方
});
infoWindow.open(this.map, [this.detailInfo?.apointLongtitude, this.detailInfo?.apointLongtitude]);
this.map.add(marker); this.map.add(marker);
// 事发地b点 // 事发地b点
let marker1 = new AMap.Marker({ let marker1 = new AMap.Marker({
@ -208,11 +215,7 @@ export default {
imageSize: new AMap.Size(43, 43) // 图片的实际尺寸 imageSize: new AMap.Size(43, 43) // 图片的实际尺寸
}) })
}); });
let infoWindow1 = new AMap.InfoWindow({ this.setLabel(marker1,this.detailInfo.bpointAddress)
content: this.detailInfo?.bpointAddress, // 替换为实际的地址文本
offset: new AMap.Pixel(0, -30) // 设置信息窗体的偏移量,使其显示在点的上方
});
infoWindow1.open(this.map, [this.detailInfo?.bpointLongtitude, this.detailInfo?.bpointLongtitude]);
this.map.add(marker1); this.map.add(marker1);
let marker2='' let marker2=''
if(this.detailInfo.cpointLongtitude && this.detailInfo.cpointLatitude){ if(this.detailInfo.cpointLongtitude && this.detailInfo.cpointLatitude){
@ -224,11 +227,7 @@ export default {
imageSize: new AMap.Size(28, 28) // 图片的实际尺寸 imageSize: new AMap.Size(28, 28) // 图片的实际尺寸
}) })
}); });
let infoWindow2 = new AMap.InfoWindow({ this.setLabel(marker2,this.detailInfo.cpointAddress)
content: this.detailInfo?.cpointAddress, // 替换为实际的地址文本
offset: new AMap.Pixel(0, -30) // 设置信息窗体的偏移量,使其显示在点的上方
});
infoWindow2.open(this.map, [this.detailInfo?.cpointLongtitude, this.detailInfo?.cpointLongtitude]);
this.map.add(marker2); this.map.add(marker2);
} }
if(this.detailInfo.cpointLongtitude && this.detailInfo.cpointLatitude){ if(this.detailInfo.cpointLongtitude && this.detailInfo.cpointLatitude){
@ -237,6 +236,13 @@ export default {
this.map.setFitView([marker,marker1]) this.map.setFitView([marker,marker1])
} }
}, },
setLabel(markerPoint,address){
markerPoint.setLabel({
offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
content: address, //设置文本标注内容
direction: 'top'
});
},
async submitHandle(){ async submitHandle(){
if(!this.states){ if(!this.states){
this.$toast('审核结果必选') this.$toast('审核结果必选')
@ -274,12 +280,16 @@ export default {
id:this.id id:this.id
}) })
this.detailInfo=res.data this.detailInfo=res.data
this.detailInfo?.gpsTrackQOsAB.forEach((item)=>{ if(this.detailInfo.gpsTrackQOsAB && this.detailInfo.gpsTrackQOsAB .length > 0){
this.abPath.push([item.lon,item.lat]) this.detailInfo?.gpsTrackQOsAB.forEach((item)=>{
}) this.abPath.push([item.lon,item.lat])
this.detailInfo?.gpsTrackQOsBC.forEach((item)=>{ })
this.bcPath.push([item.lon,item.lat]) }
}) if(this.detailInfo.gpsTrackQOsBC && this.detailInfo.gpsTrackQOsBC .length > 0){
this.detailInfo?.gpsTrackQOsBC.forEach((item)=>{
this.bcPath.push([item.lon,item.lat])
})
}
}, },
} }
} }
@ -494,4 +504,14 @@ export default {
::v-deep .amap-logo{ ::v-deep .amap-logo{
display: none !important; display: none !important;
} }
::v-deep .amap-marker-label{
border: none;
padding: 0 8px;
@include all-height(25px);
@include fontWeightSize(12px,400);
color: #3A3A3A;
@include bgcolorOpa(#FFFFFF,0.98);
box-shadow: 0px 1px 4px 0px rgba(164,162,162,0.69);
border-radius: 17px;
}
</style> </style>