zhengkaixin 1 年之前
父节点
当前提交
48a8aeab46

+ 15 - 44
pages/cardBag/cardBag.vue

@@ -9,7 +9,7 @@
 			
 			
 			<view class="mcorporate-member" v-if="current==0"  v-for="(item,i) in  businessVipList"
-			  @click="gotoUrl('pages/user/company-vip?id='+item.platform)"  :key="i"  >
+			  @click="gotoUrl('pages/user/company-vip?id='+item.vipUser.platform)"  :key="i"  >
 			 
 			  <view class="icon">
 			  	<img src="../../assets/img/corporateMember.png" alt="">
@@ -19,9 +19,9 @@
 			  		企业会员
 			  	</view>
 				<view class="company">
-					{{item.platformN}}
+					{{item.vipUser.platformN}}
 				</view>
-				<view class="balance" v-if="item.entAccountEnabled&&item.enterpriseAccount!=null">
+				<view class="balance" v-if="item.vipUser.entAccountEnabled&&item.enterpriseAccount!=null">
 					企业账户余额:{{item.enterpriseAccount.totalAmount?item.enterpriseAccount.totalAmount.toFixed(2):'0.00'}}元
 					
 				</view>
@@ -47,7 +47,7 @@
 				<view class="discount-card"    @click="gotocardDetails(item)"
 				:key="i+'b'" v-if="item.classify==2">
 					<view class="name">
-						自营站充电服务费6折卡
+						{{item.cardName}}
 					</view>
 					<view class="progress">
 						<view class="time">
@@ -59,10 +59,11 @@
 					</view>
 					<ujp-line-progress active-color="#2979ff" :percent="thispercent(item)"></ujp-line-progress>
 				</view>
+			
 			</template>
 			
 			
-			<view class="carNone" v-if="current==0&&businessVipList.length==0&&!userCardBool">
+			<view class="carNone" v-if="current==0&&businessVipList.length==0&&showList.length==0">
 				<img src="static/img/暂无数据-缺省页.png" alt="">
 				<p class="oldTextjp2" oldstyle="font-size: 18px;">暂无数据</p>
 			</view>
@@ -89,6 +90,7 @@
 					name: '已过期'
 				}],
 				expireUserCardList:[],
+				cardList:[],
 				pageIndex: 1,
 				recordsTotal: 0,
 				current: 0,
