This commit is contained in:
SelfRidicule 2024-08-22 18:48:42 +08:00
parent fd52d2df19
commit 6bc275e815
2 changed files with 11 additions and 1 deletions

View File

@ -278,6 +278,16 @@ Page({
})
},
// 开门
openLockDoor() {
let _this = this
let lockDoor = _this.data.lockDoor
// 调用设备接口
_this.callApiByDevice({
"deviceId": lockDoor.id,
})
},
// 调用设备接口
callApiByDevice(data) {
callApiByDeviceIdRq(data).then(res => {

View File

@ -10,7 +10,7 @@
<view class="lockView">
<!-- <view class="lockImg" style="background: no-repeat center/cover url({{IMG_NAME + '/profile/static/shanghai_changyang/device/equipment/lock/lock.png'}});"></view> -->
<view class="lockSwitchView" wx:if="{{lockDoor}}">
<view class="lockSwitchView" wx:if="{{lockDoor}}" bind:tap="openLockDoor">
<view class="switchImg" style="background: no-repeat center/cover url({{IMG_NAME + '/profile/static/shanghai_changyang/device/equipment/lock/lockSwitch.png'}});"></view>
<view class="label">点击开门</view>
</view>