Commit dfe62578 by 王榕

修改电池

parent cebf312b
...@@ -75,7 +75,12 @@ Page({ ...@@ -75,7 +75,12 @@ Page({
console.log('设备列表:', res) console.log('设备列表:', res)
if (res.items.length > 0) { if (res.items.length > 0) {
this.setData({ this.setData({
batteryList: res.items batteryList: res.items,
hasBattery: true
})
}else{
this.setData({
hasBattery:false
}) })
} }
}) })
......
...@@ -79,9 +79,9 @@ ...@@ -79,9 +79,9 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{!auth&&hasBattery}}" class="bind-btn"> <view class="bind-btn">
<view wx:if="{{!auth}}" catchtap="reLogin">立即登录</view> <view wx:if="{{!auth}}" catchtap="reLogin">立即登录</view>
<view class="btn" catchtap="bindBattery" wx:else>立即扫码绑定</view> <view class="btn" catchtap="bindBattery" wx:if="{{auth&&!hasBattery}}">立即扫码绑定</view>
</view> </view>
<i-modal visible="{{ lockAction }}" title="{{targetStatus===0?'关锁中。。':'开锁中。。'}}" show-ok="{{false}}" show-cancel="{{false}}"> <i-modal visible="{{ lockAction }}" title="{{targetStatus===0?'关锁中。。':'开锁中。。'}}" show-ok="{{false}}" show-cancel="{{false}}">
<view style='padding:0 10rpx;'> <view style='padding:0 10rpx;'>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<cover-image class="avator" src="{{user.avatarUrl||'./defaultAvator.png'}}"></cover-image> <cover-image class="avator" src="{{user.avatarUrl||'./defaultAvator.png'}}"></cover-image>
<cover-view class="my-right"> <cover-view class="my-right">
<block wx:if="{{auth}}"> <block wx:if="{{auth}}">
<cover-view class="nickname">{{user.nickname||'Hi,您好'}}</cover-view> <cover-view class="nickname">{{user.mobile||'Hi,您好'}}</cover-view>
<cover-view catchtap="bindBattery" class="bind-btn abtn">绑定电池</cover-view> <cover-view catchtap="bindBattery" class="bind-btn abtn">绑定电池</cover-view>
</block> </block>
<block wx:else> <block wx:else>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment