zhengkaixin 1 year ago
parent
commit
84975a2133

+ 1 - 1
.env.dev.js

@@ -2,7 +2,7 @@ const UNI_APP = {
 	ProjectName :"51充电联盟",
 	BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
 
-	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 
 	//BASE_URL: 'http://192.168.77.162:8081/charging-station/' ,
 	//PARK_URL: 'http://192.168.11.120:8082/charging-parking/' ,

+ 1 - 1
apis/index.js

@@ -37,7 +37,7 @@ export function codeOperation(url) {
 			return	'/pages/user/finance/rechargeRes?id=' + id
 		}
 		if(str2 == 'C') {
-			return	'/pages/user/discountCard/paymentSuccess?id=' + id
+			return	'/pages/discountCard/paymentSuccess?id=' + id
 		}
 	} else {
 		return false;

+ 38 - 110
components/Chargermap.vue

@@ -90,68 +90,7 @@
 			};
 		},
 		methods:{
-			/*
-			getLocation1() {
-//			  //'getLocation');
-			  const self = this;
-			  AMap.plugin('AMap.Geolocation', function () {
-				var geolocation = new AMap.Geolocation({
-				  // 是否使用高精度定位,默认:true
-				  enableHighAccuracy: true,
-				  // 设置定位超时时间,默认:无穷大
-				  timeout: 10000
-				});
-				 
-				geolocation.getCurrentPosition();
-				AMap.event.addListener(geolocation, 'complete', onComplete);
-				AMap.event.addListener(geolocation, 'error', onError);
-				 
-				function onComplete (data) {
-				  // data是具体的定位信息
-				  self.$emit('location',data);
-				  //'定位成功信息:', data.addressComponent.city);
-				  self.city = data.addressComponent.city;
-				}
-				 
-				function onError (data) {
-				  // 定位出错
-//				  //'定位失败错误:', data);
-				  // 调用IP定位
-				  let ret = { position:{longitude: 112.28468,latitude: 30.307094}};
-				  self.$emit('location',ret);
-				  //self.getLngLatLocation();
-				}
-			  });
-			}, 
-			// 通过IP获取当前位置
-			getLngLatLocation () {
-				const self = this;
-			  AMap.plugin('AMap.CitySearch', function () {
-				var citySearch = new AMap.CitySearch();
-				citySearch.getLocalCity(function (status, result) {
-				  if (status === 'complete' && result.info === 'OK') {
-					// 查询成功,result即为当前所在城市信息
-					////'通过ip获取当前城市:', result);
-					// 逆向地理编码
-					AMap.plugin('AMap.Geocoder', function () {
-					  var geocoder = new AMap.Geocoder({
-						// city 指定进行编码查询的城市,支持传入城市名、adcode 和 citycode
-						city: result.adcode
-					  });
-		 
-					  var lnglat = result.rectangle.split(';')[0].split(',');
-					  geocoder.getAddress(lnglat, function (status, data) {
-						if (status === 'complete' && data.info === 'OK') {
-						  // result为对应的地理位置详细信息	
-						   //self.$emit('location',data);
-							//'location'+JSON.stringify(data));
-						}
-					  });
-					});
-				  }
-				});
-			  });
-			}, */
+		
 			getPositionByLonLats(pos) {
 				var _this = this;
 				MapLoader().then(AMap => {
@@ -193,19 +132,7 @@
 							 
 							resolve(result.routes[0])
 					  })
-					  /*
-					  var startLngLat2 = [_this.longitude, _this.latitude]
-					  var endLngLat2 = [_this.longitude2, _this.latitude2]
 					
-					  
-					  driving.search(startLngLat2, endLngLat2, function (status, result) {
-												//result)
-												//result.routes[0].time)//秒
-												//result.routes[0].distance)//米
-												uni.showToast({
-													title:result.routes[0].time+"秒,"+result.routes[0].distance+"米"
-												})
-					  })*/
 					})
 				})
 			 
