zhengkaixin 3 лет назад
Родитель
Сommit
a14232b84b
2 измененных файлов с 47 добавлено и 14 удалено
  1. 8 2
      pages/index/index.vue
  2. 39 12
      pages/searchPile/chargeProcess/dcCharging.vue

+ 8 - 2
pages/index/index.vue

@@ -3,7 +3,7 @@
 
 		<!-- 头部图片 -->
 		<view class="banner">
-			<img src="static/img/banner1.jpg" alt="">
+			<img :src="indexLogo?indexLogo:'static/img/banner1.jpg'" alt="">
 		</view>
 
 
@@ -185,7 +185,7 @@
 			<view class="news-content" v-for="(item,index) in newsList" :key="item.id" @click="gotoUrl('pages/article/articleDetails?id=' + item.id)">
 				<view class="content-text">
 					{{item.title}}
-					<view class="news-time">{{item.createTime.slice(5)}}</view>
+					<view class="news-time">{{item.createTime?item.createTime.slice(5):''}}</view>
 				</view>
 				<view class="content-img">
 					<img :src="item.pic" alt="">
@@ -234,9 +234,15 @@
 				longitude: '',
 				latitude: '',
 				message: '',
+				indexLogo:''
 			}
 		},
 		onLoad(op) {
+			var  indexLogo=this.carhelp.getConfig().indexLogo
+			// img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"		
+			if(indexLogo){
+				this.indexLogo=indexLogo;
+ 			}
 			if(op.jpcode){
 				var k=API.codeOperation(op.jpcode);
 				if(k){

+ 39 - 12
pages/searchPile/chargeProcess/dcCharging.vue

@@ -4,16 +4,16 @@
 			<u-navbar title="充电结束">
 			</u-navbar>
 			<view class="progress-bar2">
-				<u-circle-progress width="400" active-color="green" :percent="50" border-width="20">
+				<u-circle-progress width="400" active-color="green" :percent="100" border-width="20">
 					<view class="u-progress-content">
 						<!-- <view class="u-progress-dot"></view> -->
 						<text class='u-progress-info' v-if="chargingGun.gunType==1">
-							50%
+							{{chargingRecord.endSoc}}
 							<p class="progress-text">当前电量</p>
 						</text>
 						
 						<text class='u-progress-info' v-if="chargingGun.gunType==2">
-							20.000
+							{{chargingRecord.electricQuantity/10000}}
 							<p class="progress-text">已充电量(度)</p>
 						</text>
 						
@@ -26,7 +26,7 @@
 			<view class="time-price">
 				<view class="item">
 					<view class="item-num">
-						00:20:00
+						{{getPercent2()}}
 					</view>
 					<view class="item-text">
 						充电时长
@@ -34,7 +34,7 @@
 				</view>
 				<view class="item">
 					<view class="item-num">
-						20:00
+						{{chargingRecord.actualFee}}
 					</view>
 					<view class="item-text">
 						充电金额
@@ -42,8 +42,8 @@
 				</view>
 			</view>
 			<view class="bottom">
-				<u-button size="default" shape="circle">返回首页</u-button>
-				<u-button size="default" shape="circle">查看订单详情</u-button>
+				<u-button size="default" shape="circle" @click="gotoMain(0)"  >返回首页</u-button>
+				<u-button size="default" shape="circle" @click="gotoMain(1)">查看订单详情</u-button>
 			</view>
 		</view>
 
@@ -152,8 +152,10 @@
 					停止充电后30分钟即开始收取占位费用,1元/分钟
 				</view>
 			</view>
-			<view class="bottom2" @click="submit">
-				<u-button type="primary" shape="circle" >结束充电</u-button>
+			<view class="bottom2">
+				<u-button type="primary"  @click="submit"
+				 :style="chargingRecord.status==1?'':'background-color: #9be6c2;'"
+				 shape="circle" >结束充电</u-button>
 			</view>
 
 			<u-modal v-model="show" @confirm="confirmPhone" :confirm-text="confirmText" confirm-color="#606266"
@@ -204,6 +206,18 @@
 			this.addpercent()
 		},
 		methods: {
+			gotoMain(i){
+				if(i==0){
+					uni.reLaunch({
+						url:"/pages/index/index"
+					})
+				}
+				if(i==1){
+					uni.redirectTo({
+						url:"/pages/record/details?id="+this.id
+					})
+				}
+			},
 			addpercent(){
 				
 				if(this.percent==0){
@@ -216,6 +230,18 @@
 					},100)
 				}
 			},
+			getPercent2() {
+				var ms=this.chargingRecord.chargingMinute*60;
+				
+				var Hour = parseInt(Math.floor(ms / (60 * 60)));
+				var Fen = parseInt(Math.floor(ms % (60 * 60) / 60));
+				var S = parseInt(Math.floor(ms % (60) ));
+				
+				var obj = (Hour > 9 ? "" : "0") + Hour + ":" + (Fen > 9 ? "" : "0") + Fen+ ":" + (S > 9 ? "" : "0") + S
+				 
+			
+				return obj;
+			},
 			getPercent() {
 				var ms=this.chargingGun.chargeTimeSec;
 				
@@ -286,6 +312,9 @@
 				})
 			},
 			submit() {
+				if(this.chargingRecord.status!=1){
+					return
+				}
 				uni.showModal({
 					title: '提示',
 					content: '确认结束充电?',
@@ -500,9 +529,7 @@
 		right: 0;
 		margin: auto;
 
-		.u-btn--primary {
-			background-color: #9be6c2;
-		}
+		 
 	}