Commit b02d8665 by zhangxw

样式 分享bug修改

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