mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 18:59:36 +08:00
描述:会议预约列表增加开门按钮,详情也添加
This commit is contained in:
parent
fc634b24f5
commit
2eaa688633
@ -349,5 +349,19 @@ App({
|
||||
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)
|
||||
}
|
||||
})
|
@ -16,6 +16,11 @@ import {
|
||||
getMeetingRoomServiceAndEquipmentRq,
|
||||
} from "../../../../../api/meeting/meetingRoom.js"
|
||||
|
||||
import {
|
||||
callApiByDeviceIdRq,
|
||||
} from "../../../../../api/meeting/equipment.js"
|
||||
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
@ -59,6 +64,13 @@ Page({
|
||||
let showInvite = false;
|
||||
let showCancel = false;
|
||||
let showDetail = false;
|
||||
let showLock = false;
|
||||
// 是否开门
|
||||
let lock = app.findDoorLock(detail.roomContent.roomId)
|
||||
if (lock) {
|
||||
showLock = true
|
||||
detail.lockId = lock.lockId
|
||||
}
|
||||
// 待支付 0 :去支付、取消订单、查看详情
|
||||
if (statusValue == 0) {
|
||||
showPay = true;
|
||||
@ -98,6 +110,7 @@ Page({
|
||||
}
|
||||
//
|
||||
// 赋值
|
||||
detail.showLock = showLock;
|
||||
detail.showPay = showPay;
|
||||
detail.showInvite = showInvite;
|
||||
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)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@ -87,6 +87,7 @@
|
||||
<!-- 底部区域 -->
|
||||
<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.showLock}}" bind:tap="openLockDoor" data-obj="{{detail}}">开门</view>
|
||||
<view class="btn" wx:if="{{detail.showInvite}}">去邀请
|
||||
<button class="shareBtn" open-type="share" data-id="{{detail.id}}">转发</button>
|
||||
</view>
|
||||
|
@ -14,6 +14,10 @@ import {
|
||||
cancelOrderRq
|
||||
} from "../../../../api/meeting/meetingRoom.js"
|
||||
|
||||
import {
|
||||
callApiByDeviceIdRq,
|
||||
} from "../../../../api/meeting/equipment.js"
|
||||
|
||||
Page({
|
||||
|
||||
/**
|
||||
@ -186,6 +190,13 @@ Page({
|
||||
let showInvite = false;
|
||||
let showCancel = false;
|
||||
let showDetail = false;
|
||||
let showLock = false;
|
||||
// 是否开门
|
||||
let lock = app.findDoorLock(item.roomContent.roomId)
|
||||
if (lock) {
|
||||
showLock = true
|
||||
item.lockId = lock.lockId
|
||||
}
|
||||
// 待支付 0 :去支付、取消订单、查看详情
|
||||
if (statusValue == 0) {
|
||||
showPay = true;
|
||||
@ -225,6 +236,7 @@ Page({
|
||||
}
|
||||
//
|
||||
// 赋值
|
||||
item.showLock = showLock;
|
||||
item.showPay = showPay;
|
||||
item.showInvite = showInvite;
|
||||
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)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@ -23,6 +23,7 @@
|
||||
</view>
|
||||
<view class="btnView">
|
||||
<!-- <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}}">去邀请
|
||||
<button class="shareBtn" open-type="share" data-id="{{item.id}}">转发</button>
|
||||
</view>
|
||||
@ -36,12 +37,12 @@
|
||||
</van-tab>
|
||||
|
||||
<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="number">{{item.title}}</view>
|
||||
<view class="status" style="color: {{item.statusColor}};">{{item.statusName}}</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>
|
||||
<view class="msgView">
|
||||
<view class="title">{{item.roomContent.capacityNum}}人间 | {{item.roomContent.roomName}} | {{item.roomContent.buildingName}}</view>
|
||||
@ -49,6 +50,9 @@
|
||||
<view class="time">{{item.timeSlot}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btnView right">
|
||||
<view class="btn" wx:if="{{item.showLock}}" bind:tap="openLockDoor" data-obj="{{item}}">开门</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loadAllLine" wx:if="{{participateIsDataAll}}">
|
||||
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
|
||||
|
@ -104,6 +104,10 @@
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.itemView .btnView.right {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.itemView .btnView {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
Loading…
x
Reference in New Issue
Block a user