瀏覽代碼

优化处理

zhengkaixin 1 年之前
父節點
當前提交
99a34837a1

二進制
assets/img/9-4/月卡价格.png


+ 1 - 1
pages/index/index.vue

@@ -1268,7 +1268,7 @@
 					} else {
 						
 						if (!this.carhelp.get("getElderModeClass")) {
-							this.carhelp.set("getElderModeClass", "长辈模式");
+							this.carhelp.set("getElderModeClass", "标准模式");
 						}
 						
 						this.elderStatus = true;

+ 86 - 2
pages/searchPile/searchPile.vue

@@ -263,7 +263,7 @@
 										</text>
 									</view>
 									
-									<view class="price-3 "  v-if="item.tagList&&item.tagList.length&&item.tagList.indexOf('6折卡')>-1">
+									<view class="price-3 "  v-if="prevMonthKwhBL&&item.tagList&&item.tagList.length&&(item.tagList.indexOf('6折卡')>-1||item.tagList.indexOf('月卡')>-1||item.tagList.indexOf('自营站')>-1)">
 										<view class="num1">
 											
 											<img  src="@/assets/img/9-4/6折卡价.svg" />
@@ -273,6 +273,16 @@
 											class="num">{{ (item.electricityPrice+(item.servicePrice*0.6)).toFixed(2)}}元/度</text>
 										
 									</view>
+									<view class="price-3 price-3-yue "  v-if="!prevMonthKwhBL&&item.tagList&&item.tagList.length&&(item.tagList.indexOf('6折卡')>-1||item.tagList.indexOf('月卡')>-1||item.tagList.indexOf('自营站')>-1)">
+										<view class="num1">
+											
+											<img  src="@/assets/img/9-4/月卡价格.png" />
+											
+										</view>
+										<text
+											class="num">{{ (item.electricityPrice).toFixed(2)}}元/度</text>
+										
+									</view>
 								</view>
 								<!-- 游客价格-->
 								<view class="price" v-else>
@@ -436,7 +446,10 @@
 
 	import uniCombox from '@/components/uni-combox/components/uni-combox/uni-combox.vue'
 	import * as WxJsApi from '@/utils/wxJsApi.js'
-
+import {
+		newDate,parseUnixTime
+		
+	} from '@/utils'
 	export default {
 		components: {
 			Chargermap,
@@ -559,6 +572,8 @@
 				pointTimeOut: true,
 				dropdownShow: false,
 				currentIndex: 0,
+				carImg3span1:0,
+				carImg3span2:0,
 
 			}
 		},
@@ -608,8 +623,74 @@
 				this.personInfo = this.carhelp.getPersonInfo();
 			}
 			this.getPointTimeOut();
+			this.getChargeList()
+		},
+		computed: {
+			prevMonthKwhBL(){
+				if(this.carImg3span1>=1000){
+					return false
+				}
+				return true
+			},
 		},
 		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({
+					pageIndex: 1,
+					pageSize:999,
+					startDate: startDate,
+					// endDate: this.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){
+							num1+=obj.electricQuantity
+							num2+=obj.totalServiceMoney
+						}
+					}
+					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;
+					// }else{
+					// 	this.carImg4Bl=true;
+					// }
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			
 			navigate() {
 				//('naviage to ')
 				uni.navigateTo({
@@ -1409,6 +1490,9 @@
 				
 			}
 		}
+		.price-3-yue{
+			background: linear-gradient(88.81deg, rgba(219,199,167,1) 1.89%,rgba(194,154,93,1) 98%);
+		}
 		
 	}
 

+ 36 - 13
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -142,7 +142,7 @@
 					</view>
 					<view v-if="price" class="priceListBlMain">
 
-						<view class="price-3-card-view " v-if="userCardBool&&userCard.classify==2">
+						<view class="price-3-card-view " v-if="personInfo&&personInfo.userType==2&&(userCardBool&&userCard.classify==2||(!userCardBool&&prevMonthKwhBL))">
 							<view class="price">
 
 								<text class="span">{{price.costPrice.toFixed(2)}}</text><text class="unit">元/度</text>
@@ -161,8 +161,26 @@
 
 							</view>
 						</view>
