瀏覽代碼

vin判断

zhengkaixin 2 年之前
父節點
當前提交
6d1b2615dc

+ 22 - 10
pages/searchPile/chargeProcess/charge.vue

@@ -98,14 +98,19 @@
 			 <view class="member" v-if="userCardBool" >
 			 <view class="member" v-if="userCardBool" >
 			 	<view class="actively">
 			 	<view class="actively">
 			 		会员活动
 			 		会员活动
-			 	</view>
-				<view class="type" v-if="canUse">
+			 	</view>
+				<view class="type"  v-if="!vin" style="color: red;" >
+					vin码不一致
+				</view>
+				<view class="type" v-else-if="canUse">
 					充电服务费包月卡
 					充电服务费包月卡
 				</view>
 				</view>
-				<view class="type" style="color: red;" v-if="!canUse">
+				<view class="type" style="color: red;" v-else>
 					此充电站不支持月卡服务
 					此充电站不支持月卡服务
-				</view>
-			 </view>
+				</view>
+				
+			 </view>
+			
 			
 			
 		</view>
 		</view>
 		<view class="bottom">
 		<view class="bottom">
@@ -178,7 +183,8 @@
 				selectObj:{},
 				selectObj:{},
 				value:"",
 				value:"",
 				// 优惠券
 				// 优惠券
-				listlength:0,
+				listlength:0,
+				vin:true,
 
 
 			}
 			}
 		},
 		},
@@ -211,6 +217,9 @@
 				this.submitForm.channelNo = op.gun;
 				this.submitForm.channelNo = op.gun;
 				this.submitForm.carNumber = op.carNumber;
 				this.submitForm.carNumber = op.carNumber;
 				this.carhelp.setGunIdCharge(this.submitForm);
 				this.carhelp.setGunIdCharge(this.submitForm);
+			}
+			if(op.vin=='no'){
+					this.vin=false;
 			}
 			}
 			if(op.isback){
 			if(op.isback){
 				this.isback=false;
 				this.isback=false;
@@ -240,7 +249,10 @@
 			
 			
 			this.getHomePage()
 			this.getHomePage()
 		},
 		},
