zhengkaixin 2 years ago
parent
commit
aa6685b43b
2 changed files with 107 additions and 18 deletions
  1. 4 5
      .env.dev.js
  2. 103 13
      pages/searchPile/stationAndPile/stationDetails.vue

+ 4 - 5
.env.dev.js

@@ -1,16 +1,15 @@
 const UNI_APP = {  
 	ProjectName :"51充电联盟",
-	 BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
-	
+	BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
 	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 	//BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
-	//PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
+	PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
 	NODE_ENV :"dev",
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 
 	//openId:"oK9Wr57rAcNzihDN2PEdptprT0As", 
-	//openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",
-			openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",
+	openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",
+	//		openId:"oK9Wr5082qZw5rkfvYqSS0xVb5cc",
 	//		openId:"oK9Wr5xRUoP9EygZqBec0xkJMVTs",
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",

+ 103 - 13
pages/searchPile/stationAndPile/stationDetails.vue

@@ -73,7 +73,7 @@
 						charging:item.enableShare&&item.workStatus!=0,
 						
 						'not-open2':item.enableShare&&!item.enableShareWithinTime&&device.online,
-						'not-open':item.isRed
+						'not-open':item.isRed||item.workStatus==2
 						
 					}">
 							{{item.workStatusText}}
@@ -117,10 +117,54 @@
 								</view>
 							</view>
 
-						</template>
-						<view class="persent" v-if="item.workStatus == 2 ">
-							{{item.soc?'电量:'+( item.soc.toFixed(0))+'%':item.workStatusText}}
-
+						</template>
+						
+						<view class="persent"
+						 style="margin: auto;height: 50px;   "
+						 v-if="item.workStatus == 2 ">
+							<svg   style=" width: 90px;
+																display: flex;
+																position: relative;
+																top: 0px;
+																z-index: 80;
+															"	 
+							width="97" height="36" viewBox="0 0 97 36" fill="none" xmlns="http://www.w3.org/2000/svg">
+							<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0H97V36H0V0ZM27.0889 31.6517H72.363C71.4148 29.9925 70.8222 28.2147 70.5852 26.0814C70.5852 23.2369 71.7704 20.6295 73.6667 18.7332C75.563 16.8369 78.1704 15.6517 81.0148 15.6517C83.8593 15.6517 86.4667 16.8369 88.363 18.7332C90.2593 20.6295 91.4444 23.2369 91.4444 26.0814C91.4444 27.7406 91.0889 29.2814 90.3778 30.7036H90.7333C92.9852 29.5184 95.1185 28.0962 96.7778 25.6073L94.5259 13.0443C90.8519 11.3851 84.8074 9.37026 79.9482 8.77766C77.4593 6.05174 74.8519 3.9184 70.9407 2.25914C62.5259 1.19248 56.2444 1.54803 47.237 2.25914C39.5333 4.74803 32.8963 7.711 27.563 11.2666C26.438 11.4154 25.2599 11.5643 24.0461 11.7177C16.5644 12.6633 7.72591 13.7804 1.60741 16.1258L0.0666656 26.5554C2.2 28.8073 5.51852 29.9925 8.83704 30.7036C8.12592 29.2814 7.77037 27.8591 7.77037 26.1999C7.77037 23.3554 8.95556 20.748 10.8519 18.8517C12.7481 16.9554 15.3556 15.7703 18.2 15.7703C21.0444 15.7703 23.6519 16.9554 25.5481 18.8517C27.4444 20.748 28.6296 23.3554 28.6296 26.1999C28.6296 28.2147 28.1556 29.9925 27.0889 31.6517ZM74.7333 19.6814C76.3926 18.0221 78.763 16.9554 81.2519 16.9554C83.7407 16.9554 85.9926 18.0221 87.7704 19.6814C89.4296 21.3406 90.4963 23.711 90.4963 26.1999C90.4963 28.8073 89.4296 31.0591 87.7704 32.7184C86.1111 34.3777 83.7407 35.4443 81.2519 35.4443C78.6444 35.4443 76.3926 34.3777 74.7333 32.7184C73.0741 31.0591 72.0074 28.6888 72.0074 26.1999C72.0074 23.5925 73.0741 21.3406 74.7333 19.6814ZM11.8 19.6814C13.4593 18.0221 15.8296 16.9554 18.3185 16.9554C20.8074 16.9554 23.1778 18.0221 24.837 19.6814C26.4963 21.3406 27.563 23.711 27.563 26.1999C27.563 28.2849 26.8809 30.1426 25.7591 31.6517C25.4781 32.0298 25.1694 32.386 24.837 32.7184C23.1778 34.3777 20.8074 35.4443 18.3185 35.4443C15.7111 35.4443 13.4593 34.3777 11.8 32.7184C11.2095 32.1279 10.6941 31.4474 10.2751 30.7036C9.51666 29.3571 9.07407 27.8031 9.07407 26.1999C9.07407 23.5925 10.1407 21.3406 11.8 19.6814Z" fill="white"/>
+							</svg>
+						 
+							<u-line-progress  style=" width: 90px;
+													height: 32px;
+																display: flex;
+																position: relative;
+																top: -34px;
+																z-index: 30;
+															"	 
+							 
+							 v-if="item.soc"   inactive-color="#92bd90"
+							 :show-percent="false" :striped="false" :striped-active="false"
+							 active-color="#51a96b" :percent="item.soc?item.soc:100">
+							
+							 </u-line-progress>
+							
+							<svg   style="position: relative;top: -69px;left: 10px;z-index: 1;"
+							
+							
+							width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
+							<path d="M14.2454 34.1958C13.8962 33.9672 17.9208 21.3078 17.7138 20.7516C17.505 20.1954 11.1168 21.1668 10.8054 20.1894C10.4922 19.212 21.418 1.51684 21.7582 1.80124C22.0966 2.08564 18.126 14.8296 18.288 15.2454C18.4518 15.6594 24.9984 14.7726 25.1964 15.8076C25.3962 16.8426 14.5928 34.4244 14.2454 34.1958Z" fill="#00B962"/>
+							</svg>
+							<span  class="carspan" :class="{
+								carspan2:!item.soc
+							}"> {{item.soc?item.soc+'%':'充电中'}}</span>
+							<!-- <u-line-progress  v-if="item.soc"  
+							 :show-percent="true" :striped="true" :striped-active="true"
+							 active-color="#59ba73" :percent="item.soc"></u-line-progress>
+
+							<u-line-progress  v-else 
+							 :show-percent="true" :striped="true" :striped-active="true"
+							 active-color="#4eb6f6" :percent="100">
+							 充电中
+							 </u-line-progress> -->
+							
 						</view>
 
 
