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 b9f50c08
authored
Apr 16, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
29a41770
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
33 deletions
components/myMap/myMap.js
components/myMap/myMap.wxml
pages/newFindCar/findCar.js
pages/newFindCar/findCar.wxml
pages/newMonitor/monitor.js
pages/newMonitor/monitor.wxml
pages/newTraReplay/traReplay.js
pages/newTraReplay/traReplay.wxml
components/myMap/myMap.js
View file @
b9f50c0
...
@@ -9,7 +9,8 @@ Component({
...
@@ -9,7 +9,8 @@ Component({
markers
:
Array
,
markers
:
Array
,
polyline
:
Array
,
polyline
:
Array
,
isLoading
:
Boolean
,
isLoading
:
Boolean
,
includePoints
:
Array
// 当前页面是否有marker或路径的左边点
includePoints
:
Array
,
// 当前页面是否有marker或路径的左边点
mapId
:
String
},
},
/**
/**
...
@@ -42,7 +43,7 @@ Component({
...
@@ -42,7 +43,7 @@ Component({
return
this
.
mapCtx
return
this
.
mapCtx
}
}
// 创建 map 上下文 MapContext 对象
// 创建 map 上下文 MapContext 对象
this
.
mapCtx
=
wx
.
createMapContext
(
'Mymap'
,
this
)
this
.
mapCtx
=
wx
.
createMapContext
(
this
.
data
.
mapId
,
this
)
return
this
.
mapCtx
return
this
.
mapCtx
},
},
bindmarkertap
(
e
)
{
bindmarkertap
(
e
)
{
...
...
components/myMap/myMap.wxml
View file @
b9f50c0
<view class="map-wrap">
<view class="map-wrap">
<!-- 地图组件 -->
<!-- 地图组件 -->
<map id="
Mymap
" class="my-map" polyline="{{polyline}}" markers="{{markers}}" longitude="{{currentLo}}" latitude="{{currentLa}}" scale="{{scale}}" enable-satellite="{{enableSatellite}}" bindmarkertap="bindmarkertap" data-num="1" enable-traffic="{{enableTraffic}}" show-location bindtap="mapClick">
<map id="
{{mapId}}
" class="my-map" polyline="{{polyline}}" markers="{{markers}}" longitude="{{currentLo}}" latitude="{{currentLa}}" scale="{{scale}}" enable-satellite="{{enableSatellite}}" bindmarkertap="bindmarkertap" data-num="1" enable-traffic="{{enableTraffic}}" show-location bindtap="mapClick">
</map>
</map>
<!-- 地图控件 -->
<!-- 地图控件 -->
<text class="icon icon-locate map-cmd-icon" catchtap="locateClick">
<text class="icon icon-locate map-cmd-icon" catchtap="locateClick">
...
...
pages/newFindCar/findCar.js
View file @
b9f50c0
...
@@ -35,9 +35,9 @@ Page({
...
@@ -35,9 +35,9 @@ Page({
wx
.
hideShareMenu
()
wx
.
hideShareMenu
()
}
}
},
},
onShow
(
options
){
onShow
(){
if
(
this
.
data
.
isUpdate
)
{
if
(
this
.
data
.
isUpdate
)
{
this
.
myMap
=
this
.
selectComponent
(
'#
my
Map'
)
this
.
myMap
=
this
.
selectComponent
(
'#
findcar
Map'
)
this
.
getData
()
this
.
getData
()
}
}
},
},
...
@@ -94,20 +94,20 @@ Page({
...
@@ -94,20 +94,20 @@ Page({
id
:
Number
(
item
.
sn
),
// 设备号唯一 可作为markerid
id
:
Number
(
item
.
sn
),
// 设备号唯一 可作为markerid
width
:
28
,
width
:
28
,
height
:
36
,
height
:
36
,
//
latitude: (this.data.carInfoWindowObj['type'] && Number(this.data.carInfoWindowObj[this.data.carInfoWindowObj['type']].elat)) || Number(item['gpsLocation'].elat), // 默认显示GPS定位位置
latitude
:
(
this
.
data
.
carInfoWindowObj
[
'type'
]
&&
Number
(
this
.
data
.
carInfoWindowObj
[
this
.
data
.
carInfoWindowObj
[
'type'
]].
elat
))
||
Number
(
item
[
'gpsLocation'
].
elat
),
// 默认显示GPS定位位置
//
longitude: (this.data.carInfoWindowObj['type'] && Number(this.data.carInfoWindowObj[this.data.carInfoWindowObj['type']].elng)) || Number(item['gpsLocation'].elng),
longitude
:
(
this
.
data
.
carInfoWindowObj
[
'type'
]
&&
Number
(
this
.
data
.
carInfoWindowObj
[
this
.
data
.
carInfoWindowObj
[
'type'
]].
elng
))
||
Number
(
item
[
'gpsLocation'
].
elng
),
latitude
:
Number
(
item
[
'gpsLocation'
].
elat
),
// 默认显示GPS定位位置
//
latitude: Number(item['gpsLocation'].elat), // 默认显示GPS定位位置
longitude
:
Number
(
item
[
'gpsLocation'
].
elng
),
//
longitude: Number(item['gpsLocation'].elng),
iconPath
:
item
.
source
===
1
?
'../../images/oncar.png'
:
'../../images/offcar.png'
iconPath
:
item
.
source
===
1
?
'../../images/oncar.png'
:
'../../images/offcar.png'
})
})
includePoints
.
push
({
includePoints
.
push
({
//
latitude: (this.data.carInfoWindowObj['type'] && this.data.carInfoWindowObj[this.data.carInfoWindowObj['type']].elat) || item['gpsLocation'].elat,
latitude
:
(
this
.
data
.
carInfoWindowObj
[
'type'
]
&&
this
.
data
.
carInfoWindowObj
[
this
.
data
.
carInfoWindowObj
[
'type'
]].
elat
)
||
item
[
'gpsLocation'
].
elat
,
//
longitude: (this.data.carInfoWindowObj['type'] && this.data.carInfoWindowObj[this.data.carInfoWindowObj['type']].elng) || item['gpsLocation'].elng,
longitude
:
(
this
.
data
.
carInfoWindowObj
[
'type'
]
&&
this
.
data
.
carInfoWindowObj
[
this
.
data
.
carInfoWindowObj
[
'type'
]].
elng
)
||
item
[
'gpsLocation'
].
elng
,
latitude
:
item
[
'gpsLocation'
].
elat
,
//
latitude: item['gpsLocation'].elat,
longitude
:
item
[
'gpsLocation'
].
elng
//
longitude: item['gpsLocation'].elng
})
})
//
item.type = this.data.carInfoWindowObj['type'] || 'gpsLocation'
item
.
type
=
this
.
data
.
carInfoWindowObj
[
'type'
]
||
'gpsLocation'
item
.
type
=
'gpsLocation'
// 默认显示GPS的定位类型
//
item.type = 'gpsLocation' // 默认显示GPS的定位类型
})
})
this
.
myMap
.
getMapCtx
().
includePoints
({
this
.
myMap
.
getMapCtx
().
includePoints
({
points
:
includePoints
,
points
:
includePoints
,
...
@@ -289,9 +289,6 @@ Page({
...
@@ -289,9 +289,6 @@ Page({
var
lng
,
lat
;
var
lng
,
lat
;
lng
=
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
].
elng
lng
=
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
].
elng
lat
=
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
].
elat
lat
=
this
.
data
.
carInfoWindowObj
[
'gpsLocation'
].
elat
this
.
setData
({
isUpdate
:
false
})
wx
.
navigateTo
({
// 车辆追踪gps定位坐标
wx
.
navigateTo
({
// 车辆追踪gps定位坐标
url
:
`../../pages/newCarTrace/carTrace?lat=
${
lat
}
&lng=
${
lng
}
`
url
:
`../../pages/newCarTrace/carTrace?lat=
${
lat
}
&lng=
${
lng
}
`
})
})
...
@@ -313,9 +310,6 @@ Page({
...
@@ -313,9 +310,6 @@ Page({
},
},
// 轨迹回放
// 轨迹回放
traReplay
(
e
)
{
traReplay
(
e
)
{
this
.
setData
({
isUpdate
:
false
})
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
`../../pages/newTraReplay/traReplay?sn=
${
encodeURIComponent
(
this
.
data
.
carInfoWindowObj
.
encryptSn
)}
&locationType=
${
this
.
data
.
carInfoWindowObj
.
type
}
`
url
:
`../../pages/newTraReplay/traReplay?sn=
${
encodeURIComponent
(
this
.
data
.
carInfoWindowObj
.
encryptSn
)}
&locationType=
${
this
.
data
.
carInfoWindowObj
.
type
}
`
});
});
...
@@ -337,9 +331,6 @@ Page({
...
@@ -337,9 +331,6 @@ Page({
},
},
// 实时监控
// 实时监控
monitor
()
{
monitor
()
{
this
.
setData
({
isUpdate
:
false
})
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
`../../pages/newMonitor/monitor?sn=
${
encodeURIComponent
(
this
.
data
.
carInfoWindowObj
.
encryptSn
)}
`
url
:
`../../pages/newMonitor/monitor?sn=
${
encodeURIComponent
(
this
.
data
.
carInfoWindowObj
.
encryptSn
)}
`
});
});
...
...
pages/newFindCar/findCar.wxml
View file @
b9f50c0
<view class="
content_page
">
<view class="
findCar_content
">
<myMap class="my-map" id="
my
Map" bind:getCarInfoWindowObj="getCarInfoWindowObj" bind:refresh="refresh" markers="{{markers}}" includePoints="{{includePoints}}" bind:locationCallback="locationCallback"></myMap>
<myMap class="my-map" id="
findcarMap" mapId="findcar
Map" bind:getCarInfoWindowObj="getCarInfoWindowObj" bind:refresh="refresh" markers="{{markers}}" includePoints="{{includePoints}}" bind:locationCallback="locationCallback"></myMap>
<!-- 找车按钮 -->
<!-- 找车按钮 -->
<view wx:if="{{!isSharePage}}" class="icon icon-findcar map-cmd-icon" bindtap="findCarClick"></view>
<view wx:if="{{!isSharePage}}" class="icon icon-findcar map-cmd-icon" bindtap="findCarClick"></view>
<!-- 信息窗体内容 -->
<!-- 信息窗体内容 -->
...
...
pages/newMonitor/monitor.js
View file @
b9f50c0
...
@@ -39,7 +39,7 @@ Page({
...
@@ -39,7 +39,7 @@ Page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
this
.
myMap
=
this
.
selectComponent
(
'#m
y
Map'
)
this
.
myMap
=
this
.
selectComponent
(
'#m
onitor
Map'
)
this
.
getPosition
()
this
.
getPosition
()
},
},
// 刷新
// 刷新
...
...
pages/newMonitor/monitor.wxml
View file @
b9f50c0
<view>
<view
class="monitor_content"
>
<myMap class="my-map" id="m
y
Map" polyline="{{polyline}}" includePoints="{{includePoints}}" markers="{{markers}}" bind:refresh="refresh" bind:mapCallback="mapCallback" bind:locationCallback="locationCallback"></myMap>
<myMap class="my-map" id="m
onitorMap" mapId="monitor
Map" polyline="{{polyline}}" includePoints="{{includePoints}}" markers="{{markers}}" bind:refresh="refresh" bind:mapCallback="mapCallback" bind:locationCallback="locationCallback"></myMap>
<view class="toggle-bottom {{isShowList ? '' : 'hidden'}}" id="toggleBottom">
<view class="toggle-bottom {{isShowList ? '' : 'hidden'}}" id="toggleBottom">
<icon class="toggle-btn active icon {{isShowList ? 'icon-toggle-down' : 'icon-toggle-up'}}" bindtap="listIconBatch"></icon>
<icon class="toggle-btn active icon {{isShowList ? 'icon-toggle-down' : 'icon-toggle-up'}}" bindtap="listIconBatch"></icon>
<scroll-view class="toggle-list" scroll-y="true" scroll-into-view="{{scrollIntoViewIndex}}">
<scroll-view class="toggle-list" scroll-y="true" scroll-into-view="{{scrollIntoViewIndex}}">
...
...
pages/newTraReplay/traReplay.js
View file @
b9f50c0
...
@@ -58,7 +58,7 @@ Page({
...
@@ -58,7 +58,7 @@ Page({
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
onShow
:
function
()
{
onShow
:
function
()
{
this
.
myMap
=
this
.
selectComponent
(
'#
m
yMap'
)
this
.
myMap
=
this
.
selectComponent
(
'#
traRepla
yMap'
)
},
},
// 刷新
// 刷新
refresh
()
{
refresh
()
{
...
@@ -318,7 +318,6 @@ Page({
...
@@ -318,7 +318,6 @@ Page({
* 生命周期函数--监听页面卸载
* 生命周期函数--监听页面卸载
*/
*/
onUnload
:
function
()
{
onUnload
:
function
()
{
},
},
/**
/**
...
...
pages/newTraReplay/traReplay.wxml
View file @
b9f50c0
<view class="
content_page
">
<view class="
traReplay_content
">
<view class="tabbar">
<view class="tabbar">
<view class="tabbar-item" bindtap="showModel">轨迹时间</view>
<view class="tabbar-item" bindtap="showModel">轨迹时间</view>
<picker
<picker
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<view class="select-dropdown-icon"></view>
<view class="select-dropdown-icon"></view>
</picker>
</picker>
</view>
</view>
<myMap class="my-map" id="
m
yMap" polyline="{{polyline}}" includePoints="{{includePoints}}" markers="{{markers}}" bind:refresh="refresh" bind:mapCallback="mapCallback" bind:locationCallback="locationCallback"></myMap>
<myMap class="my-map" id="
traReplayMap" mapId="traRepla
yMap" polyline="{{polyline}}" includePoints="{{includePoints}}" markers="{{markers}}" bind:refresh="refresh" bind:mapCallback="mapCallback" bind:locationCallback="locationCallback"></myMap>
<!-- 回放控制按钮 -->
<!-- 回放控制按钮 -->
<view class="btn-control" slot="bottomBox">
<view class="btn-control" slot="bottomBox">
<view class="icon icon-replay-play play-btn {{isReplayIng? '' : 'active'}}" bindtap="play"></view>
<view class="icon icon-replay-play play-btn {{isReplayIng? '' : 'active'}}" bindtap="play"></view>
...
...
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