瀏覽代碼

停车优惠卷 固定2小时, 使用提示

zhengkaixin 1 年之前
父節點
當前提交
888139c740

+ 2 - 2
config/.env.dev.ud.js

@@ -2,7 +2,7 @@ const UNI_APP = {
 	ProjectName :"优电联盟",
 	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/' ,
@@ -19,7 +19,7 @@ const UNI_APP = {
 	
 	wechatUrl:"/youdian",
 	openId:"oSruR6YkhP7QDroLnZGxWis43Kn0",//zkx
-	//openId:"oSruR6dZcmSM4ATuweZ5fjHGQsiA",//杨所
+	openId:"oSruR6dZcmSM4ATuweZ5fjHGQsiA",//杨所
 	//openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",
 	//openId:"123",
 	//小鹏管家appid

+ 1 - 1
config/.env.js

@@ -10,7 +10,7 @@
     if (process.env.NODE_ENV === "development") {  
 		 
         ENV_VAR = require('@/config/.env.dev.js');
-		//ENV_VAR = require('@/config/.env.dev.ud.js');
+		ENV_VAR = require('@/config/.env.dev.ud.js');
 		 
 		
     } else if (process.env.NODE_ENV === "production") {  

+ 8 - 3
pages/login/login.vue

@@ -261,6 +261,8 @@
 				if(this.carhelp.getUserInfo().nickname){
 					this.form.nickName = this.carhelp.getUserInfo().nickname;
 					this.form.headImg = this.carhelp.getUserInfo().headimgurl;
+				}else{
+					
 				}
 				//this.form.nickName = this.carhelp.getUserInfo().nickname;
 				//this.form.headImg = this.carhelp.getUserInfo().headimgurl;
@@ -479,9 +481,12 @@
 					mask: true,
 				})
 
-				//this.form.nickName= this.form.telephone;
-				this.form.nickName = this.carhelp.getUserInfo().nickname;
-				this.form.headImg = this.carhelp.getUserInfo().headimgurl;
+				//this.form.nickName= this.form.telephone;
+				if(this.carhelp.getUserInfo().nickname){
+					this.form.nickName = this.carhelp.getUserInfo().nickname;
+					this.form.headImg = this.carhelp.getUserInfo().headimgurl;
+				}
+				
 				this.form.openId = this.carhelp.getOpenId();
 				this.form.source = 2 //创建渠道1电单车2电车
 

+ 7 - 1
pages/record/coupon.vue

@@ -20,9 +20,12 @@
 						免费停车时长
 					</view>
 					
-					<view class="c5">
+					<view class="c5" v-if="useFreeCoupon==1">
 						{{ getPercent(chargeDetail,useFreeMinute,true)}}
 					</view>
+					<view class="c5" v-if="useFreeCoupon==2">
+						2小时
+					</view>
 				</view>
 				
 				<view class="a2" >
@@ -138,6 +141,9 @@
 							this.chargeDetails=JSON.parse(this.chargeDetail.chargeDetails)
 					}
 					this.useFreeMinute=res.data.useFreeMinute;
+					this.useFreeCoupon=res.data.useFreeCoupon;
+					
+				
 					
 					var date1 = newDate(this.chargeDetail.endTime).getTime();
 					var date2 = new Date().getTime();

+ 4 - 2
pages/record/details.vue

@@ -52,8 +52,10 @@
 				<view  class="showCoupon11">
 					<span class="showCoupon111" >免费停车优惠卷</span>
 				</view>
