Browse Source

红包+定位相关调整

zkx 2 years ago
parent
commit
c5f93d8b7a

+ 15 - 20
pages/index/index.vue

@@ -609,9 +609,9 @@
 
 
 			this.getBannerInfo("homepage");
 			this.getBannerInfo("homepage");
 			
 			
-			var obj=this.carhelp.get("newyear_activity2023")
 			
 			
-			if(obj==null||obj==""||(obj&&obj.status==0)){
+			
+			
 				var userInfo= this.carhelp.getPersonInfo();
 				var userInfo= this.carhelp.getPersonInfo();
 				
 				
 				if(userInfo&&userInfo.id){
 				if(userInfo&&userInfo.id){
@@ -620,11 +620,12 @@
 				}else{
 				}else{
 					this.getBannerInfoTop("home-top");	
 					this.getBannerInfoTop("home-top");	
 				}
 				}
-				
-				//this.showNtStep=2
-			}else{
-				this.getBannerInfoTop("home-top");
-			}
+				//var obj=this.carhelp.get("newyear_activity2023")
+				//this.showNtStep=2
+			// if(obj==null||obj==""||(obj&&obj.status==0)){
+			// }else{
+			// 	this.getBannerInfoTop("home-top");
+			// }
 			
 			
 			this.getPointTimeOut();
 			this.getPointTimeOut();
 			this.getNewsList();
 			this.getNewsList();
