mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-08-08 18:42:42 +08:00
调试后台接口
修复选择日期时时间戳为当前时间的BUG,改为选择日期的00:00:00 完成首页认证、预约会议室页面、会议室详情页面、预约功能的调试
This commit is contained in:
parent
ee09115377
commit
ba13f9c97f
@ -98,8 +98,14 @@ Page({
|
||||
},
|
||||
// 跳转会议预约页面
|
||||
goRes(e) {
|
||||
let date = new Date(e.detail);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let chooseTime = year + '-' + month + '-' + day + ' 00:00:00'
|
||||
let chooseTimeStr = new Date(chooseTime).getTime()
|
||||
wx.navigateTo({
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?time=' + e.detail + '&dep=' + this.data.depName + '&depId=' + this.data.depId,
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?time=' + chooseTimeStr + '&dep=' + this.data.depName + '&depId=' + this.data.depId,
|
||||
})
|
||||
},
|
||||
// 跳转菜单
|
||||
|
@ -307,16 +307,23 @@ Page({
|
||||
meetingRoomList() {
|
||||
let _this = this;
|
||||
let queryParam = _this.data.queryParam;
|
||||
let roomItemList = queryParam.itemDict.list.filter(item => item.select).map(item => {
|
||||
return {
|
||||
"id": item.value,
|
||||
"name": item.text
|
||||
let devicesArr = []
|
||||
for (let key in queryParam.itemDict.list) {
|
||||
let eachObj = queryParam.itemDict.list[key]
|
||||
if (eachObj.select) {
|
||||
devicesArr.push(eachObj.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
// let roomItemList = queryParam.itemDict.list.filter(item => item.select).map(item => {
|
||||
// return {
|
||||
// "id": item.value,
|
||||
// "name": item.text
|
||||
// }
|
||||
// })
|
||||
let param = {
|
||||
floor: queryParam.meetingTypeDict.value, // 楼层
|
||||
capacityNum: queryParam.personDict.value, // 人数
|
||||
device: '', // 设备
|
||||
devices: devicesArr, // 设备
|
||||
typeName: queryParam.shapeDict.value, // 形状
|
||||
timeFormat: queryParam.timeRangeDict.value, // 预约时间格式:0 任意时间(管理员),1上午,2下午,3晚上 4 全天。值为0时,读取startTime和endTime为预约会议时间范围;其他值读取mrdate,再拼接时间为预约会议时间范围。
|
||||
mrdate: _this.data.dateStr
|
||||
@ -350,7 +357,7 @@ Page({
|
||||
timeRange = timeRange ? timeRange : 0
|
||||
// 跳转预约详情
|
||||
wx.navigateTo({
|
||||
url: "/pages/meeting/meetingRoom/meetingRoom?id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange + '&rId=' + this.data.rId + '&dep=' + this.data.dep + '&depId=' + this.data.depId
|
||||
url: "/pages/meeting/meetingRoom/meetingRoom?status="+ e.currentTarget.dataset.status +"&id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange + '&rId=' + this.data.rId + '&dep=' + this.data.dep + '&depId=' + this.data.depId
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -25,11 +25,21 @@
|
||||
<view class="meetingRoomView">
|
||||
<view wx:for="{{roomDataList}}">
|
||||
<view class="roomType">{{item.name}}</view>
|
||||
<view class="meetingRoomItem" bind:tap="jumpMeetingRoom" wx:for="{{item.list}}" wx:for-item="room" wx:key="*this" data-id="{{room.id}}">
|
||||
<view class="content">
|
||||
<view class="meetingRoomItem" bind:tap="jumpMeetingRoom" wx:for="{{item.list}}" wx:for-item="room" wx:key="*this" data-id="{{room.id}}" data-status="{{room.status}}">
|
||||
<view class="content" wx:if="{{room.status === 0}}">
|
||||
<view class="title">{{room.roomNum}}</view>
|
||||
<view class="priceView">
|
||||
<view class="unit">{{room.capacityNum}}人 {{room.typeName}}</view>
|
||||
<view class="unit">
|
||||
{{room.capacityNum}}人 {{room.typeName}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content disabled" wx:if="{{room.status === 1}}">
|
||||
<view class="title">{{room.roomNum}}</view>
|
||||
<view class="priceView">
|
||||
<view class="unit">
|
||||
不可预约
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="imgView">
|
||||
|
@ -113,13 +113,12 @@ Page({
|
||||
startTime = parseInt(date) + (parseInt(startTimeArr[0]) * 60 * 60 + parseInt(startTimeArr[1]) * 60) * 1000
|
||||
let endTimeArr = endTime.split(':')
|
||||
endTime = parseInt(date) + (parseInt(endTimeArr[0]) * 60 * 60 + parseInt(endTimeArr[1]) * 60) * 1000
|
||||
let paramUrl = "?meetingRoomId=" + meetingRoomId + "&startTime=" + selfFormatTimeYMDHMS(startTime) + "&endTime=" + selfFormatTimeYMDHMS(endTime) + '&rId=' + _this.data.rId + '&dep=' + _this.data.dep + '&depId=' + _this.data.depId;
|
||||
let paramUrl = "?meetingRoomId=" + meetingRoomId + "&startTime=" + selfFormatTimeYMDHMS(startTime) + "&endTime=" + selfFormatTimeYMDHMS(endTime) + '&timeRange=' + _this.data.timeRange + '&rId=' + _this.data.rId + '&dep=' + _this.data.dep + '&depId=' + _this.data.depId;
|
||||
// 结束时间不能小于开始时间
|
||||
if (startTime >= endTime) {
|
||||
Notify('结束时间不能小于开始时间!')
|
||||
return
|
||||
}
|
||||
|
||||
wx.navigateTo({
|
||||
url: "/pages/meeting/meetingRoom/meetingOrder/meetingOrder" + paramUrl,
|
||||
})
|
||||
|
@ -33,6 +33,7 @@ Page({
|
||||
IMG_NAME: app.IMG_NAME,
|
||||
detail: {},
|
||||
meetingRoomId: null,
|
||||
timeRange: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
selectDay: null,
|
||||
@ -108,7 +109,8 @@ Page({
|
||||
_this.setData({
|
||||
meetingRoomId: _meetingRoomId,
|
||||
startTime: res.data.startTime,
|
||||
endTime: res.data.endDate
|
||||
endTime: res.data.endDate,
|
||||
timeRange: res.data.timeRange
|
||||
})
|
||||
let serviceId = []
|
||||
for (let key in res.data.reservationServes) {
|
||||
@ -147,9 +149,9 @@ Page({
|
||||
}).then(res => {
|
||||
let detail = res.room
|
||||
let bannerList = []
|
||||
if (detail.indoorPicUrl) {
|
||||
if (detail.imgs) {
|
||||
try {
|
||||
bannerList = JSON.parse(detail.indoorPicUrl).map(item => item.url)
|
||||
bannerList = detail.imgs.map(item => item.url)
|
||||
} catch (error) {
|
||||
console.log(`JSON error : ${error}`);
|
||||
}
|
||||
@ -177,7 +179,7 @@ Page({
|
||||
})
|
||||
})
|
||||
},
|
||||
getService() {
|
||||
getService(serveId) {
|
||||
let _this = this;
|
||||
meetingRoomDict().then(res => {
|
||||
console.log('meetingRoomDict', res)
|
||||
@ -188,15 +190,19 @@ Page({
|
||||
for (let key in dataObj.services) {
|
||||
let eachObj = dataObj.services[key]
|
||||
const keys = Object.keys(eachObj)
|
||||
let isSel = false
|
||||
let sId = eachObj[keys[0]]
|
||||
if (serveId.includes(sId)) {
|
||||
isSel = true
|
||||
}
|
||||
serviceList.push({
|
||||
serveId: eachObj[keys[0]],
|
||||
serveName: keys[0],
|
||||
isSelect: false,
|
||||
isSelect: isSel,
|
||||
num: '',
|
||||
type: 'free'
|
||||
})
|
||||
}
|
||||
console.log(serviceList)
|
||||
// queryParam.shapeDict.list = typeList
|
||||
_this.setData({
|
||||
serviceList: serviceList
|
||||
@ -210,15 +216,16 @@ Page({
|
||||
let _this = this
|
||||
let name = e.currentTarget.dataset.name
|
||||
let value = e.detail
|
||||
let data = _this.data
|
||||
data['detail'][name] = value
|
||||
let _data = _this.data.detail
|
||||
_data[name] = value
|
||||
this.setData({
|
||||
...data
|
||||
..._data
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转-空间设施
|
||||
jumpMeetingFacilities() {
|
||||
console.log(this.data.serviceList)
|
||||
let meetingRoomId = this.data.meetingRoomId;
|
||||
let serviceListJsonStr = JSON.stringify(this.data.serviceList)
|
||||
wx.navigateTo({
|
||||
@ -273,10 +280,8 @@ Page({
|
||||
// 处理一下serviceList
|
||||
let service = []
|
||||
let serviceList = _this.data.serviceList
|
||||
// console.log(serviceList)
|
||||
for (let key in serviceList) {
|
||||
let eachObj = serviceList[key]
|
||||
console.log(eachObj)
|
||||
if (eachObj.isSelect === true) {
|
||||
service.push({
|
||||
name: eachObj['serveName'],
|
||||
@ -285,15 +290,13 @@ Page({
|
||||
})
|
||||
}
|
||||
}
|
||||
// console.log(service)
|
||||
// return
|
||||
saveChangyangMeetingRecordRq({
|
||||
mr: {
|
||||
let data = {
|
||||
"mr": {
|
||||
"roomId": _this.data.meetingRoomId,
|
||||
"start": _this.data.startTime,
|
||||
"end": _this.data.endTime,
|
||||
"mrdate": "2024-09-27",
|
||||
"timeFormat": "0",
|
||||
"mrdate": _this.data.selectDay,
|
||||
"timeFormat": _this.data.timeRange,
|
||||
"title": _this.data.detail.title,
|
||||
"personNum": _this.data.detail.personNum,
|
||||
"leader": _this.data.detail.leader,
|
||||
@ -303,12 +306,14 @@ Page({
|
||||
"bookingUserPhone": _this.data.detail.orderTel,
|
||||
"remark": _this.data.detail.remark,
|
||||
},
|
||||
serve: service
|
||||
}).then(res => {
|
||||
"serve": service
|
||||
}
|
||||
console.log('saveData', data)
|
||||
saveChangyangMeetingRecordRq(data).then(res => {
|
||||
console.log('saveMeetingRecordRq', res);
|
||||
if (res.code == 0) {
|
||||
wx.reLaunch({
|
||||
url: '/pages/meeting/pay/waitComplete/waitComplete?id=' + res.reservationId,
|
||||
url: '/pages/meeting/pay/waitComplete/waitComplete',
|
||||
})
|
||||
} else {
|
||||
// 错误提示
|
||||
|
@ -14,8 +14,7 @@
|
||||
<view class="detailView">
|
||||
<view class="title">{{room.floor}} | {{room.roomNum}} | {{room.capacityNum}}人 | {{room.typeName}}</view>
|
||||
<view class="itemList">
|
||||
<view class="item" wx:for="{{room.roomItemList}}" wx:for-item="serviceItem" wx:key="*this">#{{serviceItem.name}}</view>
|
||||
<view class="item" wx:for="{{room.roomServeList}}" wx:for-item="serveItem" wx:key="*this">#{{serveItem.serveName}}</view>
|
||||
{{room.device}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="priceView">
|
||||
|
@ -34,12 +34,14 @@ Page({
|
||||
console.log('onLoad', options);
|
||||
let time = options.time
|
||||
let timeRange = options.timeRange
|
||||
let status = options.status
|
||||
_this.setData({
|
||||
date: time,
|
||||
timeRange: timeRange,
|
||||
rId: options.rId,
|
||||
dep: options.dep,
|
||||
depId: options.depId
|
||||
depId: options.depId,
|
||||
canRes: status === "1" ? false : true
|
||||
})
|
||||
let meetingRoomId = options.id;
|
||||
meetingRoomDetailRq({
|
||||
@ -47,15 +49,32 @@ Page({
|
||||
}).then(res => {
|
||||
console.log('meetingRoomDetailRq', res);
|
||||
let detail = res.room
|
||||
let recordList = res.mr
|
||||
let bannerList = []
|
||||
if (detail.indoorPicUrl) {
|
||||
if (detail.imgs) {
|
||||
try {
|
||||
bannerList = JSON.parse(detail.indoorPicUrl).map(item => item.url)
|
||||
bannerList = detail.imgs.map(item => item.url)
|
||||
} catch (error) {
|
||||
console.log(`JSON error : ${error}`);
|
||||
}
|
||||
}
|
||||
let _recordList = []
|
||||
for (let key in recordList) {
|
||||
let eachObj = recordList[key]
|
||||
let sTime = eachObj['start']
|
||||
let sTimeStr = new Date(sTime).getTime()
|
||||
let sTimeData = new Date(sTimeStr)
|
||||
let eTime = eachObj['end']
|
||||
let eTimeStr = new Date(eTime).getTime()
|
||||
let eTimeData = new Date(eTimeStr)
|
||||
let sTimeFormat = sTimeData.getHours().toString().padStart(2, '0') + ':' + sTimeData.getMinutes().toString().padStart(2, '0')
|
||||
let eTimeFormat = eTimeData.getHours().toString().padStart(2, '0') + ':' + eTimeData.getMinutes().toString().padStart(2, '0')
|
||||
eachObj['time'] = sTimeFormat + ' - ' + eTimeFormat
|
||||
_recordList.push(eachObj)
|
||||
}
|
||||
|
||||
_this.setData({
|
||||
recordList: _recordList,
|
||||
meetingRoomId,
|
||||
detail,
|
||||
bannerList
|
||||
|
@ -28,7 +28,7 @@
|
||||
<view class="resView">
|
||||
<view class="leftLineTitle">预约情况</view>
|
||||
<van-cell-group>
|
||||
<van-cell wx:for="{{recordList}}" title="{{item.date}}" value="{{item.time}}" label="{{item.dep}} | {{item.user}} | {{item.tel}}" />
|
||||
<van-cell wx:for="{{recordList}}" title="{{item.date}}" value="{{item.time}}" label="{{item.userOrg}} | {{item.bookingUserName}} | {{item.bookingUserPhone}}" />
|
||||
</van-cell-group>
|
||||
</view>
|
||||
|
||||
@ -60,5 +60,5 @@
|
||||
</view> -->
|
||||
|
||||
<!-- 预约 -->
|
||||
<view wx:if="canRes" class="submitBtn" bind:tap="jumpMeetingBooked">会议预约</view>
|
||||
<view wx:if="{{canRes}}" class="submitBtn" bind:tap="jumpMeetingBooked">会议预约</view>
|
||||
</view>
|
@ -33,11 +33,12 @@ Page({
|
||||
serviceList
|
||||
})
|
||||
// 获取数据
|
||||
_this.getData();
|
||||
// _this.getData();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
// 获取数据,不需要
|
||||
getData() {
|
||||
return
|
||||
let _this = this;
|
||||
if (!(_this.data.serviceList && _this.data.serviceList.length > 0)) {
|
||||
// 查询服务列表
|
||||
|
@ -19,7 +19,6 @@ Page({
|
||||
|
||||
// 跳转-会议预约记录
|
||||
jumpMeetingRecord() {
|
||||
let _id = this.data.id
|
||||
wx.reLaunch({
|
||||
url: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord",
|
||||
})
|
||||
|
@ -448,9 +448,15 @@ Page({
|
||||
// 跳转会议预约页面
|
||||
goRes(e) {
|
||||
let _this = this
|
||||
let date = new Date(e.detail);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let chooseTime = year + '-' + month + '-' + day + ' 00:00:00'
|
||||
let chooseTimeStr = new Date(chooseTime).getTime()
|
||||
// 加入rId参数,为预约id,用于重新修改
|
||||
wx.navigateTo({
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?rId=' + _this.data.editId + '&time=' + e.detail,
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?rId=' + _this.data.editId + '&time=' + chooseTimeStr,
|
||||
})
|
||||
},
|
||||
pass() {
|
||||
|
@ -382,9 +382,15 @@ Page({
|
||||
// 跳转会议预约页面
|
||||
goRes(e) {
|
||||
let _this = this
|
||||
let date = new Date(e.detail);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let chooseTime = year + '-' + month + '-' + day + ' 00:00:00'
|
||||
let chooseTimeStr = new Date(chooseTime).getTime()
|
||||
// 加入rId参数,为预约id,用于重新修改
|
||||
wx.navigateTo({
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?rId=' + _this.data.detail.id + '&time=' + e.detail,
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?rId=' + _this.data.detail.id + '&time=' + chooseTimeStr,
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -497,9 +497,15 @@ Page({
|
||||
// 跳转会议预约页面
|
||||
goRes(e) {
|
||||
let _this = this
|
||||
let date = new Date(e.detail);
|
||||
let year = date.getFullYear()
|
||||
let month = date.getMonth() + 1
|
||||
let day = date.getDate()
|
||||
let chooseTime = year + '-' + month + '-' + day + ' 00:00:00'
|
||||
let chooseTimeStr = new Date(chooseTime).getTime()
|
||||
// 加入rId参数,为预约id,用于重新修改
|
||||
wx.navigateTo({
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?rId=' + _this.data.editId + '&time=' + e.detail,
|
||||
url: '/pages/meeting/meetingReservation/meetingReservation?rId=' + _this.data.editId + '&time=' + chooseTimeStr,
|
||||
})
|
||||
},
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user