zhengkaixin 2 years ago
parent
commit
4c348af62b

+ 83 - 56
components/u-navbar/u-navbar.vue

@@ -53,6 +53,15 @@
 </template>
 
 <script>
+	import * as API from '@/apis/index.js'
+	import {
+		newDate,
+		currentTimeStamp,
+		parseUnixTime,
+		secondsDistance,
+		hourDistanceArr
+	} from '@/utils'
+	
 	// 获取系统状态栏的高度
 	let systemInfo = uni.getSystemInfoSync();
 	let menuButtonInfo = {};
@@ -253,73 +262,91 @@
 		},
 		created() {
 			 
-			let url=window.location.href.split("#/")[1];
-			let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
-			let curRoute = routes[routes.length - 1].route
-			var nowtime=new Date().getTime();
-			this.descriptionHtml="";
-		
-			var list =this.carhelp.getConfigMessage()
-			if(list&&list.length){
-				//var list=JSON.parse(message);
 			 
-				for(var i in list){
-					// if(list[i].name=='*'){
-					// 	this.descriptionShow=true;
-					// 	this.description=list[i].value;
-					// }
-					if(false){
-						console.log(list[i].url)
-						console.log(curRoute)
-						
-					}
-					
-					if(list[i].url==curRoute){
-						
-						this.descriptionShow=true;
-						this.description=list[i].value;
-					}
-					if(list[i].url==url||url.indexOf(list[i].url)==0){
-						this.descriptionShow=true;
-						this.description=list[i].value;
+			 var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}  {h}')
+			 var time=this.carhelp.get("getTips_$");
+			 if((time&&nowtime==time)){
+			 	this.getConfigMessage()
+			 }else{
+			 	API.getTips().then((response) => {
+			 		this.carhelp.set("getTips_$",nowtime);
+			 		this.carhelp.setConfigMessage(response.data.tipsList);
+					this.getConfigMessage()
+			 	}).catch(error => {
+			 		
+			 	})
+			 }
+			 
+			
+		},
+		methods: {
+			getConfigMessage(){
+				let url=window.location.href.split("#/")[1];
+				let routes = getCurrentPages(); // 获取当前打开过的页面路由数组
+				let curRoute = routes[routes.length - 1].route
+				var nowtime=new Date().getTime();
+				this.descriptionHtml="";
 						
-						if(list[i].startTime){
-							var startTime=new Date(list[i].startTime).getTime()
-							if(startTime>nowtime){
-								this.descriptionShow=false;
-								continue;
-							}
-						}
+				var list =this.carhelp.getConfigMessage()
+				if(list&&list.length){
+					//var list=JSON.parse(message);
+				 
+					for(var i in list){
+						// if(list[i].name=='*'){
+						// 	this.descriptionShow=true;
+						// 	this.description=list[i].value;
+						// }
+						if(false){
+							console.log(list[i].url)
+							console.log(curRoute)
 							
-						if(list[i].endTime){
-							var endTime=new Date(list[i].endTime).getTime()
-							if(endTime<nowtime){
-								this.descriptionShow=false;
-								continue;
-							}
 						}
-						if(this.descriptionShow&&list[i].type!='1'){
-							
-							var sz=['top','top','modal']
-							this.descriptionModel=sz[list[i].type];
-							this.descriptionTitle=list[i].title;
+						
+						if(list[i].url==curRoute){
 							
-						}else{
+							this.descriptionShow=true;
+							this.description=list[i].value;
+						}
+						if(list[i].url==url||url.indexOf(list[i].url)==0){
+							this.descriptionShow=true;
+							this.description=list[i].value;
 							
-							if(list[i].remark){
+							if(list[i].startTime){
+								var startTime=new Date(list[i].startTime).getTime()
+								if(startTime>nowtime){
+									this.descriptionShow=false;
+									continue;
+								}
+							}
+								
+							if(list[i].endTime){
+								var endTime=new Date(list[i].endTime).getTime()
+								if(endTime<nowtime){
+									this.descriptionShow=false;
+									continue;
+								}
+							}
+							if(this.descriptionShow&&list[i].type!='1'){
+								
+								var sz=['top','top','modal']
+								this.descriptionModel=sz[list[i].type];
 								this.descriptionTitle=list[i].title;
-								this.descriptionHtml=list[i].remark;
+								
+							}else{
+								
+								if(list[i].remark){
+									this.descriptionTitle=list[i].title;
+									this.descriptionHtml=list[i].remark;
+								}
+							}
+							
+							if(this.descriptionShow){
+								break;
 							}
-						}
-						
-						if(this.descriptionShow){
-							break;
 						}
 					}
 				}
-			}
-		},
-		methods: {
+			},
 			alerttipsCk(){
 				if(this.descriptionHtml){
 					this.descriptionShow2=true;

+ 41 - 20
pages/login/welcome.vue

@@ -9,12 +9,12 @@
 				
 			</view>
 			
-			<u-image  id="imgw" v-if="imgmode"   @load="imgsload" ref="imgw"   mode="widthFix">
+			<u-image  id="imgw" v-if="imgmode" src=""  @load="imgsload" ref="imgw"   mode="widthFix">
 				<view slot="loading"></view>
 				<view slot="error"></view>
 			</u-image>
 			
-			<u-image   v-if="!imgmode"  :height="imgH"   mode="aspectFill">
+			<u-image   v-if="!imgmode"  :height="imgH" src=""  mode="aspectFill">
 				<view slot="loading"></view>
 				<view slot="error"></view>
 			</u-image>
@@ -30,7 +30,15 @@
 <script>
 	import * as loginApi from '@/apis/login.js'
 	import * as API from '@/apis/index.js'
-	
+	import {
+		// newDate,
+		// secondsDistance,
+		// hourDistanceArr
+		currentTimeStamp,
+		parseUnixTime,
+		
+	} from '@/utils'
+	 
 	export default {
 		data() {
 			return {
@@ -69,18 +77,26 @@
 						
 					}
 				})
+			},
+			getTips(){
+				var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}  {h}')
+				var time=this.carhelp.get("getTips_$");
+				if((time&&nowtime==time)){
+					
+				}else{
+					API.getTips().then((response) => {
+						this.carhelp.get("getTips_$",nowtime);
+						this.carhelp.setConfigMessage(response.data.tipsList) 				
+					}).catch(error => {
+						
+					})
+				}
 			},
 			 findNoLTextConfigure(){
-				 API.getTips().then((response) => {
-				 				
-				 	this.carhelp.setConfigMessage(response.data.tipsList) 
+				 this.getTips();
 				
-				 }).catch(error => {
-				 	
-				 })
-				 
-				 loginApi.findNoLTextConfigure().then((response) => {
 				
+				 loginApi.findNoLTextConfigure().then((response) => {
 				 	this.carhelp.setConfig(response.data.configure) 
 				 	this.setBackImg()
 				 }).catch(error => {
@@ -132,14 +148,18 @@
 			},
 			setBackImg(){
 				var  img=this.carhelp.getConfig().homepageLogo
-					
-				if(img){
-					this.$refs.imgw.src=img
-					//document.body.style="background:url("+img+") no-repeat;background-size: 100%;"
-				}else{
-					this.$refs.imgw.src="../../static/img/welcome_bg.png"
+				try{
+					if(img){
+						this.$refs.imgw.src=img
+						//document.body.style="background:url("+img+") no-repeat;background-size: 100%;"
+					}else{
+						this.$refs.imgw.src="../../static/img/welcome_bg.png"
+					}
+				}catch(e){
+					//TODO handle the exception
 				}
 				
+				
 			},
 			gotoIndex(){
 				if(this.isReady){
@@ -180,13 +200,13 @@
 				})
 								
 				this.indexstep()
-				this.setBackImg( )
+				
 			},
 			
 		},
 		onLoad(op) {
 			
-			this.findNoLTextConfigure()
+			
 			this.findByOpenId()
 			if(op.friends){
 				
@@ -226,7 +246,8 @@
 			document.body.style=""
 		},
 		onReady() {
-			
+			this.findNoLTextConfigure()
+			this.onReadyIng()
 		}
 	}
 </script>

+ 15 - 2
pages/searchPile/chargeProcess/charge.vue

@@ -153,7 +153,7 @@
 					
 				</view>
 				<view class="right"   v-else-if="payValue=='2'">
-					企业单位用户不享受会员优惠活动
+					企业单位用户不可使用优惠券
 				</view>
 				<view class="right" @click="chooseCoupons"  v-else-if="selectObj.id">
 					{{selectObj.threshold == 0 ? '无门槛' : '满'+selectObj.threshold.toFixed(2)+'元可用'}},
@@ -241,7 +241,11 @@
 			<view class="contentTitle">
 				选择充电车辆
 			</view>
-			<scroll-view scroll-y="true" style="height: 520rpx;">
+			<view v-if="companyPaySelect&&(companyPaySelect.carList&&companyPaySelect.carList.length==0||companyPaySelect.carList==null)"  style=" text-align: center;" >
+				<img src="static/img/暂无数据-缺省页.png" alt="">
+				<p class="oldTextjp2" >未分配车辆,请联系管理员</p>
+			</view>
+			<scroll-view v-else scroll-y="true" style="height: 520rpx;">
 				
 				<view style="padding-bottom: 30rpx;" >
 					<u-radio-group v-model="companyPaySelect.car" size="42">
@@ -616,6 +620,12 @@
 						
 						this.companyPaySelect=company
 						
+						 
+						if(company.carList&&company.carList.length==1){
+							//this.companyPaySelect=entRegList[0]
+							
+							this.companyPaySelect.car=company.carList[0].carNum;
+						}
 					}
 				}
 				console.log(this.companyPaySelect)
@@ -1039,6 +1049,7 @@
 								this.companyList.push(item)
 							}
 						}
+						
 						
 						this.isReady = true;
 						uni.hideLoading()
@@ -1061,6 +1072,7 @@
 											this.payValue=payValueDefault;
 										}
 									}
+									
 								}
 							}
 						}
@@ -1185,6 +1197,7 @@
 				   }
 				   .span3{
 					     padding-top:8rpx ;
+						 padding-left: 8rpx;
 				   					    width: 10%;
 										  
 				   }

+ 1 - 1
pages/searchPile/stationAndPile/stationDetails.vue

@@ -536,7 +536,7 @@
 
 					devices: [],
 					slowPrice: null,
-					station: null,
+					station: {},
 					fastPrice: null
 
 				},