Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
e-shield-miniprogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 073faa0e
authored
Apr 14, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化
1 parent
ab8d93b7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
29 deletions
pages/loading/loading.js
pages/newCarTrace/carTrace.js
pages/newFindCar/findCar.js
pages/newMonitor/monitor.js
pages/newTraReplay/traReplay.js
pages/loading/loading.js
View file @
073faa0
...
@@ -174,9 +174,15 @@ Page({
...
@@ -174,9 +174,15 @@ Page({
wx
.
setStorageSync
(
"sessionid"
,
res
.
header
[
"Set-Cookie"
]);
wx
.
setStorageSync
(
"sessionid"
,
res
.
header
[
"Set-Cookie"
]);
wx
.
setStorageSync
(
"userStatus"
,
1
);
wx
.
setStorageSync
(
"userStatus"
,
1
);
wx
.
setStorageSync
(
"userinfo"
,
data
.
data
);
wx
.
setStorageSync
(
"userinfo"
,
data
.
data
);
wx
.
switchTab
({
if
(
!
this
.
data
.
isSharePage
)
{
url
:
'../../pages/findCar/findCar'
wx
.
switchTab
({
});
url
:
'../../pages/findCar/findCar'
});
}
else
{
// 新e盾分享页
wx
.
reLaunch
({
url
:
`../../pages/newFindCar/findCar?sns=
${
this
.
data
.
sns
}
&isSharePage=true`
});
}
}
else
{
}
else
{
wx
.
showModal
({
wx
.
showModal
({
content
:
data
.
message
,
content
:
data
.
message
,
...
...
pages/newCarTrace/carTrace.js
View file @
073faa0
...
@@ -74,7 +74,7 @@ Page({
...
@@ -74,7 +74,7 @@ Page({
/**
/**
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
onShareAppMessage
:
function
()
{
//
onShareAppMessage: function () {
}
//
}
})
})
\ No newline at end of file
\ No newline at end of file
pages/newFindCar/findCar.js
View file @
073faa0
...
@@ -247,10 +247,18 @@ Page({
...
@@ -247,10 +247,18 @@ Page({
typeChange
(
e
)
{
typeChange
(
e
)
{
let
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
carInfoWindowObj
))
let
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
carInfoWindowObj
))
let
carInfoArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
carInfoArr
))
let
carInfoArr
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
carInfoArr
))
let
includePoints
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
.
includePoints
))
switch
(
Number
(
e
.
currentTarget
.
dataset
.
num
))
{
switch
(
Number
(
e
.
currentTarget
.
dataset
.
num
))
{
case
1
:
// GPS
case
1
:
// GPS
if
(
data
[
'type'
]
===
'gpsLocation'
)
return
if
(
data
[
'type'
]
===
'gpsLocation'
)
return
data
[
'type'
]
=
"gpsLocation"
data
[
'type'
]
=
"gpsLocation"
includePoints
.
push
({
latitude
:
Number
(
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
].
elat
),
longitude
:
Number
(
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
].
elng
)
})
this
.
setData
({
includePoints
:
includePoints
})
this
.
myMap
.
getMapCtx
().
translateMarker
({
this
.
myMap
.
getMapCtx
().
translateMarker
({
markerId
:
Number
(
this
.
data
.
carInfoWindowObj
.
sn
),
markerId
:
Number
(
this
.
data
.
carInfoWindowObj
.
sn
),
destination
:
{
destination
:
{
...
@@ -285,6 +293,13 @@ Page({
...
@@ -285,6 +293,13 @@ Page({
case
2
:
// bsLocation
case
2
:
// bsLocation
if
(
data
[
'type'
]
===
'bsLocation'
)
return
if
(
data
[
'type'
]
===
'bsLocation'
)
return
data
[
'type'
]
=
"bsLocation"
data
[
'type'
]
=
"bsLocation"
includePoints
.
push
({
latitude
:
Number
(
this
.
data
.
carInfoWindowObj
[
'bsLocation'
].
elat
),
longitude
:
Number
(
this
.
data
.
carInfoWindowObj
[
'bsLocation'
].
elng
)
})
this
.
setData
({
includePoints
:
includePoints
})
this
.
myMap
.
getMapCtx
().
translateMarker
({
this
.
myMap
.
getMapCtx
().
translateMarker
({
markerId
:
Number
(
this
.
data
.
carInfoWindowObj
.
sn
),
markerId
:
Number
(
this
.
data
.
carInfoWindowObj
.
sn
),
destination
:
{
destination
:
{
...
@@ -519,6 +534,7 @@ Page({
...
@@ -519,6 +534,7 @@ Page({
if
(
that
.
data
.
sns
){
if
(
that
.
data
.
sns
){
opts
.
path
=
`
${
opts
.
path
}
?sns=
${
encodeURIComponent
(
this
.
data
.
sns
)}
&isSharePage=true`
;
opts
.
path
=
`
${
opts
.
path
}
?sns=
${
encodeURIComponent
(
this
.
data
.
sns
)}
&isSharePage=true`
;
}
}
console
.
log
(
opts
)
return
opts
;
return
opts
;
}
}
})
})
\ No newline at end of file
\ No newline at end of file
pages/newMonitor/monitor.js
View file @
073faa0
...
@@ -220,7 +220,7 @@ Page({
...
@@ -220,7 +220,7 @@ Page({
/**
/**
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
onShareAppMessage
:
function
()
{
//
onShareAppMessage: function () {
}
//
}
})
})
\ No newline at end of file
\ No newline at end of file
pages/newTraReplay/traReplay.js
View file @
073faa0
...
@@ -69,7 +69,9 @@ Page({
...
@@ -69,7 +69,9 @@ Page({
selectTime
:
''
,
selectTime
:
''
,
isReplayIng
:
false
,
isReplayIng
:
false
,
polyline
:
[],
polyline
:
[],
includePoints
:
[]
includePoints
:
[],
speedItemsIndex
:
0
,
isReplayIng
:
false
})
})
this
.
myMap
.
getMapCtx
().
removeMarkers
({
this
.
myMap
.
getMapCtx
().
removeMarkers
({
markerIds
:
[
1
,
2
]
markerIds
:
[
1
,
2
]
...
@@ -188,6 +190,9 @@ Page({
...
@@ -188,6 +190,9 @@ Page({
},
},
// 播放
// 播放
play
()
{
play
()
{
this
.
beginTrack
()
},
beginTrack
()
{
if
(
this
.
data
.
polyline
.
length
)
{
if
(
this
.
data
.
polyline
.
length
)
{
this
.
myMap
.
getMapCtx
().
removeMarkers
({
this
.
myMap
.
getMapCtx
().
removeMarkers
({
markerIds
:
[
1
]
markerIds
:
[
1
]
...
@@ -203,29 +208,26 @@ Page({
...
@@ -203,29 +208,26 @@ Page({
this
.
myMap
.
getMapCtx
().
addMarkers
({
this
.
myMap
.
getMapCtx
().
addMarkers
({
markers
:
marker
,
markers
:
marker
,
success
:
()
=>
{
success
:
()
=>
{
this
.
beginTrack
()
this
.
setData
({
isReplayIng
:
true
})
this
.
myMap
.
getMapCtx
().
moveAlong
({
markerId
:
1
,
path
:
this
.
data
.
polyline
[
0
].
points
,
duration
:
this
.
data
.
duration
,
success
:
(
res
)
=>
{
this
.
setData
({
isReplayIng
:
false
})
},
fail
:
()
=>
{
this
.
beginTrack
()
}
})
}
}
})
})
}
}
},
},
beginTrack
()
{
this
.
setData
({
isReplayIng
:
true
})
this
.
myMap
.
getMapCtx
().
moveAlong
({
markerId
:
1
,
path
:
this
.
data
.
polyline
[
0
].
points
,
duration
:
this
.
data
.
duration
,
success
:
(
res
)
=>
{
this
.
setData
({
isReplayIng
:
false
})
},
fail
:
()
=>
{
this
.
beginTrack
()
}
})
},
// 暂停
// 暂停
pause
()
{
pause
()
{
},
},
...
@@ -300,7 +302,7 @@ Page({
...
@@ -300,7 +302,7 @@ Page({
/**
/**
* 用户点击右上角分享
* 用户点击右上角分享
*/
*/
onShareAppMessage
:
function
()
{
//
onShareAppMessage: function () {
}
//
}
})
})
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment