Просмотр исходного кода

Merge branch 'master' of http://47.92.161.104:10080/zkx/JP-ChargeTeam51

zhengkaixin 1 год назад
Родитель
Сommit
81ef532372

+ 68 - 18
pages/searchPile/stationAndPile/stationDetails.vue

@@ -460,20 +460,45 @@
 							</view>
 						</view>
 					</view>
-					<view class="item item-vip2" v-if="!userCardBool" >
-						<view class="visitor">
-							6折卡会员价
-						</view>
-						<view class="unit-price">
-							
-							<text>{{showNumJP(pricesInfoCurrent2.electricityPrice+(pricesInfoCurrent2.servicePrice*0.6))}}</text>
-							
-							<text class="unit">元/度</text>
-							<text class="register"  
-							 @click="gotoUrl('pages/discountCard/productDetails')">开通</text>
-							 
+					<view class="item " v-if="!userCardBool" :class="{
+						'item-vip2':prevMonthKwhBL,
+						'item-vip':!prevMonthKwhBL
+					}" >
+						<template v-if="prevMonthKwhBL">
+							<view class="visitor">
+								6折卡会员价
+							</view>
+							<view class="unit-price">
+								
+								<text>{{showNumJP(pricesInfoCurrent2.electricityPrice+(pricesInfoCurrent2.servicePrice*0.6))}}</text>
+								
+								<text class="unit">元/度</text>
+								<text class="register"  
+								 @click="gotoUrl('pages/discountCard/productDetails')">开通</text>
+								 
+								
+							</view>
+						</template>
+					<template v-else>
+						<view class="visitor">
+							月卡价格
+						</view>
+						<view class="unit-price">
+							
+							<text>{{(pricesInfoCurrent2.electricityPrice).toFixed(2)}}</text>
+							
+							<text class="unit">元/度</text>
+							<text class="register" v-if="userId&&!userCardBool"
+							 @click="gotoUrl('pages/monthlyCardActivity/monthlyCardBuy')">开通</text>
+							<text  class="register" v-if="userId&&userCardBool" >
+								已开通
+							</text>
+						</view>
+					</template>
+						
+						
+												
 							
-						</view>
 					</view>
 					<view class="item item-vip3"  v-if="userId&&userCardBool&&userCard.classify==2" >
 						<view class="visitor">
@@ -860,7 +885,15 @@
 			})
 
 		},