-
-						<view class="price" v-else-if="personInfo&&personInfo.userType==2">
+						<view class="price-3-card-view " v-else-if="personInfo&&personInfo.userType==2&&((userCardBool&&userCard.classify==1)||(!userCardBool&&!prevMonthKwhBL))">
+							<view class="price">
+						
+								<text class="span">{{price.costPrice.toFixed(2)}}</text><text class="unit">元/度</text>
+						
+							</view>
+							<view class="price-3-card price-3-card-yue ">
+						
+						
+								<view class="num1">
+						
+									<img src="@/assets/img/9-4/月卡价格.png" />
+						
+								</view>
+								<text
+									class="num">{{ (price.electricityPrice).toFixed(2)}}元/度</text>
+						
+							</view>
+						</view>
+						<view class="price" v-else-if="false&&personInfo&&personInfo.userType==2">
 
 							<text class="span">{{price.costPrice.toFixed(2)}}</text><text class="unit">元/度</text>
 							<text class="unit"
@@ -1049,15 +1067,16 @@
 					
 					var num1=parseInt(obj.electricQuantity);
 					var num2=parseInt(obj.totalServiceMoney) ;
+					this.carImg3span1=parseInt(num1/10000);
+					this.carImg3span2=parseInt(num2*0.4) ;
+					this.carImg3span3=parseInt(num2) ;
+					if(num2*0.4>20||this.carImg3span1>=1000){
 					
-					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
 				}
@@ -1078,7 +1097,7 @@
 					var num2=0;
 					for(var i in chargeList){
 						var obj=chargeList[i]
-						if(obj.status==2&&obj.userCardId==null&&obj.entAccountId==null){
+						if(obj.status==2){
 							num1+=obj.electricQuantity
 							num2+=obj.totalServiceMoney
 						}
@@ -1089,11 +1108,11 @@
 						electricQuantity:num1,
 						totalServiceMoney:num2
 					})
-					
-					if(num2*0.4>20){
-						this.carImg3span1=parseInt(num1/10000);
-						this.carImg3span2=parseInt(num2*0.4) ;
-						this.carImg3span3=parseInt(num2) ;
+					this.carImg3span1=parseInt(num1/10000);
+					this.carImg3span2=parseInt(num2*0.4) ;
+					this.carImg3span3=parseInt(num2) ;
+					if(num2*0.4>20||this.carImg3span1>=1000){
+						
 						this.carImg3Bl=true;
 					}else{
 						this.carImg4Bl=true;
@@ -1881,6 +1900,10 @@
 						align-items: center;
 
 					}
+				}
+				.price-3-card-yue{
+					background: linear-gradient(88.81deg, rgba(219,199,167,1) 1.89%,rgba(194,154,93,1) 98%);
+					
 				}
 			}
 

+ 12 - 5
pages/searchPile/stationAndPile/stationDetails.vue

@@ -425,7 +425,10 @@
 						</view>
 					</view>
 				</view>
-				<view class="classify" v-else-if="stationDetail.station&&stationDetail.station.tagList&&(stationDetail.station.tagList.indexOf('月卡')!=-1||stationDetail.station.tagList.indexOf('包月卡')!=-1)"  >
+				<view class="classify" v-else-if="stationDetail.station&&stationDetail.station.tagList&&
+				(stationDetail.station.tagList.indexOf('月卡')!=-1
+				||stationDetail.station.tagList.indexOf('6折卡')!=-1
+				||stationDetail.station.tagList.indexOf('自营站')!=-1)"  >
 					
 				
 					<view class="item item-member-vip">
@@ -847,8 +850,12 @@
 					}
 				}, 5 * 1000)
 			}
