zhengkaixin 2 jaren geleden
bovenliggende
commit
0debbcc509

+ 3 - 2
.env.dev.js

@@ -1,7 +1,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://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/' ,
 	NODE_ENV :"dev",
@@ -12,6 +12,7 @@ const UNI_APP = {
 	//openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",//杨所
 	//openId:"oK9Wr58zNwDernF0TL6o3mdUxk2A",
 	//		openId:"oK9Wr5xRUoP9EygZqBec0xkJMVTs",
+	//openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU",//zq
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",
 	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5",

+ 10 - 1
apis/index.js

@@ -194,4 +194,13 @@ export function passengerMessageNoReadNum(data) {
 			data: data,
 			url: '/mobile/dataDictionary/getTips'
 		})
-	}
+	}
+	
+	export function readCoupon(data) {
+		return request({
+			method: 'post',
+			data: data,
+			url: '/mobile/chargingCouponApi/readCoupon'
+		})
+	}
+	

+ 2 - 0
apis/news.js

@@ -38,3 +38,5 @@ export function findConfigureByKey(data) {
 		url: url
 	})
 }
+
+

+ 238 - 16
pages/index/index.vue

@@ -90,8 +90,41 @@
 		
 		<u-modal v-model="showTop"  class="showOss"
 		:show-title="false" :show-confirm-button="false" >
-			<view class="slot-content">
-					<u-image width="250px;" 
+			<view class="slot-content" v-if="bannerListTop.length" >
+					<view  class="couponmain"   v-if="bannerListTop[showTopIndex].topmodel=='coupon'">
+						<view class="main" >
+							
+							<!-- 专享优惠券 -->
+							<view class="exclusive">
+								<p class="exclusive1">恭喜你</p>
+								<p class="exclusive2">获得{{bannerListTop[showTopIndex].value}}元月卡卷</p>
+								<view class="img"  >
+									<img src="../../assets/img/Frame915.png" alt="">
+									
+										<view class="num">
+											{{bannerListTop[showTopIndex].value}}<span class="unit">元</span>
+										</view>
+										
+										<view class="unit2">月卡优惠券</view>
+									<view class="ticket-info">
+										<view class="ticket-name" >
+											{{bannerListTop[showTopIndex].text}}
+											
+										</view>
+										
+									</view>
+								</view>
+							<view class="exclusive-text"> 持月卡在指定站点充电,充电服务费全免</view>
+							<button class="exclusive-btn" 
+							 @click="clickBannerTop()"
+							 shape="circle">立即开通</button>
+							
+								
+							</view>
+							
+						</view>
+					</view>
+					<u-image width="250px;"  v-else
 					 bgColor="#ff000000"
 					 style="margin: auto;min-height: 250px;"
 					mode="widthFix" @click="clickBannerTop()"
@@ -105,7 +138,18 @@
 					</view>
 					
 					</u-image>
-					<u-image width="36px"  style="margin: auto;"
+					<view
+					@click="showTopIndex++"
+					 v-show="showTopIndex!=bannerListTop.length-1"
+					>
+					<u-button class="choice-btn" 
+					 @click="nextTop(showTopIndex)"
+					 style="width: 80%;margin-top: 10px;"  shape="circle">下一条({{showTopIndex+1}}/{{bannerListTop.length}})</u-button>
+					
+					</view>
+					<u-image width="36px" 
+					 v-show="showTopIndex==bannerListTop.length-1"
+					 style="margin: auto; margin-top: 10px;"
 					mode="widthFix"  @click="showTop=false"
 					src="../../assets/img/if-close-line-circled.png"></u-image>
 					