-		computed: {
+		computed: {
+			prevMonthKwhBL(){
+				if(this.personInfo){
+					if(this.personInfo.prevMonthKwh>=1000){
+						return false
+					}
+				}
+				return true
+			},
 			 userCardBool(){
 			 	if(this.userCard){
 			 		var date=new Date().getTime()
@@ -2035,12 +2068,29 @@
 					width: 42%;
 				}
 				.item-vip {
-					color: #5A3629;
-					background-color:#FFF9EB ;
-					width: 57%;
+					//color: #5A3629;
+					color: rgba(255, 255, 255, 1);
+					//background-color:#FFF9EB ;
+					background: linear-gradient(88.81deg, rgba(219,199,167,1) 1.89%,rgba(194,154,93,1) 98%);
+					
+					width: 57%;
+					.unit{
+						color: rgba(255, 255, 255, 1);
+					}
+					.register {
+						padding: 4rpx 16rpx;
+						height: 24px;
+						border-radius: 50px;
+						//background: linear-gradient(87.64deg, rgba(253, 129, 69, 1) 1.81%, rgba(252, 63, 3, 1) 100.04%);
+						background: linear-gradient(87.64deg, rgba(255,255,255,1) 1.81%,rgba(255,251,215,1) 98.08%);
+						color: rgba(128, 74, 0, 1);
+						font-size: 24rpx;
+						text-align: center;
+						margin-left: 38rpx;
+					}
 				}
 				.item-vip2 {
-					color: rgba(255, 255, 255, 1);
+					color: rgba(255, 255, 255, 1);
 					background: linear-gradient(32.4deg, rgba(59,182,254,1) 20.49%,rgba(0,185,98,1) 118.87%); ;
 					width: 57%;
 					.register {

+ 2 - 2
pages/user/member/index.vue

@@ -21,7 +21,7 @@
 			<view class="p">本次升级共上线8大会员权益:</view>
 			<view class="p">1、折扣卡 联盟及以上会员可购买充电服务费6折卡</view>
 			<view class="p">2、月卡 联盟及以上会员可购买充电服务费月卡</view>
-			<view class="p">3、车主驿站 荆鹏软件园充电站院内可供新能源车主使用的共享职工之家</view>
+			<view class="p">3、荆鹏软件园 充电站院内可供新能源车主使用的共享职工之家</view>
 			<view class="p">4、小礼品 平台不定期为黄金及以上会员赠送小礼品</view>
 			<view class="p">5、工会福利 荆州市总工会不定期为黄金及以上会员赠送福利</view>
 			<view class="p">6、充电预约 铂金会员可在已开启预约功能的充电桩上预约充电服务</view>
@@ -70,7 +70,7 @@
 					</tr>
 					<tr>
 						<td class="td1">
-							车主驿站
+							荆鹏软件园
 						</td>
 						<td><span class="span2">●</span></td>
 						<td><span class="span2">●</span></td>

+ 60 - 8
pages/user/member/member.vue

@@ -76,9 +76,9 @@
 								<img src="../../../assets/img/member/00.png" alt="">
 							</view>
 							<view class="vipText1" :style="'color:'+item.color1">{{item.name}}</view>
-							<view class="vipText2"  :style="'color:'+item.color2">{{item.num==0?'注册成功,并完善个人信息':'上个月累计充电量达'+item.num+'度'}}</view>
+							<view class="vipText2"  :style="'color:'+item.color2">{{item.num==0?'注册成功,并完善个人信息':'上个月累计充电量达'+carImg3span3+'度'}}</view>
 							<view class="vipText3"  :style="'color:'+item.color3">
-							{{personInfo.memberLevel>=(i+1)?'会员有效期至:'+(item.num==0?'永久':startDate+'01'):'暂未达标'}}
+							{{personInfo.memberLevel>=(i+1)?'会员有效期至:'+(item.num==0?'永久':startDate):'暂未达标'}}
 							</view>
 						</view>
 						<view class="vipTextImg" >
@@ -115,7 +115,7 @@
 					<view class="img-box">
 						<img src="../../../assets/img/riFill-home-heart-fill@3x.png" alt="">
 					</view>
-					<view class="grid-text">车主驿站</view>
+					<view class="grid-text">荆鹏软件园</view>
 					<view class="grid-text2">共享职工之家</view>
 				</u-grid-item>
 			</u-grid>
@@ -221,7 +221,9 @@
 					memberLevel:1
 				},
 				carImg3span1: 0,
-				carImg3span2: 0,
+				carImg3span2: 0,
+				carImg3span3: 0,
+				carImg3span4: 0,
 				startDate:'',
 				uCurrent:0,
 			}
@@ -229,15 +231,65 @@
 		onReady() {
 			this.personInfo = this.carhelp.getPersonInfo()
 			this.uCurrent=this.personInfo.memberLevel-1
-			this.getChargeList()
+			this.getChargeList()//本月
+			
 		},
 		methods: {
 			changeCurrent(e){
 				
 				this.uCurrent=e;
 			},
+			getChargeList2(endDate) {
+				//查上个月
+				var date = new Date();
+				var monthN = date.getMonth() ;
+			
+				var year = date.getFullYear();
+				if (monthN==0) {
+					monthN = 12 ;
+					year=year-1
+				}
+				if (monthN >= 1 && monthN <= 9) {
+					monthN = "0" + monthN;
+				}
+			
+				var startDate = year + '-' + monthN + '-' + '01';
+				
+				
+				
+				
+			
+				API_index.chargingRecordData({
+					pageIndex: 1,
+					pageSize: 999,
+					startDate: startDate,
+					 endDate: endDate
+				}).then((res) => {
+			
+			
+					var chargeList = res.data.data;
+					var num1 = 0;
+					var num2 = 0;
+					for (var i in chargeList) {
+						var obj = chargeList[i]
+						if (obj.status == 2&&obj.entAccountId==null ) {
+							num1 += obj.electricQuantity
+							num2 += obj.totalServiceMoney
+						}
+					}
+					this.carImg3span3 = parseInt(num1 / 10000);
+					this.carImg3span4 = parseInt(num2);
+			
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			getChargeList() {
-
+				//查本月
 				var date = new Date();
 				var monthN = date.getMonth() + 1;
 
@@ -260,8 +312,8 @@
 					monthN2 = "0" + monthN2;
 				}
 				
-				this.startDate= year2 + '-' + monthN2 + '-' 
-
+				this.startDate= year2 + '-' + monthN2 + '-01' 
+				this.getChargeList2(startDate)//查上个月
 				API_index.chargingRecordData({
 					pageIndex: 1,
 					pageSize: 999,