描述:会议预约列表增加开门按钮,详情也添加

This commit is contained in:
SelfRidicule 2024-08-28 10:51:56 +08:00
parent fc634b24f5
commit 2eaa688633
6 changed files with 86 additions and 2 deletions

View File

@ -349,5 +349,19 @@ App({
url: '/pages/index/index', url: '/pages/index/index',
}) })
} }
},
// 根据房间查询门锁id
findDoorLock(roomId) {
let lockList = [{
roomId: '237',
lockId: '43'
}, {
roomId: '238',
lockId: '78'
}, {
roomId: '239',
lockId: '79'
}, ]
return lockList.find(item => item.roomId == roomId)
} }
}) })

View File

@ -16,6 +16,11 @@ import {
getMeetingRoomServiceAndEquipmentRq, getMeetingRoomServiceAndEquipmentRq,
} from "../../../../../api/meeting/meetingRoom.js" } from "../../../../../api/meeting/meetingRoom.js"
import {
callApiByDeviceIdRq,
} from "../../../../../api/meeting/equipment.js"
Page({ Page({
/** /**
@ -59,6 +64,13 @@ Page({
let showInvite = false; let showInvite = false;
let showCancel = false; let showCancel = false;
let showDetail = false; let showDetail = false;
let showLock = false;
// 是否开门
let lock = app.findDoorLock(detail.roomContent.roomId)
if (lock) {
showLock = true
detail.lockId = lock.lockId
}
// 待支付 0 :去支付、取消订单、查看详情 // 待支付 0 :去支付、取消订单、查看详情
if (statusValue == 0) { if (statusValue == 0) {
showPay = true; showPay = true;
@ -98,6 +110,7 @@ Page({
} }
// //
// 赋值 // 赋值
detail.showLock = showLock;
detail.showPay = showPay; detail.showPay = showPay;
detail.showInvite = showInvite; detail.showInvite = showInvite;
detail.showCancel = showCancel; detail.showCancel = showCancel;
@ -192,6 +205,24 @@ Page({
}) })
}, },
// 开门
openLockDoor(e) {
let _this = this
console.log('openLockDoor', e);
let lockId = e.currentTarget.dataset.obj.lockId
// 调用设备接口
callApiByDeviceIdRq({
"deviceId": lockId,
}).then(res => {
console.log('callApiByDeviceIdRq', res);
if (res.code == 0) {
app.vantNotifySuccess(Notify, res.msg)
} else {
app.vantNotifyErr(Notify, res.msg)
}
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -87,6 +87,7 @@
<!-- 底部区域 --> <!-- 底部区域 -->
<view class="bottomFix" wx:if="{{detail.showPay || detail.showInvite || detail.showCancel}}"> <view class="bottomFix" wx:if="{{detail.showPay || detail.showInvite || detail.showCancel}}">
<!-- <view class="btn" wx:if="{{detail.showPay}}" bind:tap="jumpPay" data-id="{{detail.id}}">去支付</view> --> <!-- <view class="btn" wx:if="{{detail.showPay}}" bind:tap="jumpPay" data-id="{{detail.id}}">去支付</view> -->
<view class="btn" wx:if="{{detail.showLock}}" bind:tap="openLockDoor" data-obj="{{detail}}">开门</view>
<view class="btn" wx:if="{{detail.showInvite}}">去邀请 <view class="btn" wx:if="{{detail.showInvite}}">去邀请
<button class="shareBtn" open-type="share" data-id="{{detail.id}}">转发</button> <button class="shareBtn" open-type="share" data-id="{{detail.id}}">转发</button>
</view> </view>

View File

@ -14,6 +14,10 @@ import {
cancelOrderRq cancelOrderRq
} from "../../../../api/meeting/meetingRoom.js" } from "../../../../api/meeting/meetingRoom.js"
import {
callApiByDeviceIdRq,
} from "../../../../api/meeting/equipment.js"
Page({ Page({
/** /**
@ -186,6 +190,13 @@ Page({
let showInvite = false; let showInvite = false;
let showCancel = false; let showCancel = false;
let showDetail = false; let showDetail = false;
let showLock = false;
// 是否开门
let lock = app.findDoorLock(item.roomContent.roomId)
if (lock) {
showLock = true
item.lockId = lock.lockId
}
// 待支付 0 :去支付、取消订单、查看详情 // 待支付 0 :去支付、取消订单、查看详情
if (statusValue == 0) { if (statusValue == 0) {
showPay = true; showPay = true;
@ -225,6 +236,7 @@ Page({
} }
// //
// 赋值 // 赋值
item.showLock = showLock;
item.showPay = showPay; item.showPay = showPay;
item.showInvite = showInvite; item.showInvite = showInvite;
item.showCancel = showCancel; item.showCancel = showCancel;
@ -323,6 +335,24 @@ Page({
}); });
}, },
// 开门
openLockDoor(e) {
let _this = this
console.log('openLockDoor', e);
let lockId = e.currentTarget.dataset.obj.lockId
// 调用设备接口
callApiByDeviceIdRq({
"deviceId": lockId,
}).then(res => {
console.log('callApiByDeviceIdRq', res);
if (res.code == 0) {
app.vantNotifySuccess(Notify, res.msg)
} else {
app.vantNotifyErr(Notify, res.msg)
}
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -23,6 +23,7 @@
</view> </view>
<view class="btnView"> <view class="btnView">
<!-- <view class="btn" wx:if="{{item.showPay}}" bind:tap="jumpPay" data-id="{{item.id}}">去支付</view> --> <!-- <view class="btn" wx:if="{{item.showPay}}" bind:tap="jumpPay" data-id="{{item.id}}">去支付</view> -->
<view class="btn" wx:if="{{item.showLock}}" bind:tap="openLockDoor" data-obj="{{item}}">开门</view>
<view class="btn" wx:if="{{item.showInvite}}">去邀请 <view class="btn" wx:if="{{item.showInvite}}">去邀请
<button class="shareBtn" open-type="share" data-id="{{item.id}}">转发</button> <button class="shareBtn" open-type="share" data-id="{{item.id}}">转发</button>
</view> </view>
@ -36,12 +37,12 @@
</van-tab> </van-tab>
<van-tab title="参与记录"> <van-tab title="参与记录">
<view class="itemView" wx:for="{{participateDataList}}" wx:for-item="item" wx:key="*this" bind:tap="jumpParticipateDetail" data-id="{{item.id}}"> <view class="itemView" wx:for="{{participateDataList}}" wx:for-item="item" wx:key="*this">
<view class="headView"> <view class="headView">
<view class="number">{{item.title}}</view> <view class="number">{{item.title}}</view>
<view class="status" style="color: {{item.statusColor}};">{{item.statusName}}</view> <view class="status" style="color: {{item.statusColor}};">{{item.statusName}}</view>
</view> </view>
<view class="contentView"> <view class="contentView" bind:tap="jumpParticipateDetail" data-id="{{item.id}}">
<image class="img" src="{{IMG_NAME + item.roomContent.indoorPicUrlFirst}}" mode="aspectFill"></image> <image class="img" src="{{IMG_NAME + item.roomContent.indoorPicUrlFirst}}" mode="aspectFill"></image>
<view class="msgView"> <view class="msgView">
<view class="title">{{item.roomContent.capacityNum}}人间 | {{item.roomContent.roomName}} | {{item.roomContent.buildingName}}</view> <view class="title">{{item.roomContent.capacityNum}}人间 | {{item.roomContent.roomName}} | {{item.roomContent.buildingName}}</view>
@ -49,6 +50,9 @@
<view class="time">{{item.timeSlot}}</view> <view class="time">{{item.timeSlot}}</view>
</view> </view>
</view> </view>
<view class="btnView right">
<view class="btn" wx:if="{{item.showLock}}" bind:tap="openLockDoor" data-obj="{{item}}">开门</view>
</view>
</view> </view>
<view class="loadAllLine" wx:if="{{participateIsDataAll}}"> <view class="loadAllLine" wx:if="{{participateIsDataAll}}">
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider> <van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>

View File

@ -104,6 +104,10 @@
margin-left: 10rpx; margin-left: 10rpx;
} }
.itemView .btnView.right {
margin-top: 30rpx;
}
.itemView .btnView { .itemView .btnView {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;