-				<view  class="showCoupon12 padding1">{{ getPercent(chargeDetail,useFreeMinute,true)}}</view>
-				<view  class="showCoupon13 padding1">充电时间 {{ getPercent(chargeDetail)}}<span v-if="useFreeMinute">(+{{useFreeMinute}}分钟)</span></view>
+				<view  class="showCoupon12 padding1" v-if="useFreeCoupon==1" >{{ getPercent(chargeDetail,useFreeMinute,true)}}</view>
+				<view  class="showCoupon12 padding1" v-if="useFreeCoupon==2" >2小时</view>
+				
+				<view  class="showCoupon13 padding1">充电时间 {{ getPercent(chargeDetail)}}<span v-if="useFreeCoupon==1">(+{{useFreeMinute}}分钟)</span></view>
 			</view>
 			<view class="showCoupon2 padding2">
 				<u-icon name="coupon-fill" size="48" color="#FF3D00"></u-icon>

+ 126 - 5
pages/searchPile/chargeProcess/dcCharging.vue

@@ -164,7 +164,28 @@
 				<u-button size="default" shape="circle" @click="gotoMain(0)">返回首页</u-button>
 				<u-button size="default" shape="circle" @click="gotoMain(1)">查看订单详情</u-button>
 			</view>
-
+			
+			<view class="useFreeCoupon" v-if="chargingStation.useFreeCoupon">
+				<view  class="title " >温馨提示:车辆出场时可出示该券</view>
+				<view class="details showCoupon"  @click="gotoUrl('pages/record/coupon?id='+id)"  >
+					<view class="showCoupon1 ">
+						<view  class="showCoupon11">
+							<span class="showCoupon111" >免费停车优惠卷</span>
+						</view>
+						<view  class="showCoupon12 padding1" v-if="chargingStation.useFreeCoupon==1" >{{ getPercentshowCoupon(chargingRecord,chargingStation.couponFreeMinute,true)}}</view>
+						<view  class="showCoupon12 padding1" v-if="chargingStation.useFreeCoupon==2" >2小时</view>
+						
+						<view  class="showCoupon13 padding1">充电时间 {{ getPercentshowCoupon(chargingRecord)}}<span v-if="chargingStation.useFreeCoupon==1">(+{{chargingStation.couponFreeMinute}}分钟)</span></view>
+					</view>
+					<view class="showCoupon2 padding2">
+						<u-icon name="coupon-fill" size="48" color="#FF3D00"></u-icon>
+						<view  class="showCoupon22">
+							出示
+						</view>
+					</view>
+				</view>
+			</view>
+			
 			<view class="piccBanner" v-for="(itemJNT,index ) in bannerListJNTend" @click="gotoUrl2(itemJNT.linkUrl)"
 				v-show="index==0" :key="index" style="
 				text-align: center;
@@ -432,10 +453,16 @@
 					<view class="item" v-if="chargingStation.parkingSimpleDescription">
 
 						<view class="title" style="
-						width: 100%;
+						width: 100%;    display: flex;
+    justify-content: space-between;
 					" @click="parkingTips=true">
-							停车费说明 <u-icon name="arrow-right" style="
-									float: right;margin-top: 6px;" size="28"></u-icon>
+							<view>停车费说明 </view>
+							<view style="    font-size: 32rpx;
+    font-weight: 400;">
+								{{chargingStation.parkingDescription}}
+								<u-icon name="arrow-right" style="margin-top: 6px;" size="28"></u-icon>
+							</view>
+							
 						</view>
 
 
@@ -827,7 +854,49 @@
 				return false
 			}
 		},