@@ -237,16 +164,19 @@
 				
 			},
 			updateCharger(pos){ 
-				
+				console.log()
+				if(this.chargerList.length==0){
+					return
+				}
 				//'更新充电桩1'+JSON.stringify(pos) ) 
 //				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);
 //					//'更新充电桩['+ index + ']'+JSON.stringify(pos)) 
 				let colorBg = '#00BAC8';//#00b962
-				if(this.chargerList[index].info.type =='快充'){
+				if(this.chargerList[index].info.fastNum){
 					colorBg = '#8486FF'
-				}else if(this.chargerList[index].info.type =='慢充'){
+				}else if(this.chargerList[index].info.slowNum ){
 					colorBg = '#00b962'
 				} 
 //				//'colorBg'+colorBg)
@@ -254,12 +184,15 @@
 				
 				if(index>=0){
 					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 corner2=" width: 0;height: 0;position: relative;top: 0px;left: 0px;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 " + colorBg +";border-radius: 999px;background-color: #fff;color: " + colorBg +";' class='iconfont'>&#xe606;</div>";
-					content+="<div style='color: #ffffff;line-height: 14px;padding: 4px;font-size: 14px'>";
+					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'>&#xe606";
 					content+="<div style='"+corner2+"'></div>";
+					content+="</div>";
+					
+					content+="<div style='color: #ffffff;line-height: 14px;padding: 4px;font-size: 14px'>";
+					
 					content+="<div class=''>";
 					// if(pos.price != null) {
 					// 	content+= "¥" + pos.price.toString();
@@ -290,15 +223,26 @@
 // 					//'找到充电桩[]'+content)
 					//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.chargerSelectedIcon+"' style='idth: 40px;height: 40px'></div><div style='display: flex;flex-direction:column;color:#FFFFFF;'><div style='margin-left:10px'>¥"+ pos.price +"</div><div style='margin-left:10px'>空闲"+pos.idleNum + "</div> </div></div>";
 					this.chargerList[index].info.selected = true;
-					this.chargerList[index].marker.setContent(content);		
+					this.chargerList[index].marker.setContent(content);
+					this.chargerList[index].marker.setzIndex(920);
+					//this.chargerList[index].marker.z-Index=999
 					
+					 
 				} 
 				for(let i = 0;i < this.chargerList.length;i++){
 					if(index == i)
 						continue;
+						
+						
 					if(this.chargerList[i].info.selected != null && 
 						this.chargerList[i].info.selected)
 						{
+							if(this.chargerList[i].info.fastNum){
+								colorBg = '#8486FF'
+							}else if(this.chargerList[i].info.slowNum ){
+								colorBg = '#00b962'
+							} 
+							
 							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: 37px;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+";background-color: #fff;' ><text class='iconfont' >&#xe606;</text><div style='" + corner+"'></div></div>"
@@ -307,6 +251,8 @@
 							this.chargerList[i].marker.setContent(content);
 							this.chargerList[i].info.selected = false;
 							//'restore'+JSON.stringify(this.chargerList[i].info))
+							this.chargerList[i].marker.setzIndex(900);
+							
 						}
 				}
 				
@@ -314,15 +260,15 @@
 			},
  		    addCharger(pos) {
 				
-				 
-				
-				let colorBg = '#00BAC8';//#00b962
-				if(pos.type =='快充'){
-					colorBg = '#8486FF'
-				}else if(pos.type =='慢充'){
+				let colorBg = '#00BAC8';
+				//let colorBg = 'red';
+				if(pos.fastNum){
+					colorBg = '#8161FF'
+				}else if(pos.slowNum){
 					colorBg = '#00b962'
 				} 
 				
+				
 //				//'添加充电桩'+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 "+ colorBg+";	color: "+ colorBg+";	border-radius: 999px;";	
@@ -386,40 +332,21 @@
 						}
 						this.mapcharger.remove(this.chargerList[i]);
 					}
-					 
+					
 					this.chargerList=[]
 					for(var i in sz){
 						var ob=sz[i];
 						this.addCharger(ob);
-						/*var ob1 = new AMap.Marker({
-						    position: new AMap.LngLat(ob.longitude,ob.latitude),   // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-						    title: '北京'
-						});
-						this.mapcharger.add(ob1);*/
-						/*
-						var ob1=new AMap.Marker({
-							map: this.mapcharger,
-							position: [ob.longitude,ob.latitude],
-							//offset: new AMap.Pixel(-5, -5),
-							//offset: new AMap.Pixel(-18, -40),
-							content:"<img src='"+icon0+"' style='height: 40px;width: 40px' />",
-							title:'test111111111111111',
-							zIndex:900,
-							autoRotation: true,
-						});
-						this.myEmit("car",ob1,ob)
 						
-						*/
-						//this.mapcharger.add(ob1);
 						 
 					}
 					
 			},
 			myEmit(type,ob1,obj){
 				var _this=this;
-				
+				console.log("myEmit")
 				AMap.event.addListener(ob1, 'click', function(e) {
-					
+					console.log("myEmit2",type,ob1,obj)
 					_this.$emit('clickMap',{
 						type:type,
 						obj:obj
@@ -445,7 +372,8 @@
 				}
 			},
 			setCenter(item){ 
-//				this.enableMove(false);
+//				this.enableMove(false);
+
 				this.removeMove();
 //				//'setCenter'+JSON.stringify(item))
 				if(this.mapcharger){

+ 0 - 724
components/Chargermap2.vue

@@ -1,724 +0,0 @@
-<template>
-	<view >
-		<view id="container" :style="myStyle"></view>
-	
-			<u-icon name="map-fill" v-if="false" class="input-card"  style="width: 24rem;top: 130px;width: 20px;height: 20px;" color="#999" size="40"></u-icon>
-			
-	</view>
-</template>
-
-<script>
-		import MapLoader from '@/utils/AMap'
-	let _self;
-	 
-	function mapMovestart(e) {
-		//'movestart')
-	}
-	function mapMove(e){
-//		//'mapMove')
-	}
-	function mapMoveend(e){
-		//let _self = e;
-		let pos = _self.logMapInfo();
-		 
-		_self.$emit('onMoveEnd',pos);
-		//'mapMoveend')
-	}	 
-		
-	export default {
-		name:"Chargermap",
-		
-		data() {
-			return {
-				enabledMove:true,
-				myStyle:"width: 100%; height: 1200rpx;",
-				chargerIcon:'',
-				chargerSelectedIcon:'',
-				positionIcon:'',
-				personIcon:'',
-				longitude: 112.276527,
-				latitude: 30.306427,
-				AMap:null,  
-				//车的位置
-				car: {
-					obj:null,
-					longitude: '',
-					latitude: '',
-				},
-				down: {
-					obj:null,
-					longitude: '',
-					latitude: '',
-				},
-				up: {
-					obj:null,
-					longitude: '',
-					latitude: '',
-				},
-				//个人
-				info: {
-					obj:null,
-					init: false,
-					longitude: '',
-					latitude: '',
-				},
-				mapcharger:null,
-				startend: [{
-					longitude:112.279274,
-					latitude:30.303273,
-					name:''
-				}, {
-					longitude:112.273867,
-					latitude:30.309817,
-					name:''
-				}], 				
-				start:{},
-				end:{}, 
-				chargerList:[],
-				covers: [
-					{
-						longitude:112.273867,
-						latitude:30.309817,
-					},{
-						longitude:112.280261,
-						latitude:30.3041,
-					},{
-						longitude:112.279274,
-						latitude:30.303273,
-					}
-				],
-			};
-		},
-		methods:{
-		
-			getPositionByLonLats(pos) {
-				var _this = this;
-				MapLoader().then(AMap => {
-					var lnglatXY =//[_this.longitude, _this.latitude]
-					 [pos.longitude, pos.latitude];
-					AMap.service('AMap.Geocoder', function() {
-						let geocoder = new AMap.Geocoder({});
-						geocoder.getAddress(lnglatXY, function(status, result) {
-							//lnglatXY);
-							//status, result);
-							if (status === 'complete' && result.info === 'OK') {
-								var address = result.regeocode.formattedAddress;
-								//'当前位置'+JSON.stringify(lnglatXY)+address);
-								//_this.message= address;
-							
-							} else {
-								//_this.message= '无法获取定位';
-							}
-						});
-					});
-				}).catch(error => {
-					//error)
-				})
-			},
-			calculateDistance(startLngLat,endLngLat){
-				
-				
-				var _this = this;
-				//var endLngLat = [item.longitude,item.latitude];
-				return new Promise((resolve, reject) => {
-					AMap.plugin('AMap.Driving', function() {
-					  var driving = new AMap.Driving({
-						// 驾车路线规划策略,AMap.DrivingPolicy.LEAST_TIME是最快捷模式
-						policy: AMap.DrivingPolicy.LEAST_TIME
-					  })
-					   
-					 
-					  driving.search(startLngLat, endLngLat, function (status, result) {
-							 
-							resolve(result.routes[0])
-					  })
-					
-					})
-				})
-			 
-			},
-			calcDistances(startLngLat,endLst){
-				 
-				var _this = this;
-				if(startLngLat[0]&&startLngLat[1]){
-					for(let i=0;i< endLst.length;i++)
-					 {
-						 let item = endLst[i];
-						 let endLngLat = [item.longitude,item.latitude]
-					 	 //if(endLst[i].distance == null){
-							 var lnglat = new AMap.LngLat(startLngLat[0],startLngLat[1]);
-							 var myDistance = lnglat.distance(endLngLat);
-							 //_self.stationDetail.station.distance = myDistance/1000;
-							 //_self.stationDetail.station.time = myDistance/500;  
-							 endLst[i].distance = myDistance/1000.0;
-							 endLst[i].time = myDistance/500.0; 	
-							 
-						 /*}else{
-							 endLst[i].time = endLst[i].distance/500.0; 	
-						 }*/
-						 
-					}
-				}
-				
-				
-				
-			},
-			updateCharger(pos){ 
-				console.log()
-				if(this.chargerList.length==0){
-					return
-				}
-				//'更新充电桩1'+JSON.stringify(pos) ) 
-//				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);
-//					//'更新充电桩['+ index + ']'+JSON.stringify(pos)) 
-				let colorBg = '#00BAC8';//#00b962
-				if(this.chargerList[index].info.fastNum){
-					colorBg = '#8486FF'
-				}else if(this.chargerList[index].info.slowNum ){
-					colorBg = '#00b962'
-				} 
-//				//'colorBg'+colorBg)
-//				//'更新充电桩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: " + colorBg +";text-align: center;display: flex;";
-					let corner2=" width: 0;height: 0;position: relative;top: 0px;left: 0px;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 " + colorBg +";border-radius: 999px;background-color: #fff;color: " + colorBg +";' class='iconfont'>&#xe606";
-					content+="<div style='"+corner2+"'></div>";
-					content+="</div>";
-					
-					content+="<div style='color: #ffffff;line-height: 14px;padding: 4px;font-size: 14px'>";
-					
-					content+="<div class=''>";
-					// if(pos.price != null) {
-					// 	content+= "¥" + pos.price.toString();
-					// }
-					// else 
-					if(pos.giveDiscount) {
-						content+= "¥" + (pos.electricityPrice+pos.discountServicePrice).toFixed(2).toString();
-					}
-					else {
-						content+= "¥" + (pos.electricityPrice+pos.servicePrice).toFixed(2).toString();
-					}
-						
-					content+="</div>";
-					content+="<div class=''>";
-					// console.log(pos)
-					if(pos.idleNum != null) {
-						content+="空闲" + pos.idleNum.toString();
-					}
-					else if(pos.availableNum != null) {
-						content+="空闲" + pos.availableNum.toString();
-					} else {
-						content+="空闲" + (pos.fastAvailableNum+pos.slowAvailableNum).toString();
-					}
-					content+="</div>"
-					content+="</div>";
-					content+="</div>";
-					
-// 					//'找到充电桩[]'+content)
-					//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.chargerSelectedIcon+"' style='idth: 40px;height: 40px'></div><div style='display: flex;flex-direction:column;color:#FFFFFF;'><div style='margin-left:10px'>¥"+ pos.price +"</div><div style='margin-left:10px'>空闲"+pos.idleNum + "</div> </div></div>";
-					this.chargerList[index].info.selected = true;
-					this.chargerList[index].marker.setContent(content);
-					this.chargerList[index].marker.setzIndex(920);
-					//this.chargerList[index].marker.z-Index=999
-					
-					 
-				} 
-				for(let i = 0;i < this.chargerList.length;i++){
-					if(index == i)
-						continue;
-						
-						
-					if(this.chargerList[i].info.selected != null && 
-						this.chargerList[i].info.selected)
-						{
-							if(this.chargerList[i].info.fastNum){
-								colorBg = '#8486FF'
-							}else if(this.chargerList[i].info.slowNum ){
-								colorBg = '#00b962'
-							} 
-							
-							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: 37px;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+";background-color: #fff;' ><text class='iconfont' >&#xe606;</text><div style='" + corner+"'></div></div>"
-							
-							//let content = "<img src='"+this.chargerIcon+"' style='height: 40px;width: 40px' />";
-							this.chargerList[i].marker.setContent(content);
-							this.chargerList[i].info.selected = false;
-							//'restore'+JSON.stringify(this.chargerList[i].info))
-							this.chargerList[i].marker.setzIndex(900);
-							
-						}
-				}
-				
-				
-			},
- 		    addCharger(pos) {
-				
-				let colorBg = '#00BAC8';
-				//let colorBg = 'red';
-				if(pos.fastNum){
-					colorBg = '#8161FF'
-				}else if(pos.slowNum){
-					colorBg = '#00b962'
-				} 
-				
-				
-//				//'添加充电桩'+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 "+ colorBg+";	color: "+ colorBg+";	border-radius: 999px;";	
-				let corner =  "width: 0;height: 0;position: absolute;top: 37px;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+";background:#fff;' ><text class='iconfont' >&#xe606;</text><div style='" + corner+"'></div></div>"
-				
-				let marker = new AMap.Marker({
-					content: content,//"<img src='"+this.chargerIcon+"' style='height: 40px;width: 40px' />",
-					//icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
-					position: [pos.longitude,pos.latitude],
-					offset: new AMap.Pixel(-13, -30),
-					zIndex:900,
-					autoRotation: true,
-				});
-				marker.setMap(this.mapcharger);
-				this.myEmit("charger",marker,pos)
-				this.chargerList.push({marker:marker,info:pos});
-			}, 
-			addPerson(pos) {
-				//'addPerson'+JSON.stringify(pos))
-				let content = "<div style='background-color: rgba(22, 119, 255, 100);text-align: center;	box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.4);	border: 2px solid rgba(255, 255, 255, 100);border-radius: 999px;'>";
-				content += "<div class='iconfont' style='color: #1677ff; font-size: 14px' >&#xe634;</div>";
-				content += "</div>";
-				
-				let marker = new AMap.Marker({
-					content: content,//"<div class='iconfont' style='color: #1677ff; font-size: 14px' >&#xe634;</div>",//<img src='"+this.personIcon+"' style='height: 40px;width: 40px' />",
-					//content:"<div>xxxxxxxxxxxxxxxxxxxxxx</div>",
-					//icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
-					position: [pos.longitude,pos.latitude],
-					offset: new AMap.Pixel(-13, -30),
-					zIndex:900,
-					autoRotation: true,
-				});
-				marker.setMap(this.mapcharger);
-				this.myEmit("person",marker,pos)
-				//this.chargerList.push(marker)
-			}, 
-			/*
-			addPosition() {
-				//'addPosition'+JSON.stringify(pos))
-				let marker = new AMap.Marker({
-					content: "<img src='"+this.positionIcon+"' style='height: 40px;width: 40px' />",
-					//icon: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
-					//position: [pos.longitude,pos.latitude],
-					offset: new AMap.Pixel(20, 220),
-					zIndex:900,
-					autoRotation: true,
-				});
-				marker.setMap(this.mapcharger);
-				//this.myEmit("person",marker,pos)
-				//this.chargerList.push(marker)
-			},*/
-			setChargerList(sz){ 
-					if(this.AMap==null){
-						return
-					}
-					//this.getLocation();
-					for(var i in this.chargerList){
-						if(this.chargerList[i].marker){
-							this.chargerList[i].marker.setMap(null);
-						}
-						this.mapcharger.remove(this.chargerList[i]);
-					}
-					
-					this.chargerList=[]
-					for(var i in sz){
-						var ob=sz[i];
-						this.addCharger(ob);
-						
-						 
-					}
-					
-			},
-			myEmit(type,ob1,obj){
-				var _this=this;
-				console.log("myEmit")
-				AMap.event.addListener(ob1, 'click', function(e) {
-					console.log("myEmit2",type,ob1,obj)
-					_this.$emit('clickMap',{
-						type:type,
-						obj:obj
-					})			
-				})
-				
-			},
-			setMyStyle(s){
-				this.myStyle=s;
-			},			 
-			checkCenter(item){
-				let pos =  this.mapcharger.getCenter();
-				if(pos.lng == item.longitude && pos.lat == item.latitude){
-					//'setCenter pos '+JSON.stringify(pos))
-					//'setCenter item '+JSON.stringify(item))
-					this.listenMove();
-				}else{
-					//'setCenter pos1 '+JSON.stringify(pos))
-					//'setCenter item1 '+JSON.stringify(item))
-					setTimeout(() => {
-						this.checkCenter(item);
-					}, 1000)
-				}
-			},
-			setCenter(item){ 
-//				this.enableMove(false);
-
-				this.removeMove();
-//				//'setCenter'+JSON.stringify(item))
-				if(this.mapcharger){
-					this.mapcharger.setCenter([item.longitude,item.latitude]);
-					this.checkCenter(item);
-//					this.listenMove();
- 
-//					this.enableMove(true);
-					return true
-				}else{
-//					this.listenMove();
-//					this.enableMove(true);
-					return false
-				}
-			},		
-			 
-			setPerson(ob,bl){
-				//'setPerson1'+JSON.stringify(ob))
-				if(this.AMap==null){
-					return
-				}
-//				//'setPerson2')
-				
-					this.info.longitude=ob.longitude
-					this.info.latitude=ob.latitude
-					if(!this.info.ob){
-						this.addPerson(ob)
-						 
-						
-						//this.info.ob.setMap(this.mapcharger);
-						////'setMap  xxx ')
-						//this.mapbus.setCenter([this.info.longitude,this.info.latitude]); //设置地图中心点
-						if(!bl){
-							let posCenter= [ this.info.longitude,this.info.latitude];
-//							//'center'+JSON.stringify(posCenter))
-							//this.mapcharger.setZoom(9)
-							//this.mapcharger.setCenter([112.28541,30.308354])
-							//this.mapcharger.setCenter([121.504919,31.351083])
-							this.mapcharger.setCenter(posCenter); //设置地图中心点
-							
-							
-						}
-			
-					}else{
-					//	this.info.ob.setPosition( [this.info.longitude,this.info.latitude]);
-					}
-				
-				
-			}, 
-			logMapInfo() {
-			  var posCenter = this.mapcharger.getCenter();
-//			  //'center'+JSON.stringify(posCenter));
-			  var limitBounds = this.mapcharger.getBounds();
- 			  let pos = {center:posCenter,bounds:limitBounds};
-			  return pos;
-			},
-			
-			init(){
-				_self = this;
-//				//'init')
-				var _this = this;
-
-				MapLoader().then(AMap => {
-					
-					this.AMap=AMap;
-					_this.mapcharger && _this.mapcharger.destroy();
-					//使用地图容器ID创建
-					_this.mapcharger=new AMap.Map("container", {
-						resizeEnable: true,
-						dragEnable : true,
-						center: [this.longitude, this.latitude],
-						zoom: 13
-					});
-					
-					//_this.mapcharger.setMapStyle('amap://styles/macaron');
-					_this.mapcharger.setMapStyle('amap://styles/f9b17f73bb4576ab1894c29fe9d03c6c');
-
-					/*
-					new SimpleMarker({
-					            iconLabel: '2',
-					            //自定义图标节点(img)的属性
-					            iconStyle: {
-					
-					                src: '@/static/img/location.png',
-					                style: {
-					                    width: '20px',
-					                    height: '30px'
-					                }
-					            },
-					  //设置基点偏移
-								offset: new AMap.Pixel(-10, -30),
-					
-								map: map,
-								showPositionPoint: true,
-								position: lngLats[1],
-								zIndex: 200
-							});
-*/
-					 /*
-					_this.mapcharger.plugin('AMap.Geolocation', function () {
-					        var geolocation = new AMap.Geolocation({
-					            enableHighAccuracy: true,
-					            timeout: 10000,
-					            buttonOffset: new AMap.Pixel(10, 220),
-					            zoomToAccuracy: true,
-					            buttonPosition: 'RB'
-					        });
-					        _this.mapcharger.center = geolocation;
-					        _this.mapcharger.addControl(geolocation);//地图控件右下角显示当前位置
-					    });
-					
-					_this.mapcharger.plugin(["AMap.ToolBar"],function(){
-					    //加载工具条
-					    var tool = new AMap.ToolBar({
-							locate:true,
-							direction:false,
-							ruler:false,
-							liteStyle:true,
-							useNative:true,
-//							autoPosition:true,
-//							locationMarker:
-						});
-					    _this.mapcharger.addControl(tool);    
-					});*/
-					/*
-					_this.mapcharger.plugin(["AMap.ControlBar"],function(){
-					    var controlBar = new AMap.ControlBar({
-							showZoomBar:true,
-							showControlButton:true,
-							position:{top:'10px',right:'10px'}
-						})
-					    _this.mapcharger.addControl(controlBar)
-					});*/
-					var clickHandler = function(e) {
-						_this.$emit('onClicked',e);
-						//'您在[ '+e.lnglat.getLng()+','+e.lnglat.getLat()+' ]的位置点击了地图!');
-					};
-					
-					 /*
-					var mapMovestart = function(){
-						//'movestart')
-					}
-					var mapMove = function(){
-						////'mapMove')
-					}
-					var mapMoveend = function(){
-						let pos = _this.logMapInfo();
-						 
-						_this.$emit('onMoveEnd',pos);
-					//						//'mapMoveend')
-					}
-					_this.mapMovestart = mapMovestart;
-					_this.mapMove = mapMove;
-					_this.mapMoveend = mapMoveend;
-										*/
-					_this.mapcharger.on('click', clickHandler); 
-					_this.$emit('onload')
-					//_this.addPosition();
-					_this.listenMove();
-					
-				}, e => {
-					//_this.mui.toast('地图加载失败');
-					//'地图加载失败', e)
-				})
-			},	
-			 
-			removeMove(){
-				var _this = this;
-				//this.enabledMove = false;
-				_this.mapcharger.off('movestart', mapMovestart);
-				_this.mapcharger.off('mapmove', mapMove);
-				_this.mapcharger.off('moveend', mapMoveend); 
-				 
-								
-			}, 
-			enableMove(enable){
-				this.enabledMove = enable;
-			},
-			listenMove(){
-				var _this = this;
-				/*var mapMovestart = function(){
-					if(!_this.enabledMove)
-						return;
-					//'movestart')
-				}
-				var mapMove = function(){
-					if(!_this.enabledMove)
-						return;
-					////'mapMove')
-				}
-				var mapMoveend = function(){
-					let pos = _this.logMapInfo();
-					if(!_this.enabledMove)
-						return;
-					_this.$emit('onMoveEnd',pos); 
-				}*/
-//				//'listenMove')
-				_this.mapcharger.on('movestart', mapMovestart);
-				_this.mapcharger.on('mapmove', mapMove);
-				_this.mapcharger.on('moveend',mapMoveend); 
-				 
-			},
-			navigate(startLngLat,endLngLat){
-				//'start'+JSON.stringify(startLngLat))
-				//'end'+JSON.stringify(endLngLat))
-				AMap.plugin('AMap.Driving', function() {
-				  var driving = new AMap.Driving({
-				    // 驾车路线规划策略,AMap.DrivingPolicy.LEAST_TIME是最快捷模式
-				    policy: AMap.DrivingPolicy.LEAST_TIME
-				  })
-				  
-				 // var startLngLat = [116.379028, 39.865042]
-				 // var endLngLat = [116.427281, 39.903719]
-				  
-				  driving.search(startLngLat, endLngLat, function (status, result) {
-					  //'status'+JSON.stringify(result))
-				    // 未出错时,result即是对应的路线规划方案
-				  })
-				})
-			},
-			initMap(point,stationList,startend){
-				//'初始化地图'+this.longitude+this.latitude)
-				var _this = this;
-				this.covers=point;
-				this.startend=startend;
-				MapLoader().then(AMap => {
-					
-					this.AMap=AMap;
-					_this.mapcharger && _this.mapcharger.destroy();
-				
-					_this.mapcharger=new AMap.Map("container", {
-						resizeEnable: true,
-						center: [this.longitude, this.latitude],
-						//center: [116.397428, 39.90923],
-						zoom: 14
-					});
-					var lineArr=[]
-					
-					
-					this.$emit('onload')
-				}, e => {
-					//_this.mui.toast('地图加载失败');
-					//'地图加载失败', e)
-				})
-			},
-		}
-	}
-</script>
-
-<style scoped>
-/*去除下标*/
-.amap-logo{
-display: none;
-}
-.amap-copyright{
-opacity:0;
-    font-size: 1px;
-}
-
-.input-card {
-  display: flex;
-  flex-direction: column;
-  min-width: 0;
-  word-wrap: break-word;
-  background-color: #fff;
-  background-clip: border-box;
-  border-radius: .25rem;
-  width: 22rem;
-  border-width: 0;
-  border-radius: 0.4rem;
-  box-shadow: 0 2px 6px 0 rgba(114, 124, 245, .5);
-  position: fixed;
-  bottom: 1rem;
-  right: 1rem;
-  -ms-flex: 1 1 auto;
-  flex: 1 1 auto;
-  padding: 0.75rem 0.75rem;
-}
-
-.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;
-	position: absolute;
-	top: 89px;
-	left: 38px;
-	
-}
-.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 ;
-	}
-.station-icon2 {
-	width: 100px;
-	height: 36px;
-	line-height: 20px;
-	border-radius: 50px;
-	background-color: rgba(0, 185, 98, 100);
-	text-align: center;
-	display: flex;
-	position: absolute;
-	top: 191px;
-	left: 168px;
-	
-}
-.icon2-left{
-		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;
-}
-.icon2-right{
-	color: #ffffff;
-	line-height: 14px;
-	padding: 4px;
-}
-.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 ;
-	
-}
-</style>

+ 3 - 0
pages/cardBag/cardBag.vue

@@ -195,6 +195,9 @@
 				if(userCard&&userCard.chargeDegreeLimit){
 					p=userCard.chargedDegree/userCard.chargeDegreeLimit*100
 				}
+				if(p>100){
+					p=100
+				}
 				return p.toFixed(0)
 			},
 			personalCenter(){

+ 4 - 1
pages/cardBag/cardDetails.vue

@@ -64,7 +64,7 @@
 					剩余度数
 				</view>
 				<view class="value">
-					{{item.chargedDegree?item.chargedDegree.toFixed(0):0.00}}度
+					{{userCard.chargedDegree>userCard.chargeDegreeLimit?0:(userCard.chargeDegreeLimit-userCard.chargedDegree).toFixed(0)}}度
 				</view>
 			</view>
 			<view class="item" v-if="false">
@@ -147,6 +147,9 @@
 				if(userCard&&userCard.chargeDegreeLimit){
 					p=userCard.chargedDegree/userCard.chargeDegreeLimit*100
 				}
+				if(p>100){
+					p=100
+				}
 				return p.toFixed(0)
 			},
 			thisdaysDistance(endTime){

+ 3 - 2
pages/discountCard/myOrder.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<ujp-navbar title="订单列表"></ujp-navbar>
-		<view class="tabs">
+		<view class="tabs" v-if="false">
 			<u-tabs active-color="#00B962" :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
 		</view>
 		<view class="card" v-for="(item,i) in list[current].list"   :key="i" >
@@ -44,6 +44,7 @@
 			</view>
 			
 		</view>
+		<u-divider  bg-color="#F2F4F4" v-if="list[current].list.length&&list[current].list.length == list[current].recordsTotal" >已经到底了</u-divider>
 		
 		<view class="carNone" v-if="list[current].list.length == 0">
 				<img src="static/img/暂无数据-缺省页.png" alt="">
@@ -82,7 +83,7 @@
 					list: []
 					
 				}],
