Browse Source

提示,控制

zhengkaixin 2 năm trước cách đây
mục cha
commit
2814e7d07b

+ 1 - 1
pages/searchPile/chargeProcess/charge.vue

@@ -298,7 +298,7 @@
 				if(this.selectObj.id){
 					this.submitForm.userCouponId=this.selectObj.id
 				}
-				if(this.userCardBool){
+				if(this.userCardBool&&this.canUse){
 					this.submitForm.userCardId=this.userCard.id
 				}
 				uni.showLoading({

+ 3 - 6
pages/searchPile/chargeProcess/dcCharging.vue

@@ -330,12 +330,9 @@
 		},
 		computed:{
 			userCardBool(){
-				if(this.userCard){
-					var date=new Date().getTime()
-					var date2=new Date(this.userCard.endTime).getTime();
-					if(date<date2){
-						return true;
-					}
+				if(this.chargingRecord&&this.chargingRecord.userCardId){
+					
+					return true;
 				}
 				return false
 			}

+ 45 - 3
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -86,12 +86,23 @@
 			</view>
 		</view>
 		<!--提示  -->
-		<view class="tips" >
-			<p class="p">提示:</p>
+		<view class="tips" v-if="userCardBool" style="margin-bottom: 20px;" >
+			<p class="p">会员活动:</p>
 			<!-- <view class="content" v-if="!isInsert">
-
 				点击降锁后,请稍等几十秒,待地锁完全下降后,再驶入车位。
+			</view> -->
+			<view class="content" :style="canUse?'':'color: red;'" >
+			
+				{{canUse?'充电服务费包月卡':'此充电站不支持月卡服务'}}
 				
+			</view>
+			
+		</view>
+		<!--提示  -->
+		<view class="tips" v-if="carDetText" >
+			<p class="p">提示:</p>
+			<!-- <view class="content" v-if="!isInsert">
+				点击降锁后,请稍等几十秒,待地锁完全下降后,再驶入车位。
 			</view> -->
 			<view class="content">
 			
@@ -184,6 +195,20 @@
 				confirmText: '拨打电话',
 				content: '余额不足5,请先充值。',
 				carDetText: '',
+				userCard:null,
+				canUse:false,
+			}
+		},
+		computed:{
+			userCardBool(){
+				if(this.userCard){
+					var date=new Date().getTime()
+					var date2=new Date(this.userCard.endTime).getTime();
+					if(date<date2){
+						return true;
+					}
+				}
+				return false
 			}
 		},
 		onShow() {
@@ -329,8 +354,25 @@
 			}
 			if (op.id) {
 				this.id = op.id
+				
+				API.userCard({
+					stationId:this.id
+				}).then((res) => {
+					console.log(res)
+					this.userCard=res.data.regUserCard
+					this.canUse=res.data.canUse
+					//this.user = res.data
+				
+				 
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+				
 				//this.carhelp.setGunId(op.id)
 				this.getPile()
+				
 			} else {
 				uni.showToast({
 					title: "请扫码充电"