Commit 073faa0e by zhangxw

优化

1 parent ab8d93b7
......@@ -174,9 +174,15 @@ Page({
wx.setStorageSync("sessionid", res.header["Set-Cookie"]);
wx.setStorageSync("userStatus", 1);
wx.setStorageSync("userinfo", data.data);
wx.switchTab({
url: '../../pages/findCar/findCar'
});
if (!this.data.isSharePage) {
wx.switchTab({
url: '../../pages/findCar/findCar'
});
} else { // 新e盾分享页
wx.reLaunch({
url: `../../pages/newFindCar/findCar?sns=${this.data.sns}&isSharePage=true`
});
}
}else{
wx.showModal({
content: data.message,
......
......@@ -74,7 +74,7 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
// onShareAppMessage: function () {
}
// }
})
\ No newline at end of file
......@@ -247,10 +247,18 @@ Page({
typeChange(e) {
let data = JSON.parse(JSON.stringify(this.data.carInfoWindowObj))
let carInfoArr = JSON.parse(JSON.stringify(this.data.carInfoArr))
let includePoints = JSON.parse(JSON.stringify(this.data.includePoints))
switch(Number(e.currentTarget.dataset.num)) {
case 1: // GPS
if (data['type'] === 'gpsLocation') return
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({
markerId: Number(this.data.carInfoWindowObj.sn),
destination: {
......@@ -285,6 +293,13 @@ Page({
case 2: // bsLocation
if (data['type'] === 'bsLocation') return
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({
markerId: Number(this.data.carInfoWindowObj.sn),
destination: {
......@@ -519,6 +534,7 @@ Page({
if(that.data.sns){
opts.path = `${opts.path}?sns=${encodeURIComponent(this.data.sns)}&isSharePage=true`;
}
console.log(opts)
return opts;
}
})
\ No newline at end of file
......@@ -220,7 +220,7 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
// onShareAppMessage: function () {
}
// }
})
\ No newline at end of file
......@@ -69,7 +69,9 @@ Page({
selectTime: '',
isReplayIng: false,
polyline: [],
includePoints: []
includePoints: [],
speedItemsIndex: 0,
isReplayIng: false
})
this.myMap.getMapCtx().removeMarkers({
markerIds: [1, 2]
......@@ -188,6 +190,9 @@ Page({
},
// 播放
play() {
this.beginTrack()
},
beginTrack() {
if (this.data.polyline.length) {
this.myMap.getMapCtx().removeMarkers({
markerIds: [1]
......@@ -203,29 +208,26 @@ Page({
this.myMap.getMapCtx().addMarkers({
markers: marker,
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() {
},
......@@ -300,7 +302,7 @@ Page({
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
// onShareAppMessage: function () {
}
// }
})
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!