@@ -633,21 +634,15 @@
 		},
 		},
 		methods: {
 		methods: {
 			getNewYear(){
 			getNewYear(){
-				var obj=this.carhelp.get("newyear_activity2023")
+				//var obj=this.carhelp.get("newyear_activity2023")
 				//
 				//
 				var sz=["1615623336912621569","1615623336912621568"];
 				var sz=["1615623336912621569","1615623336912621568"];
-				var code=0
-				if(obj&&obj.status==0){
-					//this.exchangeDetail(obj.nt);
-					 code=obj.code
-				}else{
-					 code=parseInt(Math.random()*2) 
-					 this.carhelp.set("newyear_activity2023",{
-					 	nt:sz[code],
-					 	code:code,
-					 	status:0
-					 })
-				 }
+				var code=parseInt(Math.random()*2)
+				this.carhelp.set("newyear_activity2023",{
+					nt:sz[code],
+					code:code,
+					status:0
+				})
 					
 					
 					//先查询另一个领取过没
 					//先查询另一个领取过没
 					userApi.exchangeDetail({
 					userApi.exchangeDetail({

+ 20 - 26
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -673,21 +673,15 @@
 				this.isInsert=true;
 				this.isInsert=true;
 			},
 			},
 			getNewYear(){
 			getNewYear(){
-				var obj=this.carhelp.get("newyear_activity2023")
+				//var obj=this.carhelp.get("newyear_activity2023")
 				//
 				//
 				var sz=["1615623336912621569","1615623336912621568"];
 				var sz=["1615623336912621569","1615623336912621568"];
-				var code=0
-				if(obj&&obj.status==0){
-					//this.exchangeDetail(obj.nt);
-					 code=obj.code
-				}else{
-					 code=parseInt(Math.random()*2) 
-					 this.carhelp.set("newyear_activity2023",{
-					 	nt:sz[code],
-					 	code:code,
-					 	status:0
-					 })
-				 }
+				var code=parseInt(Math.random()*2)
+				this.carhelp.set("newyear_activity2023",{
+					nt:sz[code],
+					code:code,
+					status:0
+				})
 					
 					
 					//先查询另一个领取过没
 					//先查询另一个领取过没
 					userApi.exchangeDetail({
 					userApi.exchangeDetail({
@@ -872,23 +866,23 @@
 				
 				
 				var personInfo=this.carhelp.getPersonInfo()
 				var personInfo=this.carhelp.getPersonInfo()
 				this.personInfo=personInfo
 				this.personInfo=personInfo
+				var userInfo= this.carhelp.getPersonInfo();
 				
 				
+				if(userInfo&&userInfo.id){
+					
+						this.getNewYear()
+				}else{
+					this.getBannerInfoTop("home-top");	
+				}
 				
 				
-				var obj=this.carhelp.get("newyear_activity2023")
-				if(obj==null||obj==""||(obj&&obj.status==0)){
-					var userInfo= this.carhelp.getPersonInfo();
+				// var obj=this.carhelp.get("newyear_activity2023")
+				// if(obj==null||obj==""||(obj&&obj.status==0)){
 					
 					
-					if(userInfo&&userInfo.id){
-						
-							this.getNewYear()
-					}else{
-						this.getBannerInfoTop("home-top");	
-					}
 					
 					
-					//this.showNtStep=2
-				}else{
-					this.getBannerInfoTop("home-top");
-				}
+				// 	//this.showNtStep=2
+				// }else{
+				// 	this.getBannerInfoTop("home-top");
+				// }
 				
 				
 				
 				
 				
 				

+ 22 - 6
pages/searchPile/stationAndPile/stationDetails.vue

@@ -68,18 +68,20 @@
 					<text class="iconfont park-font">&#xe600;</text></view>
 					<text class="iconfont park-font">&#xe600;</text></view>
 			
 			
 			</view>
 			</view>
-			<template  v-if="stationDetail&&stationDetail.stationAddressList&&stationDetail.stationAddressList.length" >
+			<template  v-if="stationDetail&&stationAddressList&&stationAddressList.length" >
 				
 				
 			
 			
-				<view class=" stationAddressListClass " v-for="(item ,i) in stationDetail.stationAddressList" :key="i" >
+				<view class=" stationAddressListClass " v-for="(item ,i) in stationAddressList" :key="i" >
 					<view  class="stationAddressListClassAddress">
 					<view  class="stationAddressListClassAddress">
 						<span class="areaTitleClass">{{item.areaTitle}}</span>
 						<span class="areaTitleClass">{{item.areaTitle}}</span>
 						<span >{{item.address}}</span>
 						<span >{{item.address}}</span>
 					</view>
 					</view>
-					<view @click="map(item)" class="stationAddressListClassDistance" >
+					<view @click="map(item)" class="stationAddressListClassDistance" v-if="item.distance" >
 							{{item.distance!=null&&item.distance>0.1 ? item.distance.toFixed(1)+'公里':'小于100米'}}
 							{{item.distance!=null&&item.distance>0.1 ? item.distance.toFixed(1)+'公里':'小于100米'}}
 							<text class="iconfont park-font">&#xe600;</text>
 							<text class="iconfont park-font">&#xe600;</text>
 					</view>
 					</view>
+					<view @click="map(item)" class="stationAddressListClassDistance" v-else>
+						导航<text class="iconfont park-font">&#xe600;</text></view>
 					
 					
 				</view>
 				</view>
 			</template >
 			</template >
@@ -501,6 +503,7 @@
 											longitude: 112.28468,
 											longitude: 112.28468,
 											latitude: 30.307094,*/
 											latitude: 30.307094,*/
 				},
 				},
+				stationAddressList:[],
 				station: {},
 				station: {},
 				stationDetail: {
 				stationDetail: {
 
 
@@ -642,7 +645,7 @@
 					if(!it2.enableShare||it2.enableShare&&!it2.enableShareWithinTime){
 					if(!it2.enableShare||it2.enableShare&&!it2.enableShareWithinTime){
 						i=-1
 						i=-1
 					}
 					}
-					console.log(it1,i)
+					//console.log(it1,i)
 					return i
 					return i
 				})
 				})
 				
 				
@@ -680,6 +683,7 @@
 					 distance=this.stationDetail.station.distance
 					 distance=this.stationDetail.station.distance
 					 //防止重新获取定位
 					 //防止重新获取定位
 				}
 				}
+				
 				api.getChargingStationDetail(data).then(function(res) {
 				api.getChargingStationDetail(data).then(function(res) {
 					uni.hideLoading()
 					uni.hideLoading()
 				
 				
@@ -688,6 +692,10 @@
 						let data = res.data;
 						let data = res.data;
 
 
 						_self.stationDetail = data;
 						_self.stationDetail = data;
+						
+						if(_self.stationAddressList.length==0){
+							_self.stationAddressList=_self.stationDetail.stationAddressList
+						}
 
 
 						if(_self.stationDetail.station.parkingDescription != null&&_self.stationDetail.station.parkingSimpleDescription!= null) {
 						if(_self.stationDetail.station.parkingDescription != null&&_self.stationDetail.station.parkingSimpleDescription!= null) {
 							var tagList = _self.stationDetail.station.tagList;
 							var tagList = _self.stationDetail.station.tagList;
@@ -822,16 +830,23 @@
 				}
 				}
 				var list=_self.stationDetail.stationAddressList;
 				var list=_self.stationDetail.stationAddressList;
 				MapLoader().then(AMap1 => {
 				MapLoader().then(AMap1 => {
+					
 					for(var i in list){
 					for(var i in list){
 						var  endLngLat=list[i]
 						var  endLngLat=list[i]
 						var lnglat = new AMap.LngLat(startLngLat.longitude, startLngLat.latitude);
 						var lnglat = new AMap.LngLat(startLngLat.longitude, startLngLat.latitude);
 						var myDistance = lnglat.distance([endLngLat.longitude, endLngLat.latitude]);
 						var myDistance = lnglat.distance([endLngLat.longitude, endLngLat.latitude]);
+						 
 						endLngLat.distance = myDistance / 1000;
 						endLngLat.distance = myDistance / 1000;
 						endLngLat.time = myDistance / 500;
 						endLngLat.time = myDistance / 500;
 					}
 					}
+					_self.stationAddressList=list;
+					_self.$forceUpdate()
+						console.log("11111111111111")
+					console.log(_self.stationDetail.stationAddressList)
+					
 				
 				
 				})
 				})
-				
+			
 			},
 			},
 			calculateDistance(startLngLat, endLngLat) {
 			calculateDistance(startLngLat, endLngLat) {
 				var _this = this;
 				var _this = this;
@@ -1005,7 +1020,7 @@
 				})
 				})
 			},
 			},
 			map(item) {
 			map(item) {
-				this.navigate()
+				this.navigate(item)
 				//var item= _self.stationDetail.station
 				//var item= _self.stationDetail.station
 				//window.location.href="https://uri.amap.com/marker?position="+ item.longitude+","+item.latitude+"&name="+item.name;
 				//window.location.href="https://uri.amap.com/marker?position="+ item.longitude+","+item.latitude+"&name="+item.name;
 				
 				
@@ -1061,6 +1076,7 @@
 			min-width: 180rpx;
 			min-width: 180rpx;
 			color:#00B962;
 			color:#00B962;
 			float: right;
 			float: right;
+			text-align: end;
 			width: 180rpx;
 			width: 180rpx;
 		}
 		}
 	}
 	}