Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NewTruckTerminalSyetem
Project
Project
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
SQL_Mou
NewTruckTerminalSyetem
Commits
eafffacb
Commit
eafffacb
authored
Nov 17, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改订单里程算法
parent
095d0478
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
37 deletions
+14
-37
index.vue
...ews/MLargeScreen/components/startOrderReceiving/index.vue
+14
-37
No files found.
src/views/MLargeScreen/components/startOrderReceiving/index.vue
View file @
eafffacb
...
...
@@ -140,44 +140,21 @@ export default {
}
}
//获取车辆坐标计算距离并返回给后台
// httpGet(carRealTimeLocationQuery2,{name:resSon1.data.content[0].equipmentName}).then((res2) => {
// if(res2.data){
// if(this.oldxy.lat == 0 || this.oldxy.lng == 0){
// this.oldxy.lat = res2.data.location.y;
// this.oldxy.lng = res2.data.location.x;
// }else{
// let distance1 = this.getDistance(this.oldxy.lat,this.oldxy.lng,res2.data.location.y,res2.data.location.x) + parseFloat(res_1.data.content[0].mil);
// putForJson(dingDanBiaoCaoZuo,{id:res_1.data.content[0].id,mil:distance1}).then((res) => {});
// this.$nextTick(()=>{
// this.oldxy.lat = res2.data.location.y;
// this.oldxy.lng = res2.data.location.x;
// })
// }
// }
// });
if
(
navigator
.
geolocation
)
{
navigator
.
geolocation
.
getCurrentPosition
(
function
(
position
)
{
if
(
that
.
oldxy
.
lat
==
0
||
that
.
oldxy
.
lng
==
0
){
that
.
oldxy
.
lat
=
position
.
coords
.
latitude
;
that
.
oldxy
.
lng
=
position
.
coords
.
longitude
;
}
else
{
let
distance1
=
that
.
getDistance
(
that
.
oldxy
.
lat
,
that
.
oldxy
.
lng
,
position
.
coords
.
latitude
,
position
.
coords
.
longitude
)
+
parseFloat
(
res_1
.
data
.
content
[
0
].
mil
);
putForJson
(
dingDanBiaoCaoZuo
,{
id
:
res_1
.
data
.
content
[
0
].
id
,
mil
:
distance1
}).
then
((
res
)
=>
{});
that
.
$nextTick
(()
=>
{
that
.
oldxy
.
lat
=
position
.
coords
.
latitude
;
that
.
oldxy
.
lng
=
position
.
coords
.
longitude
;
})
}
},
function
(
error
)
{
var
errorType
=
[
'
您拒绝共享位置信息
'
,
'
获取不到位置信息
'
,
'
获取位置信息超时
'
];
console
.
log
(
errorType
[
error
.
code
-
1
]);
},{
enableHighAccuracy
:
false
,
httpGet
(
carRealTimeLocationQuery2
,{
name
:
resSon1
.
data
.
content
[
0
].
equipmentName
}).
then
((
res2
)
=>
{
if
(
res2
.
data
){
if
(
this
.
oldxy
.
lat
==
0
||
this
.
oldxy
.
lng
==
0
){
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
}
else
{
let
distance1
=
this
.
getDistance
(
this
.
oldxy
.
lat
,
this
.
oldxy
.
lng
,
res2
.
data
.
location
.
y
,
res2
.
data
.
location
.
x
)
+
parseFloat
(
res_1
.
data
.
content
[
0
].
mil
);
putForJson
(
dingDanBiaoCaoZuo
,{
id
:
res_1
.
data
.
content
[
0
].
id
,
mil
:
distance1
}).
then
((
res
)
=>
{});
this
.
$nextTick
(()
=>
{
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
})
}
);
}
}
}
);
}
});
}
...
...
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