Commit b02d8665 by zhangxw

样式 分享bug修改

1 parent 52470548
...@@ -95,7 +95,7 @@ Page({ ...@@ -95,7 +95,7 @@ Page({
}); });
} else { } else {
wx.reLaunch({ wx.reLaunch({
url: `../../pages/newFindCar/findCar?sns=${this.data.sns}&isSharePage=true` url: `../../pages/newFindCar/findCar?sns=${encodeURIComponent(this.data.sns)}&isSharePage=true`
}); });
} }
...@@ -180,7 +180,7 @@ Page({ ...@@ -180,7 +180,7 @@ Page({
}); });
} else { // 新e盾分享页 } else { // 新e盾分享页
wx.reLaunch({ wx.reLaunch({
url: `../../pages/newFindCar/findCar?sns=${this.data.sns}&isSharePage=true` url: `../../pages/newFindCar/findCar?sns=${encodeURIComponent(this.data.sns)}&isSharePage=true`
}); });
} }
}else{ }else{
......
...@@ -35,12 +35,10 @@ Page({ ...@@ -35,12 +35,10 @@ Page({
wx.hideHomeButton() wx.hideHomeButton()
wx.hideShareMenu() wx.hideShareMenu()
} }
this.getData()
}, },
onShow(){ onShow(){
if (this.data.isUpdate) { this.myMap = this.selectComponent('#findcarMap')
this.myMap = this.selectComponent('#findcarMap')
this.getData()
}
}, },
// 刷新 // 刷新
refresh() { refresh() {
...@@ -95,26 +93,18 @@ Page({ ...@@ -95,26 +93,18 @@ 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),
// 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,
// 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,
padding: [80, 80, 80, 80]
}) })
// item.type = this.data.carInfoWindowObj['type'] || 'gpsLocation'
item.type = 'gpsLocation' // 默认显示GPS的定位类型 item.type = 'gpsLocation' // 默认显示GPS的定位类型
}) })
// this.myMap.getMapCtx().includePoints({ this.myMap.setData({ // 防止页面跳转回退页面未保留用户的操作 用mapContext 会有问题
// points: includePoints,
// padding: [60, 60, 60, 60]
// })
this.myMap.setData({ // 防止页面跳转回退页面未保留用户的操作 用mapContext.includePoints 会有问题
inPoints: includePoints inPoints: includePoints
}) })
this.setData({ this.setData({
...@@ -194,17 +184,6 @@ Page({ ...@@ -194,17 +184,6 @@ Page({
markers: markers markers: markers
}) })
this.moveToLocation(Number(this.data.carInfoWindowObj['gpsLocation'].elat), Number(this.data.carInfoWindowObj['gpsLocation'].elng)) this.moveToLocation(Number(this.data.carInfoWindowObj['gpsLocation'].elat), Number(this.data.carInfoWindowObj['gpsLocation'].elng))
// this.myMap.getMapCtx().translateMarker({ // 移动marker 在刷新后marker会不移动 小程序api有问题 后续再看看
// markerId: Number(this.data.carInfoWindowObj.sn),
// destination: {
// longitude: Number(this.data.carInfoWindowObj['gpsLocation'].elng),
// latitude: Number(this.data.carInfoWindowObj['gpsLocation'].elat),
// },
// duration: 100,
// animationEnd: () => {
// this.moveToLocation(Number(this.data.carInfoWindowObj['gpsLocation'].elat), Number(this.data.carInfoWindowObj['gpsLocation'].elng))
// }
// })
carInfoArr.forEach(val => { carInfoArr.forEach(val => {
if (val.id === this.data.carInfoWindowObj.id) { if (val.id === this.data.carInfoWindowObj.id) {
val.type = 'gpsLocation' val.type = 'gpsLocation'
...@@ -216,26 +195,21 @@ Page({ ...@@ -216,26 +195,21 @@ Page({
}) })
break break
case 2: // bsLocation case 2: // bsLocation
if (!this.data.carInfoWindowObj['bsLocation']) {
return wx.showToast({
title: '暂无基站定位数据',
icon: 'none'
})
}
if (data['type'] === 'bsLocation') return if (data['type'] === 'bsLocation') return
data['type'] = "bsLocation" data['type'] = "bsLocation"
includePoints.push({ includePoints.push({
latitude: Number(this.data.carInfoWindowObj['bsLocation'].elat), latitude: this.data.carInfoWindowObj['bsLocation'] && Number(this.data.carInfoWindowObj['bsLocation'].elat),
longitude: Number(this.data.carInfoWindowObj['bsLocation'].elng) longitude: this.data.carInfoWindowObj['bsLocation'] && Number(this.data.carInfoWindowObj['bsLocation'].elng)
}) })
this.setData({ this.setData({
includePoints: includePoints includePoints: includePoints
}) })
// this.myMap.getMapCtx().translateMarker({
// markerId: Number(this.data.carInfoWindowObj.sn),
// destination: {
// longitude: Number(this.data.carInfoWindowObj['bsLocation'].elng),
// latitude: Number(this.data.carInfoWindowObj['bsLocation'].elat),
// },
// duration: 100,
// animationEnd: () => {
// this.moveToLocation(Number(this.data.carInfoWindowObj['bsLocation'].elat), Number(this.data.carInfoWindowObj['bsLocation'].elng))
// }
// })
markers.forEach(val => { markers.forEach(val => {
if (val.id === Number(this.data.carInfoWindowObj.sn)){ if (val.id === Number(this.data.carInfoWindowObj.sn)){
val.latitude = Number(this.data.carInfoWindowObj['bsLocation'].elat) val.latitude = Number(this.data.carInfoWindowObj['bsLocation'].elat)
...@@ -357,8 +331,9 @@ Page({ ...@@ -357,8 +331,9 @@ Page({
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide: function () { onHide: function () {
this.setData({
isUpdate: false
})
}, },
/** /**
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
} }
.search-wrap{ .search-wrap{
position: relative; position: relative;
padding-right: 120px; padding-right: 240rpx;
} }
.search-wrap input{ .search-wrap input{
...@@ -18,30 +18,31 @@ ...@@ -18,30 +18,31 @@
} }
.search-picker text{ .search-picker text{
position: absolute; position: absolute;
width: 60px; display: inline-block;
right: 20px; width: 140rpx;
right: 40rpx;
height: 56rpx; height: 56rpx;
line-height: 56rpx; line-height: 56rpx;
padding-left: 10px; padding-left: 20rpx;
border-left: 1px solid #eee; border-left: 2rpx solid #eee;
} }
.select-dropdown-icon{ .select-dropdown-icon{
content: ''; content: '';
display: inline-block; display: inline-block;
border: 5px solid transparent; border: 10rpx solid transparent;
border-top-color: #c9c9c9; border-top-color: #c9c9c9;
position: absolute; position: absolute;
right: 10px; right: 20rpx;
top: 10px; top: 20rpx;
} }
.search-wrap .weui-icon-clear{ .search-wrap .weui-icon-clear{
right: 90px; right: 200rpx;
z-index: 100; z-index: 100;
} }
.result-list{ .result-list{
background-color: #fff; background-color: #fff;
color: #666; color: #666;
font-size: 14px; font-size: 28rpx;
} }
.result-list .title{ .result-list .title{
color: #000; color: #000;
...@@ -63,10 +64,10 @@ ...@@ -63,10 +64,10 @@
overflow: hidden; overflow: hidden;
} }
.result-list .weui-cell:first-child{ .result-list .weui-cell:first-child{
border-top: 1px solid #d9d9d9; border-top: 2rpx solid #d9d9d9;
} }
.result-list .weui-cell:last-child{ .result-list .weui-cell:last-child{
border-bottom: 1px solid #d9d9d9; border-bottom: 2rpx solid #d9d9d9;
} }
.none{ .none{
padding: 200rpx 0; padding: 200rpx 0;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
overflow-y: scroll; overflow-y: scroll;
} }
.toggle-bottom .toggle-list .list-item { .toggle-bottom .toggle-list .list-item {
padding: 10rpx 20rpx 10rpx 0; padding: 10rpx 20rpx 10rpx 20rpx;
border-bottom: 2rpx solid #ececec; border-bottom: 2rpx solid #ececec;
} }
.toggle-bottom .toggle-list .list-item:last-child { .toggle-bottom .toggle-list .list-item:last-child {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!