zhengkaixin 2 лет назад
Родитель
Сommit
5cf4c6013a
1 измененных файлов с 37 добавлено и 8 удалено
  1. 37 8
      pages/monthlyCardActivity/monthlyCardBuy.vue

+ 37 - 8
pages/monthlyCardActivity/monthlyCardBuy.vue

@@ -18,13 +18,19 @@
 		</view>
 		<view class="slogan-2">
 			单次购买、整月受益!
+		</view>
+		<view class="slogan-3" style="color: #ead9b4;" >
+			限时活动结束时间2022年8月8日0点结束
 		</view>
 		<view class="slogan-3" >
 			仅限车主购买,适用于平台对外开放充电站
 		</view>
 		<view class="slogan-4" @click="gotoUrl('pages/monthlyCardActivity/monthlyCardList?cardId='+cardId)">
 			查看适用站点
-		</view>
+		</view>
+		
+		
+		
 		<u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
 		<u-modal v-model="showModel" :show-cancel-button="true" @cancel="getUserInfo()" @confirm="confirm" confirm-text="支付成功?" title="扫码支付">
 			<view style="
@@ -39,14 +45,19 @@
 		</u-modal>
 		<img id="qrcode" style="display: none;">
 		
+		
+		
+		<view class="bottom" v-if="!endCardBool" >
+			<button class="dredge" >已下架</button>
+			
+		</view>
 		<!-- 立即开通 -->
-		<view class="bottom" v-if="islogin" >
+		<view class="bottom" v-else-if="ispay" >
 			<button class="dredge" >已购买</button>
-			
 		</view>
 		
 		<!-- 立即开通 -->
-		<view class="bottom" v-else-if="!islogin&&detail.price" >
+		<view class="bottom" v-else-if="!ispay&&detail.price" >
 			<button class="dredge" v-if="detail.putShelf&&!detail.isVip" @click="show = true">立即开通 ¥{{detail.price.toFixed(2)}}/月</button>
 			<button class="dredge" v-if="detail.putShelf&&detail.isVip" @click="show = true">{{detail.platformText}}车主特惠 ¥{{detail.price.toFixed(2)}}/月<span style="font-size: 12px;    text-decoration: line-through;">¥{{detail.oldPrice.toFixed(2)}}</span></button>
 			
@@ -86,7 +97,8 @@
 				show: false,
 				submitForm:{},
 				detail:{},
-				islogin:true,
+				ispay:true,
+				endTime:"2022-08-08"
 			}
 		},
 		onReady() {
@@ -95,9 +107,23 @@
 		},
 		 onShow(){
 			 this.getUserInfo();
+		 },
+		 computed:{
+			 endCardBool(){
+			 	var date=new Date().getTime()
+			 	var date2=new Date(this.endTime).getTime();
+			 
+			 	if(date<date2){
+			 		return true;
+			 	}else{
+			 		return false;
+			 	}
+			 }
 		 },
 		methods: {
 			userCardBool(userCard){
+				
+				
 				if(userCard){
 					var date=new Date().getTime()
 					var date2=new Date(userCard.endTime).getTime();
@@ -107,6 +133,7 @@
 				}
 				return false
 			},
+		
 			getUserInfo(){
 				uni.showLoading({
 					title: "加载中",
@@ -114,7 +141,7 @@
 				})		
 				loginApi.findByOpenId({
 					openId: this.carhelp.getOpenId(),
-					onerror:true
+					noerror:true
 				}).then((res) => {
 					uni.hideLoading();
 					
@@ -122,7 +149,7 @@
 						
 						if(res.data.regUser){
 							var userCard=res.data.userCard;
-							this.islogin=	this.userCardBool(userCard)
+							this.ispay=	this.userCardBool(userCard)
 							
 						}else{
 							
@@ -168,7 +195,9 @@
 				})
 			},
 			submit(type){
-				
+				if(!this.endCardBool){
+					return
+				}
 				uni.showLoading({
 					title: "加载中",
 					mask: true,