Commit 276f17ed authored by xiejb's avatar xiejb

订单生命周期 地图调整

parent 50cc2b17
......@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<title>上药移动</title>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=2.0&key=061c2a328572b71e2b26d9dc1a0cc703&plugin=AMap.GraspRoad"></script>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=061c2a328572b71e2b26d9dc1a0cc703&plugin=AMap.GraspRoad"></script>
</head>
<body>
<div id="app"></div>
......
......@@ -54,8 +54,10 @@ export default {
zooms: [5, 15]
})
if (this.transport) {
console.log('=======')
this.drawExelState(map)
} else {
console.log('11111111111')
this.drawPointLine(map)
}
},
......@@ -76,15 +78,17 @@ export default {
let pathLength = pathParam.length
// 由于高德地图对每次数据数量500的限制,需要将数据进行每500分段
// 按500分组时先计算有多少组,不足500的同样为一组,故向上取整
let group = Math.ceil(pathLength / 500)
let group = Math.ceil(pathLength / 490)
console.log(group)
// 定义高德 数据纠偏 对象
let graspRoad = new AMap.GraspRoad()
// 定义一个二维数组,开始对每组数据进行操作
let tdGroup = []
for (let i = 0; i < group; i++) {
// 每500一组切割,塞入二维数组中
tdGroup.push(pathParam.slice(i * 500, (i + 1) * 500))
tdGroup.push(pathParam.slice(i * 490, (i + 1) * 490))
}
console.log(tdGroup)
// 遍历二维数组,对数组中的每个一维数组进行高德点转换
tdGroup.forEach((itemArr, tdIndex) => {
// 用于转换的高德定位临时数组
......@@ -171,6 +175,7 @@ export default {
let endPoint = new AMap.LngLat(_this.drivePoint.endPoint.longitude, _this.drivePoint.endPoint.latitude)
// 塞入临时数据
let aMapTemp = [startPoint, currentPoint, endPoint]
console.log(currentItem)
// 转换成高德点
AMap.convertFrom(aMapTemp, 'gps', function (status, result) {
if (result.info === 'ok') {
......@@ -192,14 +197,21 @@ export default {
// 开始绘制车辆位置
let currentMarker = new AMap.Marker({
position: aMapLngLat[1],
angle: parseInt(currentItem.direction),
// angle: parseInt(currentItem.direction),
offset: new AMap.Pixel(-15, -20),
icon: new AMap.Icon({
image: _this.icons.currentIcon,
size: new AMap.Size(52, 52), // 图标大小
imageSize: new AMap.Size(30, 40)
})
content: `<div class="markerlabel"><img src="${_this.icons.currentIcon}" style="width: 35px;transform:rotate(${currentItem.direction}deg)"><div class="marker">${currentItem.roadInfo}</div></div>`
// autoRotation: true,
// icon: new AMap.Icon({
// image: _this.icons.currentIcon,
// size: new AMap.Size(52, 52), // 图标大小
// imageSize: new AMap.Size(30, 40)
// })
})
// currentMarker.setLabel({
// offset: new AMap.Pixel(4, 0), // 设置文本标注偏移量
// content: `<div style="transform:rotate(273deg)" class='marker'>${currentItem.roadInfo}</div>`, // 设置文本标注内容
// direction: 'right' // 设置文本标注方位
// })
map.add(currentMarker)
// 开始绘制终点
let endMarker = new AMap.Marker({
......@@ -230,6 +242,9 @@ export default {
border: 0;
background-color: transparent;
}
.markerlabel{
white-space: nowrap;
}
.marker{
border-radius: 2px;
......
......@@ -20,7 +20,7 @@ Vue.use(Router)
const routerList = [
{
path: '/',
redirect: '/scanQRCodeTest'
redirect: '/myOrder'
},
...todo,
...saleSituation,
......
......@@ -239,6 +239,7 @@ export default {
rt.data.entity.shippingList &&
rt.data.entity.shippingList.length > 0
) {
console.log(rt)
this.shippingInfo = rt.data.entity.shippingList[0]
// 定义驾驶规划参数
this.driveLine.startPoint.address = this.shippingInfo.pickingLocationDesc
......@@ -265,6 +266,8 @@ export default {
this.orderInfo.orderStatusCode === '220' ||
this.orderInfo.orderStatusCode === '310'
) {
this.sendType = this.orderInfo.orderStatusCode === '310'
this.sendType = this.orderInfo.orderStatusCode === '220'
this.getGpsPoint()
}
} else {
......
......@@ -186,12 +186,12 @@ export default {
activityQueryDocList(dict).then(rt => {
if (rt) {
// ios
if (type === '42') {
if (type === '41') {
this.iosInfo = rt.list[0]
this.versionNumber = this.iosInfo.title
this.updateonTime = this.iosInfo.updateon
// android
} else if (type === '43') {
} else if (type === '40') {
this.androidInfo = rt.list[0]
this.versionNumber = this.androidInfo.title
this.updateonTime = this.androidInfo.updateon
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment