task#10595,crm系统跳转H5动态取参

This commit is contained in:
2024-01-31 14:16:33 +08:00
parent e7acce0e11
commit 3694c8e94d
2 changed files with 18 additions and 2 deletions

View File

@ -53,7 +53,8 @@ export default {
} }
}, },
created() { created() {
this.id = this.$route.params.id; const urlParams = new URLSearchParams(window.location.search);
this.id = this.$route.params.id || urlParams.get('id');
}, },
async mounted() { async mounted() {
await this.batchOrderCount(); await this.batchOrderCount();

View File

@ -193,6 +193,11 @@ export default {
imageSize: new AMap.Size(43, 43) // 图片的实际尺寸 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.map.add(marker); this.map.add(marker);
// 事发地b点 // 事发地b点
let marker1 = new AMap.Marker({ let marker1 = new AMap.Marker({
@ -203,6 +208,11 @@ export default {
imageSize: new AMap.Size(43, 43) // 图片的实际尺寸 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.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){
@ -214,7 +224,12 @@ export default {
imageSize: new AMap.Size(28, 28) // 图片的实际尺寸 imageSize: new AMap.Size(28, 28) // 图片的实际尺寸
}) })
}); });
this.map.add(marker2); 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.map.add(marker2);
} }
if(this.detailInfo.cpointLongtitude && this.detailInfo.cpointLatitude){ if(this.detailInfo.cpointLongtitude && this.detailInfo.cpointLatitude){
this.map.setFitView([marker,marker1,marker2]) this.map.setFitView([marker,marker1,marker2])