+			if (this.carhelp.getPersonInfo()) {
+				
+				this.getHomePage()
 			
-			this.getHomePage()
+			}
+			//this.getHomePage()
 		},
 		onUnload() {
 			if (this.uuid) {
@@ -875,7 +882,7 @@
 				this.userId = this.carhelp.getPersonInfo().id;
 				this.personInfo = this.carhelp.getPersonInfo()
 				//this.userCard = this.carhelp.getPersonInfoPlus().userCard
-				
+				this.getHomePage()
 
 			}
 			WxJsApi.getWxConfig(['getLocation', 'openLocation', 'addEventListener', 'scanQRCode']).then((res) => {
@@ -993,7 +1000,7 @@
 					var num2=0;
 					for(var i in chargeList){
 						var obj=chargeList[i]
-						if(obj.status==2&&obj.userCardId==null&&obj.entAccountId==null){
+						if(obj.status==2){
 							num1+=obj.electricQuantity
 							num2+=obj.totalServiceMoney
 						}
@@ -1124,7 +1131,7 @@
 				this.flag = !this.flag
 			},
 			enableAppointmentBl(item) {
-				if(this.personInfo.memberLevel!=3){
+				if(!this.personInfo||this.personInfo.memberLevel!=3){
 					return  true
 				}
 				

+ 3 - 3
pages/user/index.vue

@@ -438,7 +438,7 @@
 					},
 				],
 				// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
-				value: '长辈模式',
+				value: '标准模式',
 				
 				show1: false,
 				show2: false,
@@ -1001,9 +1001,9 @@
 					    justify-content: space-evenly;
 						align-content: center;
 					width: 188rpx;
-					height: 72rpx;
+					//height: 72rpx;
 					text-align: center;
-					//padding:12rpx 0;
+					padding-top:4rpx ;
 				}
 				.rightTextA{
 					background: linear-gradient(134.91deg, rgba(220,232,255,1) 29.61%,rgba(176,202,255,1) 99.85%);

+ 29 - 26
pages/user/member/member.vue

@@ -231,7 +231,32 @@
 		onReady() {
 			this.personInfo = this.carhelp.getPersonInfo()
 			this.uCurrent=this.personInfo.memberLevel-1
-			this.getChargeList()//本月
+			//this.getChargeList()//本月
+			
+			var date = new Date();
+			var monthN = date.getMonth() + 1;
+			
+			var year = date.getFullYear();
+			
+			if (monthN >= 1 && monthN <= 9) {
+				monthN = "0" + monthN;
+			}
+			
+			var startDate = year + '-' + monthN + '-' + '01';
+			
+			var monthN2 = date.getMonth() + 2;
+			
+			var year2 = date.getFullYear();
+			if(monthN2==13){
+				monthN2=1
+				year2+=1;
+			}
+			if (monthN2 >= 1 && monthN2 <= 9) {
+				monthN2 = "0" + monthN2;
+			}
+			this.carImg3span1 =parseInt( this.personInfo.curMonthKwh)
+			this.carImg3span3 =parseInt(this.personInfo.prevMonthKwh)
+			this.startDate= year2 + '-' + monthN2 + '-01' 
 			
 		},
 		methods: {
@@ -272,7 +297,7 @@
 					var num2 = 0;
 					for (var i in chargeList) {
 						var obj = chargeList[i]
-						if (obj.status == 2&&obj.entAccountId==null ) {
+						if (obj.status == 2 ) {
 							num1 += obj.electricQuantity
 							num2 += obj.totalServiceMoney
 						}
@@ -290,29 +315,7 @@
 			},
 			getChargeList() {
 				//查本月
-				var date = new Date();
-				var monthN = date.getMonth() + 1;
-
-				var year = date.getFullYear();
-
-				if (monthN >= 1 && monthN <= 9) {
-					monthN = "0" + monthN;
-				}
-
-				var startDate = year + '-' + monthN + '-' + '01';
-				
-				var monthN2 = date.getMonth() + 2;
-				
-				var year2 = date.getFullYear();
-				if(monthN2==13){
-					monthN2=1
-					year2+=1;
-				}
-				if (monthN2 >= 1 && monthN2 <= 9) {
-					monthN2 = "0" + monthN2;
-				}
-				
-				this.startDate= year2 + '-' + monthN2 + '-01' 
+				
 				this.getChargeList2(startDate)//查上个月
 				API_index.chargingRecordData({
 					pageIndex: 1,
@@ -327,7 +330,7 @@
 					var num2 = 0;
 					for (var i in chargeList) {
 						var obj = chargeList[i]
-						if (obj.status == 2&&obj.entAccountId==null ) {
+						if (obj.status == 2 ) {
 							num1 += obj.electricQuantity
 							num2 += obj.totalServiceMoney
 						}