@@ -98,9 +100,9 @@
 		},
 		computed:{
 			showList(){
-				if(this.current==0&&this.userCardBool){
+				if(this.current==0 ){
 					
-					return  [this.userCard]
+					return  this.cardList
 				}
 				if(this.current==1){
 					
@@ -125,23 +127,7 @@
 			}
 		},
 		onReady() {
-			this.userCard=this.carhelp.getPersonInfoPlus().userCard
-			 
-
-			this.businessVipList=this.carhelp.getPersonInfoPlus().businessVipList
-			if(this.businessVipList.length){
 			
-					var b=false;
-					for(var i in this.businessVipList){
-						var item=this.businessVipList[i];
-						if(item.entAccountEnabled){
-							b=true
-						}
-					}
-					if(b){
-						this.personalCenter()
-					}
-			}
 			
 			this.getChargeList();
 			
@@ -171,9 +157,14 @@
 				
 				}).then((res) => {
 					uni.hideLoading();
+					this.cardList = res.data.cardList;
 					
 					this.expireUserCardList = res.data.expireUserCardList;
 					//this.recordsTotal = res.data.recordsTotal;
+					this.businessVipList=res.data.memberCardList;
+					
+					
+					
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -200,27 +191,7 @@
 				}
 				return p.toFixed(0)
 			},
-			personalCenter(){
-				API.personalCenter().then((res2) => {
-					var entRegList=res2.data.entRegList;
-					for(var i in this.businessVipList){
-						var item1=this.businessVipList[i]
-						for(var j in entRegList){
-							var item2=entRegList[j].vipUser;
-							
-							if(item1.id==item2.id){
-								item1.enterpriseAccount=entRegList[j].enterpriseAccount
-							}
-						}
-					}
-					this.$forceUpdate()
-					
-				}).catch(error => {
-						uni.showToast({
-							title: error
-						})
-					})
-			},
+			 
 			change(index) {
 				this.current = index;
 				

+ 2 - 2
pages/cardBag/cardDetails.vue

@@ -12,7 +12,7 @@
 		<view class="header" v-if="item.id" >
 			<view class="discount-card">
 				<view class="name">
-					自营站充电服务费6折卡
+					{{item.cardName}}
 				</view>
 				<view class="progress">
 					<view class="time">
@@ -35,7 +35,7 @@
 					服务费折扣卡
 				</view>
 			</view>
-			<view class="item">
+			<view class="item" v-if="false">
 				<view class="title">
 					折扣率
 				</view>

+ 6 - 5
pages/monthlyCardActivity/monthlyCardBuy.vue

@@ -530,11 +530,12 @@
 		methods: {
 			
 			showPay(){
-				if(this.userCard&&this.userCard.classify==2){
-					this.show4=true
-				}else{
-					this.show=true
-				}
+				// if(this.userCard&&this.userCard.classify==2){
+				// 	this.show4=true
+				// }else{
+					
+				// }
+				this.show=true
 			},
 			scrolltolower: function(e) {
 				//		

+ 110 - 8
pages/searchPile/chargeProcess/charge.vue

@@ -191,11 +191,11 @@
 					</view>
 					<view class="type" v-else-if="canUse">
 						{{userCard.classify==1?'折扣卡':''}}
-						{{userCard.classify==2?'服务费6折卡':''}}
+						{{userCard.classify==2?'服务费'+(userCard.serviceFeeDiscountRate/10)+'折卡':''}}
 					</view>
 					<view class="type" style="color: red;" v-else>
 						此充电站不支持{{userCard.classify==1?'折扣卡':''}}
-						{{userCard.classify==2?'服务费6折卡':''}}
+						{{userCard.classify==2?'服务费'+(userCard.serviceFeeDiscountRate/10)+'折卡':''}}
 					</view>
 				</template>
 				<template v-else>
@@ -205,7 +205,35 @@
 				</template>
 
 			</view>
-
+			<view v-if="cardList.length" class="cardListView">
+				<view  class="cardListItemTitle">点击切换其他卡</view>
+				<view  class="cardListItem" v-for="(item,i) in cardList" 
+				 :key="i"  :class="{
+					 select:userCard.id==item.id
+				 }" @click="userCard=item" >
+					<view  class="cardListName" >
+						{{item.cardName}}
+						
+					</view>
+					<view  class="cardListText" v-if="item.classify==1" >
+						
+						<view>充电服务费全免</view>
+						
+						<view>
+							|{{thisendTime(item.endTime)}}到期
+						</view>
+					</view>
+					<view  class="cardListText" v-if="item.classify==2" >
+						
+						<view>
+							已用{{item.chargedDegree?item.chargedDegree.toFixed(0):0.00}}度 / 共{{item.chargeDegreeLimit}}度
+						</view>
+						<view>
+							|{{thisendTime(item.endTime)}}到期
+						</view>
+					</view>
+				</view>
+			</view>
 
 		</view>
 		<view class="botton">
@@ -398,13 +426,20 @@
 </template>
 
 <script>
-	import * as API from '@/apis/chargeProcess.js'
+	import * as API from '@/apis/chargeProcess.js'
+	import * as API_index from '@/apis/index.js'
+	
 	import * as userApi from '@/apis/user.js'
 	import * as newsApi from '@/apis/news.js'
 	import * as API_finance from '@/apis/finance.js'
 	import {
 		wxPayJs
-	} from '@/utils/wxpay'
+	} from '@/utils/wxpay'
+	import {
+		newDate,daysDistance
+		
+	} from '@/utils'
+	
 	import * as Pay from '@/apis/weixin.js'
 
 
@@ -518,7 +553,8 @@
 				selectItem: {},
 				personInfo: {},
 				carNumber: "",
-				show3: false,
+				show3: false,
+				cardList:[],
 			}
 		},
 		computed: {
@@ -595,7 +631,10 @@
 			if (this.elderMode)
 				this.theme('elder')
 			else
-				this.theme('standard')
+				this.theme('standard')
+				
+				
+			this.getChargeList()
 		},
 		onShow() {
 			this.personInfo = this.carhelp.getPersonInfo()
@@ -609,7 +648,35 @@
 
 			this.getHomePage()
 		},
