|
@@ -24,10 +24,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="chargeImg">
|
|
|
- <img v-if="item.status==0" src="static/img/charge0.png" alt="">
|
|
|
- <img v-if="item.status==1" src="static/img/charge1.png" alt="">
|
|
|
- <img v-if="item.status==2" src="static/img/charge2.png" alt="">
|
|
|
- <img v-if="item.status==3" src="static/img/charge3.png" alt="">
|
|
|
+ <img v-if="item.status==0" src="static/img/charge-0.png" alt="">
|
|
|
+ <img v-if="item.status==1" src="static/img/charge-1.png" alt="">
|
|
|
+ <img v-if="item.status==2" src="static/img/charge-2.png" alt="">
|
|
|
+ <img v-if="item.status==3" src="static/img/charge-3.png" alt="">
|
|
|
<div class="JPTIME JPTIME1" v-if="item.status==0||item.status==3" v-text="showtime[i]"></div>
|
|
|
|
|
|
</view>
|
|
@@ -139,6 +139,7 @@
|
|
|
//如果是扫码 ,或者登陆进来的, 并且没有充电,就跳转到充电页面 k= null
|
|
|
//如果是在系统内部访问的, k=1 不跳转;
|
|
|
}
|
|
|
+
|
|
|
if(op.id){
|
|
|
this.id=op.id;
|
|
|
}
|
|
@@ -173,8 +174,7 @@
|
|
|
var Hour = parseInt(Math.floor(ms / (60 )));
|
|
|
var Fen = parseInt(Math.floor(ms %60 ));
|
|
|
this.showtime[i]=(Hour>9?"":"0")+Hour+":"+(Fen>9?"":"0")+Fen
|
|
|
-
|
|
|
- console.log(ms)
|
|
|
+
|
|
|
}else{
|
|
|
this.showtime[i]="00:00";
|
|
|
}
|
|
@@ -189,7 +189,7 @@
|
|
|
|
|
|
}
|
|
|
if(item.status==1){
|
|
|
- var now=new Date();
|
|
|
+
|
|
|
var second=secondsDistance(item.startTime);
|
|
|
if(second>0){
|
|
|
|
|
@@ -281,16 +281,31 @@
|
|
|
}else{
|
|
|
uni.hideLoading()
|
|
|
}
|
|
|
- if(this.list.length>0&&this.setTimeoutId==""){
|
|
|
- for(var i in this.list){
|
|
|
- var item=this.list[i];
|
|
|
- if(item.status==0||item.status==3){
|
|
|
- this.setTimeoutId=setTimeout(()=>{
|
|
|
- this.setTimeoutId="";
|
|
|
- this.f5()
|
|
|
- },5*1000)
|
|
|
+ if(this.list.length>0){
|
|
|
+ //防止定时器重复调用
|
|
|
+ if(this.setTimeoutId==""){
|
|
|
+ for(var i in this.list){
|
|
|
+ var item=this.list[i];
|
|
|
+
|
|
|
+ if(item.status==0||item.status==3){
|
|
|
+ this.setTimeoutId=setTimeout(()=>{
|
|
|
+ this.setTimeoutId="";
|
|
|
+ this.f5()
|
|
|
+ },5*1000)
|
|
|
+ }else if(item.status==1&&item.startTime){
|
|
|
+ var second=secondsDistance(item.startTime);
|
|
|
+ var ms=item.estimateMinute*60-second
|
|
|
+ if(ms<60*10){
|
|
|
+ this.setTimeoutId=setTimeout(()=>{
|
|
|
+ this.setTimeoutId="";
|
|
|
+ this.f5()
|
|
|
+ },5*1000)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ this.setTimeoutId=""
|
|
|
}
|
|
|
|
|
|
}).catch(error => {
|
|
@@ -300,7 +315,7 @@
|
|
|
})
|
|
|
},
|
|
|
f5(bl) {
|
|
|
- console.log("f5")
|
|
|
+
|
|
|
if(bl){
|
|
|
uni.showLoading({
|
|
|
title: "加载中",
|