修改了会议服务,新增了开门控制器

This commit is contained in:
chenze 2024-09-07 17:04:18 +08:00
parent 221d068a3d
commit 54508b3d96
3 changed files with 35 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<view class="containerView public"> <view class="containerView public">
<!-- 免费服务 --> <!-- 免费服务 -->
<view class="serviceView"> <!-- <view class="serviceView">
<view class="leftLineTitle">基础会议服务</view> <view class="leftLineTitle">基础会议服务</view>
<view class="serviceItemView"> <view class="serviceItemView">
<view class="serviceItem" wx:if="{{item.type == 'free'}}" wx:for="{{serviceList}}" wx:key="*this"> <view class="serviceItem" wx:if="{{item.type == 'free'}}" wx:for="{{serviceList}}" wx:key="*this">
@ -10,7 +10,7 @@
<van-field style="width: 10rpx; visibility: hidden;" data-id="{{item.serveId}}" value="{{ item.num }}" type="number" clearable placeholder="请输入人数" border="{{ false }}" bind:change="inputChange" /> <van-field style="width: 10rpx; visibility: hidden;" data-id="{{item.serveId}}" value="{{ item.num }}" type="number" clearable placeholder="请输入人数" border="{{ false }}" bind:change="inputChange" />
</view> </view>
</view> </view>
</view> </view> -->
<!-- 增值服务 --> <!-- 增值服务 -->
<view class="serviceView"> <view class="serviceView">

View File

@ -76,8 +76,11 @@ Page({
console.log('getAllDeviceInfoByRoomIdRq', res); console.log('getAllDeviceInfoByRoomIdRq', res);
let equipmentList = res.data.map(item => _this.formatDevice(item)) let equipmentList = res.data.map(item => _this.formatDevice(item))
equipmentList = equipmentList.filter(item => item.type != '门锁') equipmentList = equipmentList.filter(item => item.type != '门锁')
let lockDoor = res.data.find(item => item.type == '门锁') let lockDoor = res.data.find(item => item.type == '门锁')
let controlDoor = res.data.find(item => item.type == '开门控制器')
console.log('开门控制器-------',controlDoor);
_this.setData({ _this.setData({
controlDoor,
lockDoor, lockDoor,
equipmentList equipmentList
}) })
@ -133,7 +136,7 @@ Page({
let equipmentList = _this.data.equipmentList let equipmentList = _this.data.equipmentList
for (let i = 0; i < equipmentList.length; i++) { for (let i = 0; i < equipmentList.length; i++) {
let equipmentData = equipmentList[i]; let equipmentData = equipmentList[i];
if (equipmentData.type == '窗帘' || equipmentData.type == '门锁') { if (equipmentData.type == '窗帘' || equipmentData.type == '门锁' || equipmentData.type == '开门控制器') {
continue continue
} }
// //
@ -296,7 +299,24 @@ Page({
app.vantNotifyErr(Notify, res.msg) app.vantNotifyErr(Notify, res.msg)
} }
}) })
}, },
//调用开门控制器
openControlDoor(){
console.log(11111);
let _this = this
let controlDoor = _this.data.controlDoor
callApiByDeviceIdRq({
"deviceId": controlDoor.id,
}).then(res => {
console.log('callApiByDeviceIdRq', res);
if(res.code == 0){
app.vantNotifySuccess(Notify, res.msg)
}else{
app.vantNotifyErr(Notify, res.msg)
}
})
},
// 调用设备接口 // 调用设备接口
callApiByDevice(data) { callApiByDevice(data) {

View File

@ -6,10 +6,18 @@
<view class="logoImg" style="background: no-repeat center/cover url({{IMG_NAME + '/profile/static/shanghai_changyang/index/is_logo.png'}});"></view> <view class="logoImg" style="background: no-repeat center/cover url({{IMG_NAME + '/profile/static/shanghai_changyang/index/is_logo.png'}});"></view>
<view class="title">{{roomName}}</view> <view class="title">{{roomName}}</view>
</view> </view>
<!-- 开门控制器 -->
<view class="leftLineTitle" wx:if="{{controlDoor}}">开门控制器</view>
<view class="lockView">
<view class="lockSwitchView" wx:if="{{controlDoor}}" bind:tap="openControlDoor">
<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>
</view>
<!-- 门锁 -->
<view class="leftLineTitle" wx:if="{{lockDoor}}">门锁</view> <view class="leftLineTitle" wx:if="{{lockDoor}}">门锁</view>
<view class="lockView"> <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}}" bind:tap="openLockDoor"> <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="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 class="label">点击开门</view>