@@ -310,7 +354,9 @@
 					],
 					park: {
 						price: '2小时免费停车'
-					},
+					},
+					uuid:'',
+					setIntervalBool:true,
 					priceList: [],
 					devices: {
 						idleNum: 1,
@@ -335,10 +381,35 @@
 
 					this.getPriceList(op.id)
 				
-					this.getChargingStationDetail()
+					this.getChargingStationDetail()
+					
+				
 				}
 				
 			}
+		},
+		onHide() {
+			this.setIntervalBool=false
+			if(this.uuid){
+				clearInterval(this.uuid)	
+				this.uuid='';
+			}
+		},
+		onShow() {
+			this.setIntervalBool=true
+			if(!this.uuid){
+				this.uuid=setInterval(()=>{
+					if(this.setIntervalBool){
+						this.getChargingStationDetail(true)
+					}
+				},5*1000)
+			}
+		},
+		onUnload() {
+			if(this.uuid){
+				clearInterval(this.uuid)
+				
+			}
 		},
 		onReady() {
 			this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
@@ -360,11 +431,14 @@
 
 		},
 		methods: {
-			getChargingStationDetail() {
-				var _self = this;
-				uni.showLoading({
-
-				})
+			getChargingStationDetail(bl) {
+				var _self = this;
+				if(!bl){
+					uni.showLoading({
+					
+					})
+				}
+				
 				let data = {
 					stationId: this.stationId
 				};
@@ -657,7 +731,23 @@
 	}
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss" scoped>
+	.carspan{
+		display: flex;
+		    position: relative;
+		    top: -103px;
+		    left: 33px;
+			z-index: 88;
+			color: white;
+			
+	}
+	.carspan2{
+		
+		    
+		    left: 29px;
+			
+			
+	}
 	@import "@/_theme.scss";
 
 	.qr-code {