-		methods: {
+		methods: {
+			getPile(){
+				
+			},
 			theme(type) {
 			theme(type) {
 				
 				
 			  if(type == 'elder')	
 			  if(type == 'elder')	
@@ -313,7 +325,7 @@
 				if(this.selectObj.id){
 				if(this.selectObj.id){
 					this.submitForm.userCouponId=this.selectObj.id
 					this.submitForm.userCouponId=this.selectObj.id
 				}
 				}
-				if(this.userCardBool&&this.canUse){
+				if(this.userCardBool&&this.canUse&&this.vin){
 					this.submitForm.userCardId=this.userCard.id
 					this.submitForm.userCardId=this.userCard.id
 				}
 				}
 				uni.showLoading({
 				uni.showLoading({
@@ -431,10 +443,10 @@
 				}
 				}
 
 
 
 
-				if (this.submitForm.chargeStrategy == 0 && this.user.balance < 5) {
+				if (this.submitForm.chargeStrategy == 0 && this.user.balance < 1) {
 					uni.showModal({
 					uni.showModal({
 						title: '支付',
 						title: '支付',
-						content: '余额不足5元无法开启充满自停,是否充值?',
+						content: '余额不足1元无法开启充满自停,是否充值?',
 						success: res => {
 						success: res => {
 							if (res.confirm) {
 							if (res.confirm) {
 								//付钱  改为组件
 								//付钱  改为组件

+ 77 - 25
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -29,7 +29,7 @@
 							{{detail.chargingPower}}kW
 							{{detail.chargingPower}}kW
 						</view>
 						</view>
 					</view>
 					</view>
-					<view class="item"  @click="priceDetail">
+					<view class="item"  @click="priceDetail" v-if="price">
 						<view class="title">
 						<view class="title">
 							电费+服务费
 							电费+服务费
 							<view class="iconfont more">
 							<view class="iconfont more">
@@ -76,7 +76,7 @@
 					<text class="free" v-else-if="gunDetail.chargingAppointment&&!gunDetail.isMeAppoint">已被预约</text>
 					<text class="free" v-else-if="gunDetail.chargingAppointment&&!gunDetail.isMeAppoint">已被预约</text>
 					<text class="free" v-else>{{gun.workStatusText}}</text>
 					<text class="free" v-else>{{gun.workStatusText}}</text>
 				</view>
 				</view>
-				<view class="price">
+				<view class="price" v-if="price">
 					<text>{{price.costPrice}}</text><text class="unit">元/度</text>
 					<text>{{price.costPrice}}</text><text class="unit">元/度</text>
 				</view>
 				</view>
 				<view class="address">
 				<view class="address">
@@ -95,6 +95,8 @@
 			
 			
 				{{canUse?'充电服务费包月卡':'此充电站不支持月卡服务'}}
 				{{canUse?'充电服务费包月卡':'此充电站不支持月卡服务'}}
 				
 				
+				<view v-if="!vinCk()" style="color: red;">vin码不一致,无法享受月卡服务</view>
+			
 			</view>
 			</view>
 			
 			
 		</view>
 		</view>
@@ -147,6 +149,22 @@
 		<!-- 弹窗 -->
 		<!-- 弹窗 -->
 		<view>
 		<view>
 
 
+		<u-modal v-model="showVin"  class="showOss"
+		    confirm-text="知道了"
+		:show-title="false"  >
+			<view class="slot-content">
+				
+					<u-image width="120px"  style="margin: auto;"
+					mode="widthFix"  
+					src="@/static/img/充电中-缺省页.png"></u-image>
+					<view style="padding:0 40px;font-size: 36rpx;">
+						系统检测出当前充电车辆与包月卡所绑定的车辆不一致,该车辆可以正常充电,但无法享受包月卡免服务费优惠。
+						
+					</view>
+			</view>
+		</u-modal>
+		
+		
 			<u-modal v-model="show" @confirm="confirmPhone" :confirm-text="confirmText" confirm-color="#606266"
 			<u-modal v-model="show" @confirm="confirmPhone" :confirm-text="confirmText" confirm-color="#606266"
 				:show-cancel-button="true" ref="uModal" :asyncClose="true" :title="title" :content="consumerPhone"
 				:show-cancel-button="true" ref="uModal" :asyncClose="true" :title="title" :content="consumerPhone"
 				:content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
 				:content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
@@ -192,7 +210,7 @@
 				description: '温馨提示:充电前请确保您的车辆已与充电桩连接!并关闭车内电源。',
 				description: '温馨提示:充电前请确保您的车辆已与充电桩连接!并关闭车内电源。',
 				show: false,
 				show: false,
 				title: '联系客服',
 				title: '联系客服',
-
+				showVin:false,
 				confirmText: '拨打电话',
 				confirmText: '拨打电话',
 				content: '余额不足5,请先充值。',
 				content: '余额不足5,请先充值。',
 				carDetText: '',
 				carDetText: '',
@@ -213,7 +231,8 @@
 					}
 					}
 				}
 				}
 				return false
 				return false
-			}
+			},
+			 
 		},
 		},
 		onShow() {
 		onShow() {
 			uni.hideToast();
 			uni.hideToast();
@@ -224,6 +243,18 @@
 		
 		
 		},
 		},
 		methods: {
 		methods: {
+			vinCk(){
+				
+				if(this.userCard&&this.userCard.vin&&this.gun&&this.gun.vin){
+					if(this.userCard.vin==this.gun.vin){
+						return true
+					}else{
+						return false
+					}
+				}else{
+					return true
+				}
+			},
 			priceDetail(){
 			priceDetail(){
 				uni.navigateTo({
 				uni.navigateTo({
 					url:'chargePriceDetails?stationId='+this.detail.stationId+"&type="+this.detail.type+"&id="+this.detail.id
 					url:'chargePriceDetails?stationId='+this.detail.stationId+"&type="+this.detail.type+"&id="+this.detail.id
@@ -267,6 +298,33 @@
 			role() {
 			role() {
 				 
 				 
 				
 				
+			},
+			getUserCard(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.userCard({
+					stationId:this.detail.stationId
+				}).then((res2) => {
+						uni.hideLoading()
+					console.log(res2)
+					this.userCard=res2.data.regUserCard
+					this.canUse=res2.data.canUse
+					//this.user = res.data
+					
+					if(this.userCardBool){
+						//检查vin码
+						if(!this.vinCk()){
+							this.showVin=true;
+						}
+					}
+					
+				}).catch(error2 => {
+					uni.showToast({
+						title: error2
+					})
+				})
 			},
 			},
 			getPile() {
 			getPile() {
 				uni.showLoading({
 				uni.showLoading({
@@ -278,6 +336,7 @@
 					gunNo: this.id,
 					gunNo: this.id,
 					jpcode: "jp_team51_charge_id:A_" + this.id
 					jpcode: "jp_team51_charge_id:A_" + this.id
 				}).then((res) => {
 				}).then((res) => {
+						uni.hideLoading()
 					this.gunDetail= res.data;
 					this.gunDetail= res.data;
 					this.detail = res.data.device
 					this.detail = res.data.device
 					this.prices = res.data.prices
 					this.prices = res.data.prices
@@ -293,6 +352,9 @@
 
 
 						if (res.data.isMeAppoint) {
 						if (res.data.isMeAppoint) {
 							
 							
+							this.getUserCard();
+							
+							
 						} else {
 						} else {
 							var chargingAppointment = res.data.chargingAppointment
 							var chargingAppointment = res.data.chargingAppointment
 							var data = newDate(chargingAppointment.createTime).getTime()
 							var data = newDate(chargingAppointment.createTime).getTime()
@@ -312,24 +374,10 @@
 							})
 							})
 						}
 						}
 
 
+					}else{
+							this.getUserCard();
 					}
 					}
-					
-					API.userCard({
-						stationId:this.detail.stationId
-					}).then((res2) => {
-						console.log(res2)
-						this.userCard=res2.data.regUserCard
-						this.canUse=res2.data.canUse
-						//this.user = res.data
-						uni.hideLoading()
-					 
-					}).catch(error2 => {
-						uni.showToast({
-							title: error2
-						})
-					})
-					
-
+				
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({
 						title: error
 						title: error
@@ -338,11 +386,15 @@
 			},
 			},
 			charge() {
 			charge() {
 				//this.role()
 				//this.role()
-				
-					uni.navigateTo({
-						url: '/pages/searchPile/chargeProcess/charge?stationId=' + this.detail.stationId +
+				var url='/pages/searchPile/chargeProcess/charge?stationId=' + this.detail.stationId +
 							'&deviceNo=' + this.detail.deviceNo + "&gun=" + this.gun.channelNo + "&carNumber=" + (
 							'&deviceNo=' + this.detail.deviceNo + "&gun=" + this.gun.channelNo + "&carNumber=" + (
-								this.car ? this.car.carNum : '')
+								this.car ? this.car.carNum : '');
+					
+					if(!this.vinCk()){
+						url+="&vin=no"
+					}
+					uni.navigateTo({
+						url: url
 					})
 					})
 				
 				
 
 

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

@@ -66,17 +66,27 @@
 					<view class="item" :style="item.open?'':'  border-bottom: 1px solid rgba(238, 242, 240, 100);'"
 					<view class="item" :style="item.open?'':'  border-bottom: 1px solid rgba(238, 242, 240, 100);'"
 						:key="i+'_'+index">
 						:key="i+'_'+index">
 
 
-						<view
+						<view v-if="device.online"
 							:style="item.workStatusText.length>3?' padding: 0 10px':(item.workStatusText.length==3?'padding: 4px;font-size:24rpx':'padding: 10px;')"
 							:style="item.workStatusText.length>3?' padding: 0 10px':(item.workStatusText.length==3?'padding: 4px;font-size:24rpx':'padding: 10px;')"
 							:class="{
 							:class="{
 						free:true,
 						free:true,
 						charging:item.enableShare&&item.workStatus!=0,
 						charging:item.enableShare&&item.workStatus!=0,
-						'not-open':!device.online,
+						
 						'not-open2':item.enableShare&&!item.enableShareWithinTime&&device.online
 						'not-open2':item.enableShare&&!item.enableShareWithinTime&&device.online
 						
 						
 					}">
 					}">
 							{{item.workStatusText}}
 							{{item.workStatusText}}
-						</view>
+						</view>
+						<view v-else
+								style=" padding: 0 10px"
+								:class="{
+							free:true,
+					
+							'not-open':true,
+							
+						}">
+								离线
+							</view>
 						<view class="info">
 						<view class="info">
 							<view class="name oldTextjp" oldstyle="font-size: 20px;line-height: 23px;">
 							<view class="name oldTextjp" oldstyle="font-size: 20px;line-height: 23px;">
 								{{item.sortNo}}号/{{device.name}}{{device.gunList.length>1?'枪'+item.channelNo:''}}
 								{{item.sortNo}}号/{{device.name}}{{device.gunList.length>1?'枪'+item.channelNo:''}}