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 2646a9de
authored
Apr 28, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
脏数据拦截优化
1 parent
48fc6a15
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
28 deletions
pages/newFindCar/findCar.js
project.config.json
pages/newFindCar/findCar.js
View file @
2646a9d
...
...
@@ -85,23 +85,40 @@ Page({
let
[
markers
,
includePoints
]
=
[[],
[]]
if
(
res
.
data
.
length
>
0
)
{
for
(
var
i
=
0
;
i
<
res
.
data
.
length
;
i
++
)
{
markers
.
push
({
id
:
Number
(
res
.
data
[
i
].
sn
),
// 设备号唯一 可作为markerid
width
:
28
,
height
:
36
,
latitude
:
Number
(
res
.
data
[
i
][
'gpsLocation'
].
elat
),
// 默认显示GPS定位位置
longitude
:
Number
(
res
.
data
[
i
][
'gpsLocation'
].
elng
),
iconPath
:
res
.
data
[
i
].
source
===
1
?
'../../images/oncar.png'
:
'../../images/offcar.png'
})
includePoints
.
push
({
latitude
:
res
.
data
[
i
][
'gpsLocation'
].
elat
,
longitude
:
res
.
data
[
i
][
'gpsLocation'
].
elng
,
padding
:
[
80
,
80
,
80
,
80
]
})
res
.
data
[
i
].
type
=
'gpsLocation'
// 默认显示GPS的定位类型
if
(
res
.
data
[
i
][
'gpsLocation'
]
&&
res
.
data
[
i
][
'gpsLocation'
].
elat
&&
res
.
data
[
i
][
'gpsLocation'
].
elng
)
{
markers
.
push
({
id
:
Number
(
res
.
data
[
i
].
sn
),
// 设备号唯一 可作为markerid
width
:
28
,
height
:
36
,
latitude
:
Number
(
res
.
data
[
i
][
'gpsLocation'
].
elat
),
// 默认显示GPS定位位置
longitude
:
Number
(
res
.
data
[
i
][
'gpsLocation'
].
elng
),
iconPath
:
res
.
data
[
i
].
source
===
1
?
'../../images/oncar.png'
:
'../../images/offcar.png'
})
res
.
data
[
i
].
type
=
'gpsLocation'
includePoints
.
push
({
latitude
:
res
.
data
[
i
][
'gpsLocation'
].
elat
,
longitude
:
res
.
data
[
i
][
'gpsLocation'
].
elng
,
padding
:
[
80
,
80
,
80
,
80
]
})
}
else
if
(
res
.
data
[
i
][
'bsLocation'
]
&&
res
.
data
[
i
][
'bsLocation'
].
elat
&&
res
.
data
[
i
][
'bsLocation'
].
elng
)
{
markers
.
push
({
id
:
Number
(
res
.
data
[
i
].
sn
),
// 设备号唯一 可作为markerid
width
:
28
,
height
:
36
,
latitude
:
Number
(
res
.
data
[
i
][
'bsLocation'
].
elat
),
// 无gps定位数据
longitude
:
Number
(
res
.
data
[
i
][
'bsLocation'
].
elng
),
iconPath
:
res
.
data
[
i
].
source
===
1
?
'../../images/oncar.png'
:
'../../images/offcar.png'
})
includePoints
.
push
({
latitude
:
res
.
data
[
i
][
'bsLocation'
].
elat
,
longitude
:
res
.
data
[
i
][
'bsLocation'
].
elng
,
padding
:
[
80
,
80
,
80
,
80
]
})
res
.
data
[
i
].
type
=
'bsLocation'
}
let
typeArr
=
[
'gpsLocation'
,
'bsLocation'
]
for
(
var
j
=
0
;
j
<
typeArr
.
length
;
j
++
)
{
await
this
.
getTransferAddress
(
res
.
data
[
i
],
typeArr
[
j
])
if
(
res
.
data
[
i
][
typeArr
[
j
]]
&&
res
.
data
[
i
][
typeArr
[
j
]].
elat
&&
res
.
data
[
i
][
typeArr
[
j
]].
elng
)
await
this
.
getTransferAddress
(
res
.
data
[
i
],
typeArr
[
j
])
}
}
this
.
setData
({
...
...
@@ -111,9 +128,7 @@ Page({
})
wx
.
getSystemInfo
({
success
:
(
res
)
=>
{
console
.
log
(
res
)
if
(
res
.
platform
==
'devtools'
)
{
// 开发工具上include-points 失效
console
.
log
(
'123'
)
this
.
myMap
.
getMapCtx
().
includePoints
({
points
:
includePoints
,
padding
:
[
80
,
80
,
80
,
80
]
...
...
@@ -163,6 +178,12 @@ Page({
let
markers
=
this
.
data
.
markers
switch
(
Number
(
e
.
currentTarget
.
dataset
.
num
))
{
case
1
:
// GPS
if
(
!
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
]
||
!
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
].
elat
||
!
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
].
elng
)
{
return
wx
.
showToast
({
title
:
'暂无GPS定位数据'
,
icon
:
'none'
})
}
if
(
data
[
'type'
]
===
'gpsLocation'
)
return
data
[
'type'
]
=
"gpsLocation"
includePoints
.
push
({
...
...
@@ -191,7 +212,7 @@ Page({
})
break
case
2
:
// bsLocation
if
(
!
this
.
data
.
carInfoWindowObj
[
'bsLocation'
])
{
if
(
!
this
.
data
.
carInfoWindowObj
[
'bsLocation'
]
||
!
this
.
data
.
carInfoWindowObj
[
'bsLocation'
].
elat
||
!
this
.
data
.
carInfoWindowObj
[
'bsLocation'
].
elng
)
{
return
wx
.
showToast
({
title
:
'暂无基站定位数据'
,
icon
:
'none'
...
...
project.config.json
View file @
2646a9d
...
...
@@ -3,37 +3,35 @@
"setting"
:
{
"urlCheck"
:
false
,
"es6"
:
true
,
"enhance"
:
true
,
"postcss"
:
true
,
"preloadBackgroundData"
:
false
,
"minified"
:
true
,
"newFeature"
:
true
,
"coverView"
:
true
,
"nodeModules"
:
false
,
"autoAudits"
:
false
,
"showShadowRootInWxmlPanel"
:
true
,
"scopeDataCheck"
:
false
,
"uglifyFileName"
:
false
,
"checkInvalidKey"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"compileHotReLoad"
:
false
,
"lazyloadPlaceholderEnable"
:
false
,
"useMultiFrameRuntime"
:
true
,
"useApiHook"
:
true
,
"useApiHostProcess"
:
true
,
"babelSetting"
:
{
"ignore"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
},
"useIsolateContext"
:
false
,
"userConfirmedBundleSwitch"
:
false
,
"useIsolateContext"
:
true
,
"useCompilerModule"
:
true
,
"userConfirmedUseCompilerModuleSwitch"
:
false
,
"packNpmManually"
:
false
,
"packNpmRelationList"
:
[],
"minifyWXSS"
:
true
,
"enhance"
:
true
,
"preloadBackgroundData"
:
false
,
"uglifyFileName"
:
false
,
"compileHotReLoad"
:
false
,
"lazyloadPlaceholderEnable"
:
false
,
"disableUseStrict"
:
false
,
"minifyWXML"
:
true
,
"showES6CompileOption"
:
false
,
"useCompilerPlugins"
:
false
,
"ignoreUploadUnusedFiles"
:
true
,
...
...
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