zhengkaixin před 3 roky
rodič
revize
756dc05e64

+ 5 - 0
pages/record/details.vue

@@ -14,6 +14,8 @@
 			</view>
 			<view class="details-row"><p>电费(元)</p><span>¥{{chargeDetail.totalElecMoney != null ? chargeDetail.totalElecMoney : '0.00'}}</span></view>
 			<view class="details-row"><p>服务费(元)</p><span>¥{{chargeDetail.totalServiceMoney != null ? chargeDetail.totalServiceMoney : '0.00'}}</span></view>
+		<view class="details-row"><p>优惠券抵扣(元)</p><span style="color:red">{{userCouponObj? userCouponObj.text : '未使用'}}</span></view>
+		
 		</view>
 		<view class="details">
 			<view class="details-title">
@@ -48,6 +50,7 @@
 			return {
 				id: '',
 				chargeDetail: {},
+				userCouponObj:{},
 			}
 		},
 		onLoad(op) {
@@ -71,6 +74,8 @@
 					uni.hideLoading();
 					
 					this.chargeDetail = res.data.chargingRecord;
+					this.userCouponObj = res.data.userCoupon;
+					
 				}).catch(error => {
 					uni.showToast({
 						title: error,

+ 48 - 18
pages/searchPile/chargeProcess/charge.vue

@@ -40,16 +40,17 @@
 					</span>
 				</view>
 				<view class="select">
-					<u-radio-group v-model="value" @change="radioGroupChange" :wrap="true">
-						
-						<u-radio @change="radioChange" v-for="(item, index) in list" :key="index" :name="item.name"
-							:style="item.disabled?'	background-color: #e3e3e3 !important;':''"
-							:disabled="item.disabled">
-							{{item.name}}
-
-						</u-radio>
-						 
-						<view class="explain">使用说明</view>
+					<u-radio-group v-model="value" :wrap="true">
+						<template v-for="(item, index) in list" >
+							<u-radio @change="radioChange" :key="index" :name="item.id"
+								:style="item.chooseStatus==0?'	background-color: #e3e3e3 !important;':''"
+								:disabled="item.chooseStatus==0">
+								满{{item.threshold}}元减{{item.value}}元
+								<view class="explain" @click="gotoUrl('pages/user/coupon/couponDetails?id='+item.id)" :key="index" >使用说明</view>
+
+							</u-radio>
+							 
+						</template>
 					</u-radio-group>
 
 				</view>
@@ -155,25 +156,30 @@
 					this.$nextTick(() => {
 						this.otherNum = '';
 					})
-
+					
 				}
 				if (t > 500) {
 					this.$nextTick(() => {
 						this.otherNum = 500;
 					})
-
-				}
+				
+				}
+				this.useCoupon()
 
 			},
-			moneyClick(index) {
+			moneyClick(index) {
+				this.otherNum = ''
 				this.moneyActiveClass = index;
 				this.useCoupon()
 
-			},
+			},
+			radioChange(e){},
 			confirm() {
 
 				//console.log(JSON.stringify(this.submitForm))
-
+				if(this.value){
+					this.submitForm.userCouponId=this.value
+				}
 
 				uni.showLoading({
 					title: "加载中",
@@ -233,10 +239,34 @@
 				})
 				 	this.submitInit()
 				API.useCoupon({
-					amount:this.submitForm.amount
+					amount:this.submitForm.amount?this.submitForm.amount:''
 				}).then((res) => {
 					
 					this.list=res.data.userCouponList
+					for(var i in this.list){
+						var obj=this.list[i]
+						if(obj.id==this.value){
+							if(obj.chooseStatus==1){
+								
+							}else{
+								this.value=''
+							}
+						}
+					}
+					for(var i in this.list){
+						if(this.value==''){
+							var obj=this.list[i]
+							if(obj.chooseStatus==1){
+								this.value=obj.id
+								break
+							}
+							
+						}else{
+							break
+						}
+					}
+					
+					
 					uni.hideLoading()
 					
 				}).catch(error => {
@@ -477,7 +507,7 @@
 			height: 24px;
 			line-height: 24px;
 			position: absolute;
-			top: 24px;
+			top: 10px;
 			right: 12px;
 			border-radius: 4px;
 			background-color: rgba(255, 255, 255, 100);

+ 72 - 35
pages/searchPile/chargeProcess/dcCharging.vue

@@ -23,33 +23,43 @@
 				</u-circle-progress>
 			</view>
 
-			<view class="time-price">
-				<view class="item">
-					<view class="item-num">
-						{{getPercent2()}}
-					</view>
-					<view class=" item-text ">
-						充电时长
-					</view>
-				</view>
-				<view class="item">
-					<view class="item-num">
-						{{chargingRecord.actualFee}}元
-					</view>
-					<view class="item-text">
-						充电金额
-					</view>
+			<view class="">
+				<view class="info" >
+					<view class="info-name">
+						充电时长
+					</view>
+					<view class="info-text">
+						{{getPercent2()}}
+					</view>
+				</view>
+				<view class="info" >
+					<view class="info-name">
+						充电金额
+					</view>
+					<view class="info-text">
+						{{chargingRecord.actualFee}}元
+					</view>
+				</view>
+				<view class="info"  >
+					<view class="info-name">
+						优惠券
+					</view>
+					<view class="info-text" style="color:red">
+						{{couponObj&&couponObj.status=='1'?couponObj.text:'未使用'}}
+					</view>
+				</view>
+				<view class="info" v-if="chargingRecord.remark">
+					<view class="info-name">
+						结束原因
+					</view>
+					<view class="info-text">
+						{{chargingRecord.remark}}
+					</view>
 				</view>
+				
 			</view>
 			
-			<view 
-			 v-if="chargingRecord.remark"
-			style="
-				margin-top: 20px;
-				text-align: center;
-			">
-				结束原因:{{chargingRecord.remark}}
-			</view>
+			
 			<view
 			
 			style="
@@ -152,8 +162,16 @@
 						电流
 					</view>
 				</view>
+			</view>
+			<view class="info" >
+				<view class="info-name">
+					优惠券
+				</view>
+				<view class="info-text" style="color:red">
+					{{couponObj&&couponObj.useText?couponObj.useText:'未使用'}}
+				</view>
 			</view>
-			<view class="info">
+			<view class="info" v-if="chargingRecord.carNumber">
 				<view class="info-name">
 					充电车辆
 				</view>
@@ -166,8 +184,17 @@
 					站点
 				</view>
 				<view class="info-text">
-					{{chargingRecord.stationName}} / {{chargingRecord.deviceNo}}
+					 {{chargingRecord.stationName}}
 				</view>
+			</view>
+			<view class="info">
+				<view class="info-name">
+					充电桩
+				</view>
+				<view class="info-text">
+					 {{chargingRecord.deviceName}}<br>
+					 {{chargingRecord.deviceNo}} 
+				</view>
 			</view>
 			<view class="info" v-if="false">
 				<view class="info-name">
@@ -227,7 +254,8 @@
 				consumerPhone: "",
 				id: "",
 				chargingGun: {},
-				chargingRecord: {},
+				chargingRecord: {},
+				couponObj:{},
 				show: false,
 				show2: false,
 				isReady:true,
@@ -274,7 +302,8 @@
 					})
 				}
 				if(i==1){
-					uni.redirectTo({
+					uni.navigateTo({
+					
 						url:"/pages/record/details?id="+this.id
 					})
 				}
@@ -304,6 +333,9 @@
 				return obj;
 			},
 			getPercent() {
+				if(!this.chargingRecord.startTime){
+					return '00:00:00'
+				}
 				var Hour=0;
 				var Fen=0;
 				var S=0;
@@ -367,9 +399,11 @@
 				// })
 				API.chargingDetail({
 					id: this.id
-				}).then((res) => {
-					this.chargingRecord = res.data.chargingRecord
-
+				}).then((res) => {
+					
+					this.chargingRecord = res.data.chargingRecord
+					console.log(this.chargingRecord)
+					this.couponObj= res.data.coupon
 					this.chargingGun = res.data.chargingGun
 					this.waitNum=res.data.chargingRecord.waitNum;
 					this.isReady = true;
@@ -562,8 +596,10 @@
 
 	.cost {
 		// width: 50%;
-		padding: 0 90px;
-		margin-top: 16px;
+		padding: 0 50px;
+		margin-top: 16px;
+		    margin: auto;
+		    width: 280px;
 		display: flex;
 		justify-content: space-between;
 
@@ -631,7 +667,7 @@
 		.info-text {
 			line-height: 23px;
 			padding: 13px 0 12px;
-			width: 200px;
+			//width: 200px;
 			text-align: right;
 		}
 	}
@@ -718,7 +754,8 @@
 		}
 	}
 
-	.bottom {
+	.bottom {
+		background-color: #fff;
 		display: flex;
 		width: 91.4%;
 		padding: 12px 16px;

+ 3 - 3
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -7,9 +7,9 @@
 			
 			<view class="main-detail">
 				<view class="detail-name">
-					充电编号
+					充电编号
 				</view>
-				<view class="detail-content" style="font-weight: 900;">{{detail.deviceNo}}</view>
+				<view class="detail-content" style="font-weight: 900;">{{gun.gunNo}}</view>
 			</view>
 			<view class="main-detail">
 				<view class="detail-name">
@@ -39,7 +39,7 @@
 						{{car.carNum}}
 					</view>
 					<view class="title-right" v-else>
-						<view style="color:#53b56b;font-weight: bold;"  @click="carDet">点击绑定</view>
+						<view style="color:#53b56b;font-weight: bold;"  @click="carDet">点击绑定></view>
 					</view>
 					
 				</view>

+ 2 - 2
pages/user/finance/recharge.vue

@@ -8,7 +8,7 @@
 				<view class="recharge-item" :class="!otherNum&&moneyActiveClass == item.id ? 'active' : ''"
 					v-for="(item,index) in moneyList" :key="item.id" @click="moneyClick(item.id,item)">
 					{{item.amountDesc?item.amountDesc:item.rechargeAmount+'元'}}
-					<view class="amount" v-if="item.giftAmount">{{item.giftAmount}}</view>
+					<view class="amount" v-if="item.amountRemark">{{item.amountRemark}}</view>
 					</view>
 				
 			</view>
@@ -373,7 +373,7 @@
 		height: 16px;
 		line-height: 15px;
 		border-radius: 0px 4px 0px 4px;
-		background-color: rgba(0, 185, 98, 100);
+		background-color: #ec4530;//rgba(0, 185, 98, 100)
 		color: rgba(255, 255, 255, 100);
 		font-size: 10px;
 		text-align: center;