@@ -539,7 +583,10 @@
 			// }
 		},
 		methods: {
-			
+			nextTop(index){
+				this.showTopImg=this.bannerListTop[index+1].picUrl;
+				this.showTopIndex=index+1;
+			},
 			getDescriptionTime() {
 				var date = this.activityDate;
 				var dateMonth1 = new Date().getMonth()+1;
@@ -748,21 +795,42 @@
 				var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
 				
 				newsApi.getBannerInfo(code).then((res) => {
+					
+					
 					this.bannerListTop =res.data;
 					
-					for(var i in this.bannerListTop ){
-						var mod=this.bannerListTop[i];
-						var time=this.carhelp.get("bannerListTop"+mod.id);
-						if(time&&nowtime==time){
-							
-						}else{
-							this.showTop=true;
-							this.showTopImg=mod.picUrl;
-							this.showTopIndex=i;
-							this.carhelp.set("bannerListTop"+mod.id,nowtime);
-							break;
-						}
+					var time=this.carhelp.get("bannerListTop");
+					
+					if(this.bannerListTop.length&&!(time&&nowtime==time)){
+						this.showTop=true;
+						this.showTopImg=this.bannerListTop[0].picUrl;
+						this.showTopIndex=0;
+						//this.carhelp.set("bannerListTop",nowtime);
+					}
+					if (this.userId) {
+						API.readCoupon().then((res2) => {
+							var mod=res2.data.userCoupon;
+							console.log(mod)
+							if(mod){
+								var obj={
+									topmodel:"coupon",
+									value:mod.value,
+									text:mod.describe,
+									linkUrl:"#/pages/monthlyCardActivity/monthlyCardBuy",
+								}
+									this.bannerListTop =[
+										obj,...res.data
+									]
+								if(!(time&&nowtime==time)){
+									this.showTop=true;
+									this.showTopImg=this.bannerListTop[0].picUrl;
+									this.showTopIndex=0;
+									//this.carhelp.set("bannerListTop",nowtime);
+								}
+							}
+						})
 					}
+					
 				
 					
 					uni.hideLoading()
@@ -1064,6 +1132,160 @@
 </script>
 
 <style lang="scss" scoped>
+	
+	.couponmain{
+		.main{
+			
+			margin: 100px auto 0;
+			position: relative;
+			.content{
+				padding: 24px;
+				padding-top: 50px;
+				background-color: #fff;
+				box-shadow: 0px 0px 0px 1px rgba(254, 229, 147, 100);
+				border: 2px solid rgba(253, 217, 141, 100);
+				border-radius: 8px;
+				.img{
+					width: 44vw;
+					height: 134px;
+					position: absolute;
+					top: -88px;
+					right: 0px;
+					img{
+						width: 100%;
+						height: 100%;
+					}
+				}
+		      .title{
+				  font-size: 16px;
+				  color: rgba(84, 45, 45, 100);
+				  margin-bottom: 13px;
+			  }			
+			  .text{
+				  line-height: 24px;
+				  color: rgba(84, 45, 45, 100);
+				  font-size: 16px;
+				  text-align: justify;
+				  text-decoration:underline;
+				   text-decoration-color:#ECE3BA;
+				   text-indent: 32px;
+			  }
+			  .sign{
+				  text-align: right;
+				  margin-top: 8px;
+				  font-size: 16px;
+			  }
+			}
+			
+			// 专享优惠券
+			.exclusive{
+				background-color: #F5E4C8;
+				margin-top: 20px;
+				padding: 32rpx 32rpx 32rpx 32rpx ;
+				box-shadow: 0px 0px 0px 1px rgba(254, 229, 147, 100);
+				border: 2px solid rgba(253, 217, 141, 100);
+				border-radius: 8px;
+				.exclusive1{
+					
+					font-size: 48rpx;
+					color: rgba(51, 51, 51, 1);
+
+					font-family: SourceHanSerif-bold;
+				}
+				.exclusive2{
+					font-family: PingFangSC-regular;
+					color: rgba(51, 51, 51, 1);
+					font-size: 36rpx;
+				}
+				p{
+					width: 100%;
+					text-align: center;
+					//color: rgba(255, 73, 75, 100);
+					//font-size: 20px;
+				}
+				.img{
+					// width: 74.4vw;
+					// height: 84px;
+					margin-top: 16px;
+					position: relative;
+					img{
+						width: 100%;
+						height: 100%;
+						
+					}
+				}
+				
+					
+					
+					
+					.num{
+						font-size:54rpx;
+						color: rgba(252, 237, 179, 100);
+						position: absolute;
+						top:10px;
+						left: 8vw;
+						font-weight: 600;
+						.unit{
+							
+							font-size: 24rpx;
+							color: rgba(252, 237, 179, 100);
+						
+						}
+					}
+					
+					.unit2{
+						
+						font-size: 12px;
+						color: #FFF;
+						position: absolute;
+						top: 90rpx;
+						left: 24rpx;
+					}
+					.exclusive-text{
+						color: #333333;
+						font-size: 16rpx;
+					}
+					.exclusive-btn{
+						width: 80%;
+						margin-top: 48rpx;
+						border-radius: 50px;
+						background: linear-gradient(90.58deg, rgba(225,208,165,1) 0.05%,rgba(228,190,132,1) 98.67%);
+						color: rgba(51, 51, 51, 1);
+						font-size: 36rpx;
+						text-align: center;
+						box-shadow: 0px 8rpx 20rpx 0px rgba(184, 155, 103, 40);
+						font-family: -apple-system;
+						  //  width: 87.4%;
+						  //  margin-top: 20px;
+						  //  background-image: linear-gradient(#ffff00, #ff9600);
+						 //   color: #521e00;
+						   // font-size: 20px;
+						   // border-radius: 50px;
+					}
+					.ticket-info{
+						width: 40vw;
+						text-align: center;
+						position: absolute;
+						top: 18px;
+						right: 16rpx;
+						.ticket-name{
+							line-height: 40rpx;
+							color: rgba(16, 16, 16, 100);
+							font-size: 16rpx;
+							
+						}
+						.condition{
+							line-height: 22px;
+							color: #8a6f6f;
+							font-size: 12px;
+						}
+						
+					}
+				
+			}
+		}
+	}
+	
 	.oldTextClassF{
 		
 		.station .price-free .price-1 .num{

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

@@ -13,7 +13,7 @@
 						</text>
 						
 						<text class='u-progress-info' v-if="chargingGun.gunType==2">
-							<p style="text-align: center;"   >{{chargingRecord.electricQuantity?(chargingRecord.electricQuantity/10000).toFixed(1):0}}</p>
+							<p style="text-align: center;"   >{{chargingRecord.electricQuantity?(chargingRecord.electricQuantity/10000).toFixed(2):0}}</p>
 							<p class="progress-text">已充电量(度)</p>
 						</text>
 						
@@ -211,13 +211,13 @@
 								
 								<text class='u-progress-info'  >
 									<view v-if="chargingGun.gunType==1" style="
-											font-size: 40px;
+											font-size: 80rpx;
 											font-weight: bold;
 											color: #009B52 ;
 										" >{{percent}}<span style="font-size: 16px;">%</span></view>
 									<view v-if="chargingGun.gunType==2"
 									style="
-											font-size: 30px;
+											font-size: 60rpx;
 											font-weight: bold;
 											color: #009B52 ;
 										"
@@ -226,7 +226,7 @@
 									<view
 									 
 									 style="
-											font-size: 14px;
+											font-size: 32rpx;
 											font-weight: bold;
 										" 	>预计费用{{chargingRecord.dueFee?chargingRecord.dueFee.toFixed(2):'0.00'}}元</view>
 								</text>
@@ -272,7 +272,7 @@
 					</view>
 					<view class="info-item">
 						<view class="content" >
-							{{chargingGun.kwh?chargingGun.kwh.toFixed(1):0}}
+							{{chargingRecord.electricQuantity?(chargingRecord.electricQuantity/10000).toFixed(2):0}}
 						</view>
 						<view class="name">
 							已充电量(度)
@@ -1472,9 +1472,9 @@
 		padding-bottom: 12px;
 		    z-index: 999;
 		.img-box{
-			width: 48px;
-			height: 48px;
-			padding: 12px 0;
+			width: 96rpx;
+			height: 96rpx;
+			padding: 24rpx 0;
 			background-color: rgba(210, 215, 213, 100);
 			text-align: center;
 			border-radius: 999px;

+ 27 - 15
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -161,7 +161,7 @@
 							解锁中<img style="margin-left: 4px;" src="../../../static/img/riLine-refresh-line.svg" alt="">
 						</u-button> -->
 			<!-- 刷新充电枪状态 -->
-			<u-button shape="circle" type="success"   @click="workStatus2" v-if="gun&&gun.workStatus==2"   >充电中</u-button>
+			<u-button shape="circle" type="success"   v-if="gun&&gun.workStatus==2"   >充电中</u-button>
 			
 			<u-button shape="circle" type="success"  v-else-if="!openBool"   >仅单位内部员工可用</u-button>
 			
@@ -210,6 +210,7 @@
 </template>
 
 <script>
+	import * as API_index from '@/apis/index.js'
 	import * as API from "@/apis/chargeProcess.js"
 	import {
 		newDate,
@@ -314,22 +315,29 @@
 				})
 			},
 			workStatus2(){
-				uni.showModal({
-					title: '提示',
-					content: '充电中,请勿重复提交',
-					confirmText:'我的订单?',
-					showCancel:true,
-					success: res => {
-						if (res.confirm) {
-							uni.redirectTo({
-								url:'/pages/record/index'
-							})
+				API_index.findChargeData().then((res) => {
 				
-						} else if (res.cancel) {
-							//('用户点击取消');
+					var list = res.data.chargingRecordList;
+					var obj=null;
+					for (var i = 0; i < list.length; i++) {
+						
+						if (list[i].deviceNo==this.detail.deviceNo&&list[i].channelNo==this.gun.channelNo) {
+							obj=list[i];
+							break;
 						}
 					}
-				});
+					if(obj){
+						uni.redirectTo({
+							url:"/pages/searchPile/chargeProcess/dcCharging?id="+obj.id
+						})
+					}
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
 			},
 			vinCk(){
 				
@@ -435,6 +443,7 @@
 					this.prices = res.data.prices
 					this.price=res.data.price
 					this.gun = res.data.gun
+					
 					this.car = res.data.car
 					
 					this.lockStatus=res.data.lockStatus;
@@ -485,7 +494,10 @@
 					}else{
 							this.getUserCard();
 					}
-				
+					if(this.gun.workStatus==2){
+						this.workStatus2()
+					}
+					
 				}).catch(error => {
 					uni.hideLoading()
 					uni.showModal({

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

@@ -158,7 +158,11 @@
 						
 						
 						<view v-if="item.workStatus == 0&&item.insertStatus"
-								style="font-size:14px;height: 50px;"
+								style=" font-size:14px;height: 50px;"
+								:class="{
+									'not-open':item.isRed
+								}"
+								
 								class="free charging">
 						已插枪
 						</view>
@@ -1637,7 +1641,7 @@
 				margin-left: 4px;
 
 				.name {
-
+					width: 320rpx;
 					font-size: 14px;
 					line-height: 16px;
 					color: rgba(16, 16, 16, 100);