Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
上
上药订单生命周期升级
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sph
上药订单生命周期升级
Commits
276f17ed
Commit
276f17ed
authored
Oct 22, 2021
by
xiejb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单生命周期 地图调整
parent
50cc2b17
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
12 deletions
+30
-12
index.html
index.html
+1
-1
src/components/AMapView.vue
src/components/AMapView.vue
+23
-8
src/router/index.js
src/router/index.js
+1
-1
src/views/myOrder/detail/logisticsDetail.vue
src/views/myOrder/detail/logisticsDetail.vue
+3
-0
src/views/scanQRCodeTest/index.vue
src/views/scanQRCodeTest/index.vue
+2
-2
No files found.
index.html
View file @
276f17ed
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<meta
charset=
"utf-8"
>
<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"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"
>
<title>
上药移动
</title>
<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=
"http
s
://webapi.amap.com/maps?v=2.0&key=061c2a328572b71e2b26d9dc1a0cc703&plugin=AMap.GraspRoad"
></script>
</head>
</head>
<body>
<body>
<div
id=
"app"
></div>
<div
id=
"app"
></div>
...
...
src/components/AMapView.vue
View file @
276f17ed
...
@@ -54,8 +54,10 @@ export default {
...
@@ -54,8 +54,10 @@ export default {
zooms
:
[
5
,
15
]
zooms
:
[
5
,
15
]
})
})
if
(
this
.
transport
)
{
if
(
this
.
transport
)
{
console
.
log
(
'
=======
'
)
this
.
drawExelState
(
map
)
this
.
drawExelState
(
map
)
}
else
{
}
else
{
console
.
log
(
'
11111111111
'
)
this
.
drawPointLine
(
map
)
this
.
drawPointLine
(
map
)
}
}
},
},
...
@@ -76,15 +78,17 @@ export default {
...
@@ -76,15 +78,17 @@ export default {
let
pathLength
=
pathParam
.
length
let
pathLength
=
pathParam
.
length
// 由于高德地图对每次数据数量500的限制,需要将数据进行每500分段
// 由于高德地图对每次数据数量500的限制,需要将数据进行每500分段
// 按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
graspRoad
=
new
AMap
.
GraspRoad
()
// 定义一个二维数组,开始对每组数据进行操作
// 定义一个二维数组,开始对每组数据进行操作
let
tdGroup
=
[]
let
tdGroup
=
[]
for
(
let
i
=
0
;
i
<
group
;
i
++
)
{
for
(
let
i
=
0
;
i
<
group
;
i
++
)
{
// 每500一组切割,塞入二维数组中
// 每500一组切割,塞入二维数组中
tdGroup
.
push
(
pathParam
.
slice
(
i
*
500
,
(
i
+
1
)
*
50
0
))
tdGroup
.
push
(
pathParam
.
slice
(
i
*
490
,
(
i
+
1
)
*
49
0
))
}
}
console
.
log
(
tdGroup
)
// 遍历二维数组,对数组中的每个一维数组进行高德点转换
// 遍历二维数组,对数组中的每个一维数组进行高德点转换
tdGroup
.
forEach
((
itemArr
,
tdIndex
)
=>
{
tdGroup
.
forEach
((
itemArr
,
tdIndex
)
=>
{
// 用于转换的高德定位临时数组
// 用于转换的高德定位临时数组
...
@@ -171,6 +175,7 @@ export default {
...
@@ -171,6 +175,7 @@ export default {
let
endPoint
=
new
AMap
.
LngLat
(
_this
.
drivePoint
.
endPoint
.
longitude
,
_this
.
drivePoint
.
endPoint
.
latitude
)
let
endPoint
=
new
AMap
.
LngLat
(
_this
.
drivePoint
.
endPoint
.
longitude
,
_this
.
drivePoint
.
endPoint
.
latitude
)
// 塞入临时数据
// 塞入临时数据
let
aMapTemp
=
[
startPoint
,
currentPoint
,
endPoint
]
let
aMapTemp
=
[
startPoint
,
currentPoint
,
endPoint
]
console
.
log
(
currentItem
)
// 转换成高德点
// 转换成高德点
AMap
.
convertFrom
(
aMapTemp
,
'
gps
'
,
function
(
status
,
result
)
{
AMap
.
convertFrom
(
aMapTemp
,
'
gps
'
,
function
(
status
,
result
)
{
if
(
result
.
info
===
'
ok
'
)
{
if
(
result
.
info
===
'
ok
'
)
{
...
@@ -192,14 +197,21 @@ export default {
...
@@ -192,14 +197,21 @@ export default {
// 开始绘制车辆位置
// 开始绘制车辆位置
let
currentMarker
=
new
AMap
.
Marker
({
let
currentMarker
=
new
AMap
.
Marker
({
position
:
aMapLngLat
[
1
],
position
:
aMapLngLat
[
1
],
angle
:
parseInt
(
currentItem
.
direction
),
//
angle: parseInt(currentItem.direction),
offset
:
new
AMap
.
Pixel
(
-
15
,
-
20
),
offset
:
new
AMap
.
Pixel
(
-
15
,
-
20
),
icon
:
new
AMap
.
Icon
({
content
:
`<div class="markerlabel"><img src="
${
_this
.
icons
.
currentIcon
}
" style="width: 35px;transform:rotate(
${
currentItem
.
direction
}
deg)"><div class="marker">
${
currentItem
.
roadInfo
}
</div></div>`
image
:
_this
.
icons
.
currentIcon
,
// autoRotation: true,
size
:
new
AMap
.
Size
(
52
,
52
),
// 图标大小
// icon: new AMap.Icon({
imageSize
:
new
AMap
.
Size
(
30
,
40
)
// 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
)
map
.
add
(
currentMarker
)
// 开始绘制终点
// 开始绘制终点
let
endMarker
=
new
AMap
.
Marker
({
let
endMarker
=
new
AMap
.
Marker
({
...
@@ -230,6 +242,9 @@ export default {
...
@@ -230,6 +242,9 @@ export default {
border
:
0
;
border
:
0
;
background-color
:
transparent
;
background-color
:
transparent
;
}
}
.markerlabel
{
white-space
:
nowrap
;
}
.marker
{
.marker
{
border-radius
:
2px
;
border-radius
:
2px
;
...
...
src/router/index.js
View file @
276f17ed
...
@@ -20,7 +20,7 @@ Vue.use(Router)
...
@@ -20,7 +20,7 @@ Vue.use(Router)
const
routerList
=
[
const
routerList
=
[
{
{
path
:
'
/
'
,
path
:
'
/
'
,
redirect
:
'
/
scanQRCodeTest
'
redirect
:
'
/
myOrder
'
},
},
...
todo
,
...
todo
,
...
saleSituation
,
...
saleSituation
,
...
...
src/views/myOrder/detail/logisticsDetail.vue
View file @
276f17ed
...
@@ -239,6 +239,7 @@ export default {
...
@@ -239,6 +239,7 @@ export default {
rt
.
data
.
entity
.
shippingList
&&
rt
.
data
.
entity
.
shippingList
&&
rt
.
data
.
entity
.
shippingList
.
length
>
0
rt
.
data
.
entity
.
shippingList
.
length
>
0
)
{
)
{
console
.
log
(
rt
)
this
.
shippingInfo
=
rt
.
data
.
entity
.
shippingList
[
0
]
this
.
shippingInfo
=
rt
.
data
.
entity
.
shippingList
[
0
]
// 定义驾驶规划参数
// 定义驾驶规划参数
this
.
driveLine
.
startPoint
.
address
=
this
.
shippingInfo
.
pickingLocationDesc
this
.
driveLine
.
startPoint
.
address
=
this
.
shippingInfo
.
pickingLocationDesc
...
@@ -265,6 +266,8 @@ export default {
...
@@ -265,6 +266,8 @@ export default {
this
.
orderInfo
.
orderStatusCode
===
'
220
'
||
this
.
orderInfo
.
orderStatusCode
===
'
220
'
||
this
.
orderInfo
.
orderStatusCode
===
'
310
'
this
.
orderInfo
.
orderStatusCode
===
'
310
'
)
{
)
{
this
.
sendType
=
this
.
orderInfo
.
orderStatusCode
===
'
310
'
this
.
sendType
=
this
.
orderInfo
.
orderStatusCode
===
'
220
'
this
.
getGpsPoint
()
this
.
getGpsPoint
()
}
}
}
else
{
}
else
{
...
...
src/views/scanQRCodeTest/index.vue
View file @
276f17ed
...
@@ -186,12 +186,12 @@ export default {
...
@@ -186,12 +186,12 @@ export default {
activityQueryDocList
(
dict
).
then
(
rt
=>
{
activityQueryDocList
(
dict
).
then
(
rt
=>
{
if
(
rt
)
{
if
(
rt
)
{
// ios
// ios
if
(
type
===
'
4
2
'
)
{
if
(
type
===
'
4
1
'
)
{
this
.
iosInfo
=
rt
.
list
[
0
]
this
.
iosInfo
=
rt
.
list
[
0
]
this
.
versionNumber
=
this
.
iosInfo
.
title
this
.
versionNumber
=
this
.
iosInfo
.
title
this
.
updateonTime
=
this
.
iosInfo
.
updateon
this
.
updateonTime
=
this
.
iosInfo
.
updateon
// android
// android
}
else
if
(
type
===
'
4
3
'
)
{
}
else
if
(
type
===
'
4
0
'
)
{
this
.
androidInfo
=
rt
.
list
[
0
]
this
.
androidInfo
=
rt
.
list
[
0
]
this
.
versionNumber
=
this
.
androidInfo
.
title
this
.
versionNumber
=
this
.
androidInfo
.
title
this
.
updateonTime
=
this
.
androidInfo
.
updateon
this
.
updateonTime
=
this
.
androidInfo
.
updateon
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment