Browse Source

月前30天

zhengkaixin 1 year ago
parent
commit
940d1feb61

+ 6 - 0
assets/img/9-4/antFill-crown.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="64 64 896 896" width="117" height="117" style="border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
+    <defs><linearGradient id="1,1,rs,1,f0dwf000,f0dwf0rs,f000,00rspeggcs,m8rsougs0a" x1="0" x2="100%" y1="0" y2="0" gradientTransform="matrix(6.123233995736766e-17, 1, -1, 6.123233995736766e-17, 448, 0)" gradientUnits="userSpaceOnUse"><stop stop-color="#ffe997" stop-opacity="0.46" offset="0"></stop><stop stop-color="#ffe49a" stop-opacity="0.01" offset="0.8"></stop></linearGradient></defs>
+    <g>
+    <path d="M899.6 276.5L705 396.4 518.4 147.5a8.06 8.06 0 0 0-12.9 0L319 396.4 124.3 276.5c-5.7-3.5-13.1 1.2-12.2 7.9L188.5 865c1.1 7.9 7.9 14 16 14h615.1c8 0 14.9-6 15.9-14l76.4-580.6c.8-6.7-6.5-11.4-12.3-7.9zM512 734.2c-62.1 0-112.6-50.5-112.6-112.6S449.9 509 512 509s112.6 50.5 112.6 112.6S574.1 734.2 512 734.2zm0-160.9c-26.6 0-48.2 21.6-48.2 48.3 0 26.6 21.6 48.3 48.2 48.3s48.2-21.6 48.2-48.3c0-26.6-21.6-48.3-48.2-48.3z" fill="url(#1,1,rs,1,f0dwf000,f0dwf0rs,f000,00rspeggcs,m8rsougs0a)"></path>
+    </g>
+  </svg>

+ 9 - 2
pages/searchPile/chargeProcess/dcCharging.vue

@@ -1053,9 +1053,16 @@
 				// uni.showLoading({
 				// 	title: "加载中",
 				// 	mask: true,
-				// })
+				// })
+				var electricQuantity=0;
+				var obj=this.carhelp.get("carhelp_getChargeList")
+				if(obj){
+					electricQuantity=parseInt( obj.electricQuantity/10000)
+				}
+				
 				API.chargingDetail({
-					id: this.id
+					id: this.id,
+					chargingKwh:electricQuantity
 				}).then((res) => {
 					this.showChargingTag = res.data.showChargingTag
 					this.chargingTagUrl = res.data.chargingTagUrl

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

@@ -275,8 +275,11 @@
 			<view class="carImg" v-if="personInfo&&personInfo.userType!=2">
 					<img @click="gotoLogin" src="@/assets/img/gologin/img.png">
 			</view>
-			<view class="carImg3" v-else-if="carImg3Bl&&!userCardBool">
-				<view class="carImg2" >
+			<view class="carImg3"  :class="{
+				'carImg3-yue':!prevMonthKwhBL
+			}"
+			 v-else-if="carImg3Bl&&!userCardBool">
+				<view class="carImg2" v-if="prevMonthKwhBL" >
 					
 			
 					<view>
@@ -286,7 +289,18 @@
 							<span>点击购买</span>
 						</view>
 					</view>
-					</view>
+					</view>
+					<view class="carImg2-yue" v-if="!prevMonthKwhBL" >
+						
+								
+						<view>
+							<view class="carImg-1">您近30天已充电{{carImg3span1}}度</view>
+							<view  class="carImg-2">如购买月卡,可省约<span>{{carImg3span3}}</span>元</view>
+							<view  class="carImg-3" @click="gotoUrl('pages/monthlyCardActivity/monthlyCardBuy')">
+								<span>点击购买</span>
+							</view>
+						</view>
+						</view>
 			
 			</view>
 			
@@ -625,7 +639,7 @@
 				carImg4Bl:false,
 				carImg3span1:0,
 				carImg3span2:0,
-				
+				carImg3span3:0,
 				pricesInfoCurrent: {},
 				pricesInfoCurrent2: {},
 				show3: false,
@@ -694,7 +708,13 @@
 			}
 		},
 
