XWookey 3 hónapja
szülő
commit
34ad36348c

+ 21 - 2
pages/scan_result/elpackage.js

@@ -26,7 +26,8 @@ Page({
     url:'/images/scan_result.png',
     authStatus: 1,
     defPlateNumber:'',
-    car_active: false
+    car_active: false,
+    hid:false
   },
 
   /**
@@ -54,7 +55,7 @@ Page({
             if(!key.currentSoc){
                 key.currentSoc = 0
             }
-            key['active'] = false
+            key['active'] = true
         })
 
 
@@ -64,6 +65,24 @@ Page({
             parkObj
         })
 
+        // 真机诡异的BUG(微信小程序真机)
+        // 直接设置为false 会 导致界面上的电池量不显示(这是因为真机会在css之前加上两个横线--,但是直接在css中写这两个横线会导致编译报错)
+        // 这里折中先设置为true,然后在定时器中设置为false 刷新一下
+        setTimeout(()=>{
+            eleList.forEach((key)=>{
+                key['active'] = false
+            })
+            that.setData({
+                eleList
+            })
+        }, 250)
+
+        setTimeout(()=>{
+            that.setData({
+                hid:true
+            })
+        }, 300)
+
         // 更新是否减停车费
 
 

+ 1 - 1
pages/scan_result/elpackage.wxml

@@ -20,7 +20,7 @@
     <!-- <text style='margin-bottom:10rpx;'>地址:{{chargPile.address}}</text> -->
     <text style='line-height:24rpx;height:24rpx;font-size:24rpx;margin-top: 16rpx;' >地址:{{chargPile.address}}</text>
     <text style="line-height:24rpx;height:24rpx;font-size:24rpx;margin: 20rpx 0;">请选择电池包</text>
-    <view class="cardHub">
+    <view class="cardHub {{!hid?'hid':''}}" >
         <block wx:for="{{eleList}}" wx:key="*this"  >
         <view class="card {{item.active?'':'dis'}}" bindtap="selectEle" data-idx="{{index}}">
                 <view class="circleOut">{{index + 1}}</view>

+ 4 - 0
pages/scan_result/elpackage.wxss

@@ -299,4 +299,8 @@ page {
 
   .cardHub .card.dis .no{
     color:#A4A3A3;
+  }
+
+  .hid{
+      margin: 999999rpx;
   }