-		methods: {
+		methods: {
+			thisdaysDistance(endTime){
+						
+							 var date=new Date()
+							 var date2=newDate(endTime);
+							 return daysDistance(date,date2)
+							 
+			},
+			getChargeList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API_index.personCardList({
+				
+				}).then((res) => {
+					uni.hideLoading();
+					this.cardList=res.data.cardList
+					
+					
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			gotoLogin() {
 				this.onShowRole = true
 				if (false) {
@@ -1043,6 +1110,14 @@
 					}
 
 				})
+			},
+			thisendTime(endTime){
+				if(endTime){
+					var reg=new RegExp('-','gi')
+					var str=endTime.substring(0,10).replace(reg,'.')
+					return str
+				}
+				return ''
 			},
 			getHomePage() {
 				uni.showLoading({
@@ -1819,5 +1894,32 @@
 		img {
 			width: 100%;
 		}
+	}
+	.cardListView{
+		
+		.cardListItemTitle{
+			    color: #777777;
+			    font-size: 36rpx;
+		}
+			.cardListItem{
+				    margin:5px  4px;
+					border: 1px solid ;
+					    padding: 3px;
+					    border-radius: 6px;
+					.cardListName{
+						 font-size: 34rpx;
+					}
+				.cardListText{
+					 font-size: 24rpx;
+					display:flex;
+					 justify-content: space-between;
+				}
+				
+			}
+			.select{
+				border: 2px solid #00b962;
+				background-color:  #00b962;
+				color:#fff;
+			}
 	}
 </style>

+ 13 - 11
pages/searchPile/chargeProcess/dcCharging.vue

@@ -111,7 +111,7 @@
 					折扣卡
 				</view>
 				<view class="info-text" v-if="userCard.classify==2">
-					充电服务费6折卡
+					充电服务费{{userCard.monthlyRentCard.serviceFeeDiscountRate/10}}折卡
 				</view>
 			</view>
 			<view class="info-min" v-if="userCardBool&&userCard.classify==2">
@@ -492,11 +492,12 @@
 						<view class="title">
 							会员活动
 						</view>
-						<view class="info-text" v-if="userCard.classify==1">
+						<view class="detail" v-if="userCard.classify==1">
 							折扣卡
 						</view>
-						<view class="info-text" v-if="userCard.classify==2">
-							充电服务费6折卡
+						<view class="detail" v-if="userCard.classify==2">
+							
+							充电服务费{{userCard.monthlyRentCard.serviceFeeDiscountRate/10}}折卡
 						</view>
 
 					</view>
@@ -693,9 +694,9 @@
 			if(this.personInfo.quickCharging){
 				this.checked2 = true;
 			}
-			if (plus) {
-				this.userCard = plus.userCard;
-			}
+			// if (plus) {
+			// 	  this.userCard = plus.userCard;
+			// }
 			if (op.id) {
 				this.id = op.id;
 				this.init()
@@ -869,7 +870,8 @@
 					recordId: this.chargingRecord.id
 				}).then((res) => {
 					this.prices = res.data.prices
-					this.chargingStation = res.data.chargingStation;
+					this.chargingStation = res.data.chargingStation;
+					this.userCard =  res.data.regUserCard ;
 					this.forPrice()
 
 
@@ -1101,9 +1103,9 @@
 						}, time)
 					}
 
-					if (this.chargingRecord.status == 2 && this.userCardBool) {
-						this.getHomePage()
-					}
+					// if (this.chargingRecord.status == 2 && this.userCardBool) {
+					// 	this.getHomePage()
+					// }
 
 					uni.hideLoading()
 

+ 10 - 6
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -153,13 +153,17 @@
 							<view class="price-3-card ">
 
 
-								<view class="num1">
-
-									<img src="@/assets/img/9-4/6折卡价.svg" />
-
+								<view class="num1" >
+
+									<img v-if="!userCard||userCard.serviceFeeDiscountRate==60" src="@/assets/img/9-4/6折卡价.svg" />
+									<span v-else style="    background: #303133;
+										color: #f4f4f4;
+										border-radius: 4px 0 4px 4px;
+										padding: 0 3px;
+										margin-right: 3px;" >{{userCard.serviceFeeDiscountRate/10}}折卡 </span>
 								</view>
 								<text
-									class="num">{{ (price.electricityPrice+(price.servicePrice*0.6)).toFixed(2)}}元/度</text>
+									class="num">{{ (price.electricityPrice+(price.servicePrice*(userCard?userCard.serviceFeeDiscountRate/100:0.6))).toFixed(2)}}元/度</text>
 
 							</view>
 						</view>
@@ -275,7 +279,7 @@
 					</view>
 					<view class="discount-card" v-if="userCardBool&&userCard.classify==2">
 						<view class="name">
-							自营站充电服务费6折卡
+							自营站充电服务费{{userCard.serviceFeeDiscountRate/10}}折卡
 						</view>
 						<view class="progress">
 							<view class="time">

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

@@ -458,7 +458,7 @@
 							
 							<text class="unit">元/度</text>
 						
-							<view class="unit-price2"  >
+							<view class="unit-price3"  >
 								已开通
 							</view>
 						</view>
@@ -505,7 +505,7 @@
 					</view>
 					<view class="item item-vip3"  v-if="userId&&userCardBool&&userCard.classify==2" >
 						<view class="visitor">
-							服务费6折卡会员价
+							服务费{{userCard.serviceFeeDiscountRate/10}}折卡会员价
 						</view>
 						<view class="unit-price">
 							

+ 28 - 17
pages/user/index.vue

@@ -69,7 +69,7 @@
 				<view class="item ">
 					<view class="item-value">
 
-						{{businessVipList.length+ ( userId&&userCardBool?1:0)}}
+						{{cardNum}}
 					</view>
 					<view class="item-title" @click="gotoUrl('pages/cardBag/cardBag')">
 						会员卡<u-icon name="arrow-right" color="#B8BDC4" size="2"></u-icon>
@@ -409,7 +409,8 @@
 				show2: false,
 				background: {
 					background: 'none'
-				},
+				},
+				cardNum:0,
 			}
 		},
 		onShow() {
@@ -474,7 +475,28 @@
 			}
 
 		},
-		methods: {
+		methods: {
+			getChargeList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.personCardList({
+				
+				}).then((res) => {
+					uni.hideLoading();
+					this.cardNum=res.data.cardNum
+					
+					
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			carClick() {
 
 				if (this.userId) {
@@ -686,20 +708,9 @@
 					openId: this.carhelp.getOpenId()
 				}).then((res) => {
 					uni.hideLoading();
-
-					this.businessVipList = res.data.businessVipList;
-					// if(this.businessVipList.length){
-					// 	var b=false;
-					// 	for(var i in this.businessVipList){
-					// 		var item=this.businessVipList[i];
-					// 		if(item.entAccountEnabled){
-					// 			b=true
-					// 		}
-					// 	}
-					// 	if(b){
-					// 		//this.personalCenter()
-					// 	}
-					// }
+					this.getChargeList()
+					//this.businessVipList = res.data.businessVipList;
+				
 					this.headImg = res.data.regUser.headImg;
 					this.nickName = res.data.regUser.nickName;
 					this.userCard = res.data.userCard;