|
@@ -207,17 +207,25 @@
|
|
|
updateCharger(pos){
|
|
|
// console.log('更新充电桩'+JSON.stringify(this.chargerList.length) )
|
|
|
// console.log('更新充电桩1'+JSON.stringify(pos) )
|
|
|
-// console.log('更新充电桩2'+JSON.stringify(this.chargerList[0].info))
|
|
|
// let index = this.chargerList.findIndex(item => item.info.latitude === pos.latitude && item.info.longitude === pos.longitude);
|
|
|
//let index = this.chargerList.findIndex(item => (Math.abs(item.info.longitude-pos.longitude)<0.000001 && Math.abs(item.info.longitude - pos.latitude)<0.000001));
|
|
|
let index = this.chargerList.findIndex(item => item.info.id === pos.id);
|
|
|
// console.log('更新充电桩['+ index + ']'+JSON.stringify(pos))
|
|
|
+ let colorBg = '#00BAC8';//#00b962
|
|
|
+ if(this.chargerList[index].info.type =='快充'){
|
|
|
+ colorBg = '#8486FF'
|
|
|
+ }else if(this.chargerList[index].info.type =='慢充'){
|
|
|
+ colorBg = '#9d9fff'
|
|
|
+ }
|
|
|
+ console.log('colorBg'+colorBg)
|
|
|
+ console.log('更新充电桩2'+JSON.stringify(this.chargerList[index].info))
|
|
|
+
|
|
|
if(index>=0){
|
|
|
- let station_icon2 = "width: 100px;height: 36px;line-height: 20px;border-radius: 50px;background-color: rgba(0, 185, 98, 100);text-align: center;display: flex;";
|
|
|
- let corner2=" width: 0;height: 0;position: absolute;top: 36px;left: 0;right: 0;margin: auto;border-bottom: 6px solid transparent;border-left: 6px solid transparent;border-right: 6px solid transparent;border-top: 8px solid #00b962 ;";
|
|
|
+ let station_icon2 = "width: 100px;height: 36px;line-height: 20px;border-radius: 50px;background-color: " + colorBg +";text-align: center;display: flex;";
|
|
|
+ let corner2=" width: 0;height: 0;position: absolute;top: 36px;left: 0;right: 0;margin: auto;border-bottom: 6px solid transparent;border-left: 6px solid transparent;border-right: 6px solid transparent;border-top: 8px solid " + colorBg +" ;";
|
|
|
|
|
|
let content = "<div style='" + station_icon2 + "'>";
|
|
|
- content+="<div style='width: 36px;height: 36px;line-height: 36px;text-align: center;border: 1px solid rgba(0, 185, 98, 100);border-radius: 999px;background-color: #fff;color: #00b962;' class='iconfont'></div>";
|
|
|
+ content+="<div style='width: 36px;height: 36px;line-height: 36px;text-align: center;border: 1px solid " + colorBg +";border-radius: 999px;background-color: #fff;color: " + colorBg +";' class='iconfont'></div>";
|
|
|
content+="<div style='color: #ffffff;line-height: 14px;padding: 4px;'>";
|
|
|
content+="<div style='"+corner2+"'></div>";
|
|
|
content+="<div class=''>";
|
|
@@ -240,8 +248,8 @@
|
|
|
if(this.chargerList[i].info.selected != null &&
|
|
|
this.chargerList[i].info.selected)
|
|
|
{
|
|
|
- let station_icon = "width: 36px;height: 36px;line-height: 36px;text-align: center;border: 1px solid rgba(133, 140, 255, 100); color: #b58cff; border-radius: 999px;";
|
|
|
- let corner = "width: 0;height: 0;position: absolute;top: 34px;left: 0;right: 0;margin: auto;border-bottom: 4px solid transparent;border-left: 4px solid transparent;border-right: 4px solid transparent;border-top: 6px solid #b58cff ;";
|
|
|
+ let station_icon = "width: 36px;height: 36px;line-height: 36px;text-align: center;border: 1px solid " + colorBg +"; color: " + colorBg +"; border-radius: 999px;";
|
|
|
+ let corner = "width: 0;height: 0;position: absolute;top: 34px;left: 0;right: 0;margin: auto;border-bottom: 4px solid transparent;border-left: 4px solid transparent;border-right: 4px solid transparent;border-top: 6px solid " + colorBg +" ;";
|
|
|
let content = "<div style='"+station_icon+"'><text class='iconfont'></text><div style='" + corner+"'></div></div>"
|
|
|
|
|
|
//let content = "<img src='"+this.chargerIcon+"' style='height: 40px;width: 40px' />";
|
|
@@ -254,10 +262,18 @@
|
|
|
|
|
|
},
|
|
|
addCharger(pos) {
|
|
|
+
|
|
|
+ let colorBg = '#00BAC8';//#00b962
|
|
|
+ if(pos.type =='快充'){
|
|
|
+ colorBg = '#8486FF'
|
|
|
+ }else if(pos.type =='慢充'){
|
|
|
+ colorBg = '#9d9fff'
|
|
|
+ }
|
|
|
+
|
|
|
// console.log('添加充电桩'+JSON.stringify(pos))
|
|
|
//let content = "<div style='height: 40px;width: 100px;display: flex;flex-direction: row; flex-wrap: wrap; background-color: #00B962!important;border-radius: 20px;'> <div><img src='"+this.chargerIcon+"' style='idth: 40px;height: 40px'></div><div style='display: flex;flex-direction:column;color:#FFFFFF'><div>¥1.5</div><div>空闲10</div> </div></div>";
|
|
|
- let station_icon = "width: 36px;height: 36px;line-height: 36px;text-align: center;border: 1px solid rgba(133, 140, 255, 100); color: #b58cff; border-radius: 999px;";
|
|
|
- let corner = "width: 0;height: 0;position: absolute;top: 34px;left: 0;right: 0;margin: auto;border-bottom: 4px solid transparent;border-left: 4px solid transparent;border-right: 4px solid transparent;border-top: 6px solid #b58cff ;";
|
|
|
+ let station_icon = "width: 36px;height: 36px;line-height: 36px;text-align: center;border: 1px solid "+ colorBg+"; color: "+ colorBg+"; border-radius: 999px;";
|
|
|
+ let corner = "width: 0;height: 0;position: absolute;top: 34px;left: 0;right: 0;margin: auto;border-bottom: 4px solid transparent;border-left: 4px solid transparent;border-right: 4px solid transparent;border-top: 6px solid "+ colorBg+" ;";
|
|
|
let content = "<div style='"+station_icon+"'><text class='iconfont'></text><div style='" + corner+"'></div></div>"
|
|
|
|
|
|
let marker = new AMap.Marker({
|