-		computed: {
+		computed: {
+			prevMonthKwhBL(){
+				if(this.carImg3span1>=1000){
+					return false
+				}
+				return true
+			},
 			openBool() {
 				if (this.openStatus == '3') {
 					return this.isVip
@@ -1022,7 +1042,27 @@
 				}
 				return true;
 			},
-			getChargeList(){
+			getChargeList(){
+				var obj=this.carhelp.get("carhelp_getChargeList")
+				var time=new Date( ).toLocaleString().substr(0,12).replace("T"," ");
+				if(obj&&time==obj.time){
+					
+					var num1=parseInt(obj.electricQuantity);
+					var num2=parseInt(obj.totalServiceMoney) ;
+					
+					if(num2*0.4>20){
+						this.carImg3span1=parseInt(num1/10000);
+						this.carImg3span2=parseInt(num2*0.4) ;
+						this.carImg3span3=parseInt(num2) ;
+						this.carImg3Bl=true;
+					}else{
+						this.carImg4Bl=true;
+					}
+					console.log("carhelp_getChargeList",this.carImg3span1,this.carImg3span2)
+					return
+				}
+				
+				
 				var date =new Date().getTime()-30*1000*60*60*24;
 				var startDate =parseUnixTime(new Date(date),'{y}-{m}-{d}');
 				API_index.chargingRecordData({
@@ -1043,10 +1083,17 @@
 							num2+=obj.totalServiceMoney
 						}
 					}
-					console.log(num1,num2)
+					console.log(num1,num2)
+					this.carhelp.set("carhelp_getChargeList",{
+						time: time,
+						electricQuantity:num1,
+						totalServiceMoney:num2
+					})
+					
 					if(num2*0.4>20){
 						this.carImg3span1=parseInt(num1/10000);
-						this.carImg3span2=parseInt(num2*0.4) ;
+						this.carImg3span2=parseInt(num2*0.4) ;
+						this.carImg3span3=parseInt(num2) ;
 						this.carImg3Bl=true;
 					}else{
 						this.carImg4Bl=true;
@@ -2026,7 +2073,44 @@
 		margin: 0 40rpx;
 		background: linear-gradient(32.4deg, rgba(59,182,254,1) 20.49%,rgba(0,185,98,1) 118.87%);
 		border-radius: 8px;
-	}
+	}
+	.carImg3-yue {
+			margin: 0 40rpx;
+			background: linear-gradient(88.81deg, rgba(219,199,167,1) 1.89%,rgba(194,154,93,1) 98%);
+			border-radius: 8px;
+		}
+	.carImg2-yue {
+			line-height: 20px;
+			color: rgba(255, 255, 255, 1);
+			font-size: 32rpx;
+			padding:40rpx;
+			//background: linear-gradient(88.81deg, rgba(219,199,167,1) 1.89%,rgba(194,154,93,1) 98%);
+			background: url('../../../assets/img/9-4/antFill-crown.svg');
+			background-repeat: repeat-y;
+			background-position-x: 440rpx;
+			.carImg-2{
+				span{
+					font-size: 48rpx;
+					color:red;
+					margin: 0 4rpx;
+					font-weight: bold;
+					padding:0rpx 4rpx;
+				}
+			}
+			.carImg-3{
+				margin-top:8rpx ;
+				span{
+					
+					padding:8rpx 16rpx;
+					border-radius: 12px;
+					background-color: rgba(255, 255, 255, 1);
+					text-align: center;
+					color: #795626 ;
+					font-size: 12px;
+				}
+			}
+			
+		}
 	.carImg2 {
 		line-height: 20px;
 		color: rgba(255, 255, 255, 1);
@@ -2039,7 +2123,10 @@
 			span{
 				font-size: 48rpx;
 				color:red;
-				margin: 0 4rpx;
+				margin: 0 4rpx;
+				
+				font-weight: bold;
+				padding:0rpx 4rpx;
 			}
 		}
 		.carImg-3{

+ 22 - 4
pages/searchPile/stationAndPile/stationDetails.vue

@@ -887,10 +887,8 @@
 		},
 		computed: {
 			prevMonthKwhBL(){
-				if(this.personInfo){
-					if(this.personInfo.prevMonthKwh>=1000){
-						return false
-					}
+				if(this.carImg3span1>=1000){
+					return false
 				}
 				return true
 			},
@@ -970,6 +968,16 @@
 		},
 		methods: {
 			getChargeList(){
+				var obj=this.carhelp.get("carhelp_getChargeList")
+				var time=new Date( ).toLocaleString().substr(0,12).replace("T"," ");
+				if(obj&&time==obj.time){
+					
+					this.carImg3span1=parseInt(obj.electricQuantity);
+					this.carImg3span2=parseInt(obj.totalServiceMoney) ;
+					console.log("carhelp_getChargeList",this.carImg3span1,this.carImg3span2)
+					return
+				}
+				
 				var date =new Date().getTime()-30*1000*60*60*24;
 				var startDate =parseUnixTime(new Date(date),'{y}-{m}-{d}');
 				indexAPI.chargingRecordData({
@@ -993,6 +1001,13 @@
 					console.log(num1,num2)
 					this.carImg3span1=parseInt(num1);
 					this.carImg3span2=parseInt(num2) ;
+					
+					this.carhelp.set("carhelp_getChargeList",{
+						time: time,
+						electricQuantity:num1,
+						totalServiceMoney:num2
+					})
+					
 					// if(num2*0.4>20){
 					
 					// 	this.carImg3Bl=true;
@@ -1025,6 +1040,9 @@
 					// 	this.userCard=res.data.regUserCard
 					// }
 					uni.hideLoading()
+					if(!this.userCardBool&&!this.carImg3span1){
+						this.getChargeList()
+					}
 					
 					
 				}).catch(error => {