md
This commit is contained in:
parent
62174891d8
commit
6d87feaa93
@ -14,8 +14,11 @@
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dayjs": "^1.11.10",
|
||||
"file-saver": "2.0.5"
|
||||
"@turf/turf": "^7.2.0",
|
||||
"coordtransform": "^2.1.2",
|
||||
"dayjs": "^1.11.13",
|
||||
"file-saver": "2.0.5",
|
||||
"maptalks": "^1.4.1"
|
||||
},
|
||||
"dcloudext": {
|
||||
"category": [
|
||||
|
||||
@ -5,9 +5,14 @@
|
||||
<template v-slot:body>
|
||||
<div style="min-height: 100%;display: flex;flex-direction: column;">
|
||||
<view style="position: relative;">
|
||||
<map :markers="map.markers" :latitude="map.latitude" :longitude="map.longitude"
|
||||
<maptalks-map
|
||||
:dataList="dataList"
|
||||
style="width: 750rpx;height: 70vh;"
|
||||
></maptalks-map>
|
||||
|
||||
<!-- <map :markers="map.markers" :latitude="map.latitude" :longitude="map.longitude"
|
||||
style="width: 750rpx;height: 400rpx;"
|
||||
></map>
|
||||
></map> -->
|
||||
|
||||
<view class="mp-base-block">
|
||||
<bpd-send-reciever-tmp :value="modelInfo"></bpd-send-reciever-tmp>
|
||||
@ -51,7 +56,9 @@
|
||||
|
||||
<script>
|
||||
import * as apiService from "@/common/api"
|
||||
import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
|
||||
// import BpdSendRecieverTmp from "@/components/buns-post-detail-templates/bpd-send-reciever-tmp"
|
||||
import BpdMapRecieverPanel from "@/components/buns-post-detail-templates/bpd-map-reciever-panel"
|
||||
import maptalksMap from "@/components/map-talks/maptalks-panel"
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -62,13 +69,14 @@
|
||||
return this.$store.getters.dicData
|
||||
},
|
||||
},
|
||||
components: { BpdSendRecieverTmp },
|
||||
components: { BpdMapRecieverPanel,maptalksMap },
|
||||
data() {
|
||||
return {
|
||||
queryOption: {
|
||||
billCode: '', // 运单id
|
||||
},
|
||||
modelInfo: {},
|
||||
dataList:[],
|
||||
map: {
|
||||
latitude: 23.106574, //纬度
|
||||
longitude: 113.324587, //经度
|
||||
@ -106,6 +114,33 @@
|
||||
let res = await apiService.getOrderDetail({billCode: this.queryOption.billCode, _loading: true})
|
||||
// 通过对象合并才能修改父级 数据
|
||||
Object.assign(this.modelInfo, res.data || {})
|
||||
|
||||
const resLbs = await apiService.getLbsRecordListByBillCode({
|
||||
billCode: this.queryOption.billCode
|
||||
});
|
||||
|
||||
if (resLbs && resLbs.code === 200) {
|
||||
let lbsRecordList=resLbs.data.lbsRecordList;
|
||||
if( lbsRecordList && lbsRecordList.length>0){
|
||||
let currentInfo=lbsRecordList[lbsRecordList.length-1];
|
||||
this.map.latitude=this.cvtToWgs84(currentInfo.longitude, currentInfo.latitude)[1];
|
||||
this.map.longitude=this.cvtToWgs84(currentInfo.longitude, currentInfo.latitude)[0];
|
||||
|
||||
this.dataList=lbsRecordList;
|
||||
const points = lbsRecordList.map(item => ({
|
||||
latitude: this.cvtToWgs84(item.longitude, item.latitude)[1],
|
||||
longitude: this.cvtToWgs84(item.longitude, item.latitude)[0]
|
||||
}));
|
||||
this.map.polyline[0].points = points;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
cvtToWgs84(longitude, latitude) {
|
||||
let lng = longitude / 1000000;
|
||||
let lat = latitude / 1000000;
|
||||
return coordtransform.wgs84togcj02(lng, lat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user