|
@@ -24,8 +24,17 @@ Page({
|
|
|
dottedLine: true,
|
|
dottedLine: true,
|
|
|
color: "#eb2f06"
|
|
color: "#eb2f06"
|
|
|
}],
|
|
}],
|
|
|
- markers: [],
|
|
|
|
|
- pageSize: 20
|
|
|
|
|
|
|
+ markers: [{
|
|
|
|
|
+ id: 999,
|
|
|
|
|
+ latitude: '',
|
|
|
|
|
+ longitude: '',
|
|
|
|
|
+ iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/web-static/ship-red-icon.png",
|
|
|
|
|
+ height: 20,
|
|
|
|
|
+ width: 20
|
|
|
|
|
+ }],
|
|
|
|
|
+ pageSize: 20,
|
|
|
|
|
+ latitude: 31.891992,
|
|
|
|
|
+ longitude: 120.551369,
|
|
|
},
|
|
},
|
|
|
changeTab(e) {
|
|
changeTab(e) {
|
|
|
let {
|
|
let {
|
|
@@ -48,37 +57,39 @@ Page({
|
|
|
voyage,
|
|
voyage,
|
|
|
waybills
|
|
waybills
|
|
|
} = res.data.result
|
|
} = res.data.result
|
|
|
|
|
+ if (coordinates.length) {
|
|
|
|
|
+ let points = []
|
|
|
|
|
+ for (let i of coordinates) {
|
|
|
|
|
+ points.push({
|
|
|
|
|
+ latitude: i.latitude,
|
|
|
|
|
+ longitude: i.longitude
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ let {
|
|
|
|
|
+ latitude,
|
|
|
|
|
+ longitude
|
|
|
|
|
+ } = points[points.length - 1]
|
|
|
|
|
+ this.data.latitude = latitude
|
|
|
|
|
+ this.data.longitude = longitude
|
|
|
|
|
+ this.data.markers[0].latitude = latitude
|
|
|
|
|
+ this.data.markers[0].longitude = longitude
|
|
|
|
|
+ this.data.polyline[0].points = points
|
|
|
|
|
|
|
|
- let points = []
|
|
|
|
|
- for (let i of coordinates) {
|
|
|
|
|
- points.push({
|
|
|
|
|
- latitude: i.latitude,
|
|
|
|
|
- longitude: i.longitude
|
|
|
|
|
|
|
+ this.setData({
|
|
|
|
|
+ polyline: this.data.polyline,
|
|
|
|
|
+ markers: this.data.markers,
|
|
|
|
|
+ latitude: this.data.latitude,
|
|
|
|
|
+ longitude: this.data.longitude,
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
- let {
|
|
|
|
|
- latitude,
|
|
|
|
|
- longitude
|
|
|
|
|
- } = points[points.length - 1]
|
|
|
|
|
- let markers = [{
|
|
|
|
|
- id: 999,
|
|
|
|
|
- latitude,
|
|
|
|
|
- longitude,
|
|
|
|
|
- iconPath: "https://6875-huihenduo-2gx127w7f837b584-1255802371.tcb.qcloud.la/web-static/ship-red-icon.png",
|
|
|
|
|
- height: 20,
|
|
|
|
|
- width: 20
|
|
|
|
|
- }]
|
|
|
|
|
- this.data.polyline[0].points = points
|
|
|
|
|
|
|
+
|
|
|
this.setData({
|
|
this.setData({
|
|
|
coordinates,
|
|
coordinates,
|
|
|
medias,
|
|
medias,
|
|
|
policys,
|
|
policys,
|
|
|
voyage,
|
|
voyage,
|
|
|
waybills,
|
|
waybills,
|
|
|
- polyline: this.data.polyline,
|
|
|
|
|
- latitude,
|
|
|
|
|
- longitude,
|
|
|
|
|
- markers
|
|
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|