-				current: 0
+				current: 2
 			}
 		},
 		onLoad(op) {

+ 61 - 11
pages/discountCard/productDetails.vue

@@ -187,7 +187,7 @@
 				</view>
 				<view class="item">
 					<view class="question">
-						Q:启动充电后或结束充电拔枪后购买的服务费6折卡,可以使用吗?
+						Q:启动充电后或结束充电后购买的服务费6折卡,可以使用吗?
 
 					</view>
 					<view class="answer-form">
@@ -196,7 +196,7 @@
 						</view>
 						<view class="before">
 							<view class="b-top">
-								拔枪前购买
+								启动充电前购买
 							</view>
 							<view class="b-bottom">
 								本单结算可以使用
@@ -204,7 +204,7 @@
 						</view>
 						<view class="later">
 							<view class="l-top">
-								拔枪后购买
+								启动充电后购买
 							</view>
 							<view class="l-bottom">
 								本单不可用,下一单结算可以使用
@@ -239,7 +239,7 @@
 					<view class="content">
 						<p>- 购买自营站充电服务费6折卡可享平台自营站服务费6折权益,该产品不可转赠。</p>
 						<p>- 该产品针对充电服务费享受折扣,不包含电费、停车费、占位费等其他费用。</p>
-						<p>- 自营站充电服务费6折卡购买后即刻生效,充电拔枪前购买成功支持本单可用,拔枪后完成购买仅下一单可用。</p>
+						<p>- 自营站充电服务费6折卡购买后即刻生效,启动充电前购买成功支持本单可用,启动充电后完成购买仅下一单可用。</p>
 						<p>- 338度自营站充电服务费6折卡(限338度,有效期30天)和1000度自营站充电服务费6折卡(限1000度,有效期90天)均为同一种产品,是充电服务费6折卡的两种不同规格。</p>
 					</view>
 				</view>
@@ -290,7 +290,7 @@
 			
 		</view>
 <!-- 自营站 -->
-			<view class="self-station" v-if="false">
+			<view class="self-station" v-if="stationslist.length" >
 				<view class="headline">
 					查看你所在城市的自营站
 				</view>
@@ -301,20 +301,20 @@
 							<view class="title-l">
 								你附近<text style="color:#FF6923;">{{' '}}5公里{{' '}} </text>内的充电站
 							</view>
-							<view class="title-r">
+							<view class="title-r" @click="gotoUrl('pages/searchPile/searchPile')" >
 								更多<u-icon name="arrow-right" color="#999999"></u-icon>
 							</view>
 						</view>
 						<view class="station-amount">
 							<view class="item">
 								<view class="number">
-									5
+									{{stationslist.length}}
 								</view>
 								<view class="name">
 									平台自营站
 								</view>
 							</view>
-							<view class="item">
+							<view class="item" v-if="false">
 								<view class="number">
 									2
 								</view>
@@ -525,6 +525,9 @@
 	import * as Pay from '@/apis/weixin.js'
 	import * as API from '@/apis/card.js'
 	import * as loginApi from '@/apis/login.js'
+	import * as api from '@/apis/site.js';
+	import * as WxJsApi from '@/utils/wxJsApi.js'
+	
 	
 	import QRCode from 'qrcodejs2'
 	import {
@@ -538,6 +541,7 @@
 	export default {
 		data() {
 			return {
+				stationslist:[],
 				checked: "false",
 				cardId: '',
 				qrCodeImg: "",
@@ -567,6 +571,8 @@
 				   userInfo: {},
 				   elderStatus: false,
 				   consumerPhone: "400-8899-619",
+				   longitude: '',
+				   latitude: '',
 				   scrollLeftSet: 0,
 				   scrollLeftOldSet: 0,
 				   scrollLeftSetBl: false,
@@ -592,7 +598,18 @@
 			
 			//this.checkSubscribe()
 			this.getCardList();
-		
+			
+			WxJsApi.getLocation().then((res) => {
+				
+				this.latitude = parseFloat(res.latitude);
+				this.longitude = parseFloat(res.longitude);
+								
+				 this.searchStationData();
+			}).catch(error => {
+				uni.showToast({
+					title:JSON.stringify(error)
+				})					
+			})
 		},
 		onShow() {
 			
@@ -646,6 +663,39 @@
 			}
 		},
 		methods: {
+			
+			searchStationData(obj) {
+				let data1 = {
+					latitude: this.latitude,
+					longitude: this.longitude,
+					findType: "1",
+					platformType:'1',
+					raidus: 5,
+					pageIndex: 1,
+					pageSize: 999
+				};
+				
+				uni.showLoading({})
+			
+				if (this.carhelp.getPersonInfo()) {
+					data1.openId = this.carhelp.getOpenId()
+				}
+				
+				api.getChargingStationData(data1).then(res => {
+					uni.hideLoading()
+					
+					 var stationslist=res.data.data
+					this.stationslist = stationslist;
+					
+					 
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			
+			},
 			isPayTextBtn(){
 				if(this.isPayText=='关注公众号'){
 					this.gotoGz()
@@ -891,7 +941,7 @@
 			confirm() {
 				this.getUserInfo();
 				uni.redirectTo({
-					url: "/pages/user/discountCard/paymentSuccess?id=" + this.outOrderNo
+					url: "/pages/discountCard/paymentSuccess?id=" + this.outOrderNo
 				})
 			},
 			click(index) {
@@ -1370,7 +1420,7 @@
 					 }
 					 .station-amount{
 						 display: flex;
-						 justify-content: space-between;
+						 justify-content: center;
 						 align-items: center;
 						 text-align: center;
 						 margin-top: 40rpx;

+ 1 - 1
pages/searchPile/chargeProcess/charge.vue

@@ -9,7 +9,7 @@
 		<view v-else>
 			<!-- 优惠 -->
 			<view class="discounts" style="padding:0 18px;" v-if="bannerList.length">
-				<u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList" @click="clickBanner"
+				<u-swiper bg-color="#fff" mode="none" :img-mode="'scaleToFill'" height="160" :list="bannerList" @click="clickBanner"
 					:name="'picUrl'">
 				</u-swiper>
 			</view>

+ 2 - 2
pages/searchPile/chargeProcess/dcCharging.vue

@@ -118,7 +118,7 @@
 					</view>
 					
 					<view class="info-text-min" >
-						剩余时长{{thisdaysDistance(userCard.endTime)}}天 | 剩余优惠电量{{(userCard.chargeDegreeLimit-userCard.chargedDegree).toFixed(0)}}度
+						剩余时长{{thisdaysDistance(userCard.endTime)}}天 | 剩余优惠电量{{userCard.chargedDegree>userCard.chargeDegreeLimit?0:(userCard.chargeDegreeLimit-userCard.chargedDegree).toFixed(0)}}度
 					</view>
 				</view>
 				
@@ -429,7 +429,7 @@
 						</view>
 						<view class="detail">
 							<p class="electrovalence">
-								<text class="num" v-if="chargingRecord.userCardId">{{price.electricityPrice.toFixed(2)}}</text>
+								<text class="num" v-if="userCard&&userCard.classify==1&&chargingRecord.userCardId">{{price.electricityPrice.toFixed(2)}}</text>
 								<text  class="num" v-else>
 									
 									<template v-if="(personInfo&&personInfo.userType==2)&&(chargingStation.giveDiscount||price.discountServicePrice)">

+ 26 - 5
pages/searchPile/searchPile.vue

@@ -269,9 +269,14 @@
 				<Chargermap @onMoveStart="moveStart" @onMoveEnd="moveEnd" ref="amap" @onClicked="onClicked"
 					@onload="mapdown" @clickMap="clickMap"></Chargermap>
 				<!--@location="location"-->
-				<u-image style='position:absolute;z-index:1023;right:40rpx;bottom:520rpx;  '
-					src="@/static/img/location.png" border-radius="8" bg-color="#ffffff" width="30px" height="30px"
-					@click="setCenter"></u-image>
+				<view  class="locationBtn" style=' '
+				 
+				 @click="setCenter">
+					<u-image
+						src="@/static/img/location.png" border-radius="8" bg-color="#ffffff" width="20px" height="20px"
+						></u-image>
+				</view>
+				
 		
 			</view>
 			<!-- 新版卡片 -->
@@ -380,7 +385,7 @@
 	import * as indexAPI from '@/apis/index.js'
 	import * as api from '@/apis/site.js';
 	import Tabbar from '@/components/Tabbar.vue';
-	import Chargermap from '@/components/Chargermap2.vue';
+	import Chargermap from '@/components/Chargermap.vue';
 	import jpDropdown from '@/components/Udropdown.vue';
 
 	import uniCombox from '@/components/uni-combox/components/uni-combox/uni-combox.vue'
@@ -542,6 +547,9 @@
 				
 			})
 
+		},
+		onLoad() {
+			
 		},
 		onReady() {
 			WxJsApi.getWxConfig(['getLocation', 'addEventListener', 'scanQRCode']).then((res) => {
@@ -923,7 +931,20 @@
 
 <style lang="scss" scoped>
 	@import "@/_theme.scss";
-
+	.locationBtn{
+		width: 30px;
+		height:30px;
+		position:absolute;
+		z-index:1023;
+		right:40rpx;
+		bottom:520rpx; 
+		    background: white;
+		    display: flex;
+		    align-items: center;
+		    justify-content: center;
+			    border: 1px solid;
+			    border-radius: 8px;
+	}
 	.ujp-navbar-main {
 		display: flex;
 		flex-direction: column;

+ 56 - 2
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -173,7 +173,12 @@
 			<img  @click="gotoLogin" src="@/assets/img/gologin/img.png">	
 		</view>
 		<view class="carImg"  v-if="personInfo&&personInfo.userType==2" >
-			<img  @click="gotoLogin" src="@/assets/img/gologin/img5.png">	
+			<view class="discounts"  v-if="bannerList.length">
+				<u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="120" :list="bannerList"  mode="none"  @click="clickBanner"
+					:name="'picUrl'">
+				</u-swiper>
+			</view>
+<!-- 			<img  @click="gotoUrl('pages/discountCard/productDetails')" src="@/assets/img/gologin/img5.png"> -->	
 		</view>
 		<!-- <u-modal v-model="showVin"  class="showOss" 
 		    confirm-text="注册会员"   cancel-text="先不注册"
@@ -457,6 +462,7 @@
 	import * as API_index from '@/apis/index.js'
 	import * as API from "@/apis/chargeProcess.js"
 	import * as userApi from '@/apis/user.js'
+		import * as newsApi from '@/apis/news.js'
 	import ucarkeyboard from '@/components/Ucarkeyboard.vue'
 	
 	import {
@@ -484,6 +490,7 @@
 				showNtValue:30,
 				station:{},
 				step:0,
+					bannerList:[],
 				isInsert:false,
 				isReady: false,
 				onShowRole: false,
@@ -563,6 +570,50 @@
 		
 		},
 		methods: {
+			clickBanner(index){
+				var mod= this.bannerList[index]
+				
+				if(mod.linkUrl.indexOf('http')==0){
+				    window.location=mod.linkUrl;
+				}
+				else if(mod.linkUrl.indexOf('#/')==0){
+					if(mod.linkUrl.indexOf("?")==-1){
+						mod.linkUrl+='?';
+					}
+				    //window.location=mod.linkUrl;
+					var url=mod.linkUrl.split("#")[1]
+					//window.location = mod.clickUrl;
+					uni.navigateTo({
+						url: url
+					})
+				}
+				else if(mod.linkUrl=='#'||mod.linkUrl==''){
+				
+				}
+				else{
+					uni.navigateTo({
+						url:mod.linkUrl
+					})
+				}
+				
+			},
+			getBannerInfo(code){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				newsApi.getBannerInfo(code).then((res) => {
+					uni.hideLoading();
+					this.bannerList =res.data;
+					
+					// document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 300px;"
+				 }).catch(error => {
+						uni.showToast({
+						
+							title: error,icon: "none"
+						})
+				})
+			},
 			thisdaysDistance(endTime){
 						
 							 var date=new Date()
@@ -584,6 +635,9 @@
 				if(userCard&&userCard.chargeDegreeLimit){
 					p=userCard.chargedDegree/userCard.chargeDegreeLimit*100
 				}
+				if(p>100){
+					p=100
+				}
 				return p.toFixed(0)
 			},
 			carTempBlInit(){
@@ -1202,7 +1256,7 @@
 				// 	this.getBannerInfoTop("home-top");
 				// }
 				
-				
+				this.getBannerInfo("charge-start")
 				
 				
 				//this.carhelp.setGunId(op.id)

+ 3 - 0
pages/searchPile/stationAndPile/stationDetails.vue

@@ -943,6 +943,9 @@
 				if(userCard&&userCard.chargeDegreeLimit){
 					p=userCard.chargedDegree/userCard.chargeDegreeLimit*100
 				}
+				if(p>100){
+					p=100
+				}
 				return p.toFixed(0)
 			},
 			getpilestate() {

+ 1 - 1
pages/user/finance/rechargeRes.vue

@@ -51,7 +51,7 @@
 			
 		</view>
 		<view class="discounts" style="padding:0 18px;margin-top: 20px;" v-if="bannerList.length" >
-			<u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList" @click="clickBanner"
+			<u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList"  mode="none"  @click="clickBanner"
 				:name="'picUrl'">
 			</u-swiper>
 		</view>

+ 8 - 2
pages/user/index.vue

@@ -167,7 +167,7 @@
 	
 		<!-- 优惠 -->
 		<view class="discounts" v-else >
-			<u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList" @click="clickBanner"
+			<u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList"  mode="none"  @click="clickBanner"
 				:name="'picUrl'">
 			</u-swiper>
 		</view>
@@ -332,6 +332,9 @@
 			}
 		},
 		onShow() {
+			if(this.bannerList.length==0){
+				this.getBannerInfo("userinfo")
+			}
 			this.personInfo=this.carhelp.getPersonInfo()
 			
 			if(this.carhelp.getPersonInfo()) {
@@ -368,7 +371,10 @@
 			}
 		},
 		onReady() {
-			this.getBannerInfo("userinfo")
+			if(this.bannerList.length==0){
+				this.getBannerInfo("userinfo")
+			}
+			
 			
 			WxJsApi.getWxConfig(['getLocation', 'addEventListener', 'scanQRCode']).then((res) => {
 				// //(res)