-		methods: {
+		methods: {
+			getPercentshowCoupon(chargingRecord,time,str) {
+				if (!chargingRecord.startTime) {
+					return '00:00:00'
+				}
+				var Hour = 0;
+				var Fen = 0;
+				var S = 0;
+				
+					var now = newDate(chargingRecord.startTime).getTime();
+					var date = newDate(chargingRecord.endTime).getTime();
+					if(time){
+						date=date+time*1000*60
+					}
+					var seconds = parseInt(( date-now ) / 1000);
+					
+					var ms = seconds;
+							
+					Hour = parseInt(Math.floor(ms / (60 * 60)));
+					Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
+					S = parseInt(Math.floor(ms % (60)));
+							
+				if(str){
+					var obj = "";
+					if(Hour){
+						obj+=Hour+"小时"
+					}
+					if(Fen){
+						obj+=Fen+"分"
+					}
+					if(S){
+						obj+=S+"秒"
+					}
+								
+					return obj;
+				}else{
+					var obj = (Hour > 9 ? "" : "0") + Hour + ":" + (Fen > 9 ? "" : "0") + Fen + ":" + (S > 9 ? "" : "0") + S
+								
+								
+					return obj;
+				}
+				
+			},
 			getPie() {
 				
 
@@ -2211,5 +2280,57 @@
 			border-radius: 50px;
 			font-size: 32rpx;
 		}
+	}
+	
+	.showCoupon{
+		    display: flex;
+		    justify-content: space-between;
+		    align-items: center;
+		padding: 0 ;
+		.padding1{
+			padding-left: 32rpx;
+		}
+		.padding2{
+			padding-right: 32rpx;
+		}
+		.showCoupon1{
+			.showCoupon111{
+				padding: 2rpx 24rpx;
+				border-radius: 8px 0px 8px 0px;
+				background-color: rgba(255, 61, 0, 1);
+				color: rgba(255, 255, 255, 1);
+			}
+			.showCoupon13{
+				padding-bottom: 32rpx;
+				font-weight: bold;
+			}
+			.showCoupon12{
+				color: red;
+				font-size: 48rpx;
+				font-weight: bold;
+				margin: 16rpx 0 4rpx 0;
+			}
+		}
+		.showCoupon2{
+			border-left: 1px solid #CFCFCF;
+			padding-left: 32rpx;
+			    display: flex;
+			    flex-direction: column;
+			    align-items: center;
+		}
+	}
+	.useFreeCoupon{
+		 padding: 40rpx 72rpx;
+		 .title{
+			 color: rgba(255, 61, 0, 1);
+			text-align: center;
+			margin-bottom: 10rpx;
+		 }
+		 .showCoupon{
+			 background-color: #e4e4e4;
+			 border-radius: 8px;
+
+		 }
+		 
 	}
 </style>

+ 31 - 8
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -497,10 +497,25 @@
 			
 		 
 			<view  class="cost-explainMain" >
-				
+				<view   class="cost-explain"  >
+					<view class="text">
+					
+						充电记录
+					</view>
+								
+					<view class="iconfont" style="
+						  font-size: 32rpx;
+						text-align: right;" @click="gotoUrl('pages/record/index')">
+						查看&#xe600;
+					</view>
+				</view>	
+				<view   class="cost-explain useFreeCoupon"  v-if="station.useFreeCoupon" >
+					↑↑充电结束后查看记录使用“免费停车优惠劵”
+				</view>	
 				<view    class="cost-explain"  v-if="station.id=='f62ce857-1301-4cf3-9c02-74d378c25ab2'" >
 					<view class="text" style="width: 100%;">
-						费用说明
+						费用说明
+						
 								
 						<view class="iconfont" style="color: #1bbe6b;
 							    font-size: 28rpx;
@@ -2356,11 +2371,7 @@
 				 font-size: 36rpx;
 				
 			
-				.cost-explain2{
-					.car-number{
-						color: #FF3D00;
-					}
-				}
+				
 				// 费用说明
 				.cost-explain {
 					
@@ -2389,6 +2400,12 @@
 						color: #b3b3b3;
 						font-size: 48rpx
 					}
+				}
+				.cost-explain2{
+					.car-number{
+						font-size: 28rpx;
+						color: #FF3D00;
+					}
 				}
 	}
 	
@@ -2815,5 +2832,11 @@
 		.swiperitem {
 			height: 700rpx;
 		}
-	}
+	}
+	
+	.useFreeCoupon{
+		font-size: 24rpx;
+		color:#FF3D00;
+	}
+	
 </style>