task#10595,点标记上方显示地址,记录tab切点入进去的index
This commit is contained in:
@ -57,6 +57,7 @@ export default {
|
||||
this.id = this.$route.params.id || urlParams.get('id');
|
||||
},
|
||||
async mounted() {
|
||||
this.activeIndex=this.$route.params?.activeIndex || 0
|
||||
await this.batchOrderCount();
|
||||
await this.getList()
|
||||
},
|
||||
@ -89,7 +90,15 @@ export default {
|
||||
tab.num = res.data.auditFailCount;
|
||||
}
|
||||
});
|
||||
console.log("数量",res)
|
||||
},
|
||||
goPageDetail(id){
|
||||
this.$router.push({
|
||||
name: 'caseDetail', // 目标路由的名称
|
||||
params: {
|
||||
id:id,
|
||||
index:this.activeIndex,
|
||||
}
|
||||
});
|
||||
},
|
||||
getStatus(i){
|
||||
switch (i){
|
||||
@ -126,14 +135,6 @@ export default {
|
||||
return 'yelColor'
|
||||
}
|
||||
},
|
||||
goPageDetail(id){
|
||||
this.$router.push({
|
||||
name: 'caseDetail', // 目标路由的名称
|
||||
params: {
|
||||
id:id,
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -8,7 +8,7 @@
|
||||
:border="false"
|
||||
:fixed="true"
|
||||
:safe-area-inset-top="true"
|
||||
@click-left="h5GoBack"
|
||||
@click-left="goPrePage"
|
||||
/>
|
||||
</div>
|
||||
<div class="listWrap">
|
||||
@ -140,11 +140,13 @@ export default {
|
||||
state:'',//审核状态
|
||||
map: '',
|
||||
abPath:[],
|
||||
bcPath:[]
|
||||
bcPath:[],
|
||||
activeIndex:'',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.id = this.$route.params.id;
|
||||
this.activeIndex=this.$route.params.index;
|
||||
},
|
||||
async mounted(){
|
||||
await this.getOrderDetail()
|
||||
@ -153,6 +155,15 @@ export default {
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
goPrePage(){
|
||||
this.$router.push({
|
||||
name: 'caseAuditList', // 目标路由的名称
|
||||
params: {
|
||||
id:this.id,
|
||||
activeIndex:this.activeIndex,
|
||||
}
|
||||
});
|
||||
},
|
||||
initMap() {
|
||||
this.map = new AMap.Map('container',{
|
||||
zoom:14,//级别(缩放比例 3-20 )
|
||||
@ -193,11 +204,7 @@ export default {
|
||||
imageSize: new AMap.Size(43, 43) // 图片的实际尺寸
|
||||
}),
|
||||
});
|
||||
let infoWindow = new AMap.InfoWindow({
|
||||
content: this.detailInfo?.apointAddress, // 替换为实际的地址文本
|
||||
offset: new AMap.Pixel(0, -30) // 设置信息窗体的偏移量,使其显示在点的上方
|
||||
});
|
||||
infoWindow.open(this.map, [this.detailInfo?.apointLongtitude, this.detailInfo?.apointLongtitude]);
|
||||
this.setLabel(marker,this.detailInfo.apointAddress)
|
||||
this.map.add(marker);
|
||||
// 事发地,b点
|
||||
let marker1 = new AMap.Marker({
|
||||
@ -208,11 +215,7 @@ export default {
|
||||
imageSize: new AMap.Size(43, 43) // 图片的实际尺寸
|
||||
})
|
||||
});
|
||||
let infoWindow1 = new AMap.InfoWindow({
|
||||
content: this.detailInfo?.bpointAddress, // 替换为实际的地址文本
|
||||
offset: new AMap.Pixel(0, -30) // 设置信息窗体的偏移量,使其显示在点的上方
|
||||
});
|
||||
infoWindow1.open(this.map, [this.detailInfo?.bpointLongtitude, this.detailInfo?.bpointLongtitude]);
|
||||
this.setLabel(marker1,this.detailInfo.bpointAddress)
|
||||
this.map.add(marker1);
|
||||
let marker2=''
|
||||
if(this.detailInfo.cpointLongtitude && this.detailInfo.cpointLatitude){
|
||||
@ -224,11 +227,7 @@ export default {
|
||||
imageSize: new AMap.Size(28, 28) // 图片的实际尺寸
|
||||
})
|
||||
});
|
||||
let infoWindow2 = new AMap.InfoWindow({
|
||||
content: this.detailInfo?.cpointAddress, // 替换为实际的地址文本
|
||||
offset: new AMap.Pixel(0, -30) // 设置信息窗体的偏移量,使其显示在点的上方
|
||||
});
|
||||
infoWindow2.open(this.map, [this.detailInfo?.cpointLongtitude, this.detailInfo?.cpointLongtitude]);
|
||||
this.setLabel(marker2,this.detailInfo.cpointAddress)
|
||||
this.map.add(marker2);
|
||||
}
|
||||
if(this.detailInfo.cpointLongtitude && this.detailInfo.cpointLatitude){
|
||||
@ -237,6 +236,13 @@ export default {
|
||||
this.map.setFitView([marker,marker1])
|
||||
}
|
||||
},
|
||||
setLabel(markerPoint,address){
|
||||
markerPoint.setLabel({
|
||||
offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
|
||||
content: address, //设置文本标注内容
|
||||
direction: 'top'
|
||||
});
|
||||
},
|
||||
async submitHandle(){
|
||||
if(!this.states){
|
||||
this.$toast('审核结果必选')
|
||||
@ -274,12 +280,16 @@ export default {
|
||||
id:this.id
|
||||
})
|
||||
this.detailInfo=res.data
|
||||
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.gpsTrackQOsAB && this.detailInfo.gpsTrackQOsAB .length > 0){
|
||||
this.detailInfo?.gpsTrackQOsAB.forEach((item)=>{
|
||||
this.abPath.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{
|
||||
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>
|
||||
|
Reference in New Issue
Block a user