会议功能修改

完成会议首页、会议室列表页、会议室详情页、会议预约时间选择功能
This commit is contained in:
471615499@qq.com 2024-09-16 18:22:00 +08:00
parent 573d3c1069
commit 34701558f3
14 changed files with 1155 additions and 845 deletions

View File

@ -34,35 +34,76 @@ Page({
img: "/profile/static/repair/index/repair.png", img: "/profile/static/repair/index/repair.png",
path: "/pages/reportRepair/repair/index/index", path: "/pages/reportRepair/repair/index/index",
visible: false visible: false
}] }],
timeShow: false,
currentDate: new Date().getTime(),
minDate: new Date().getTime(),
maxDate: '',
formatter(type, value) {
if (type === 'year') {
return `${value}`;
}
if (type === 'month') {
return `${value}`;
}
if (type === 'day') {
return `${value}`;
}
return value;
},
},
showTimePicker() {
this.setData({ timeShow: true });
},
hideTimePicker() {
this.setData({ timeShow: false });
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let _this = this let _this = this
// 获取一月后时间,默认只能选一个月之后
const today = new Date()
const newDate = new Date(today)
newDate.setMonth(newDate.getMonth() + 1)
let userDetail = wx.getStorageSync('user') let userDetail = wx.getStorageSync('user')
_this.setData({ _this.setData({
userDetail userDetail,
maxDate: newDate.getTime()
}) })
// 展示模块 // 展示模块
_this.visibleBlock() _this.visibleBlock()
}, },
// 跳转会议预约页面
goRes(e) {
wx.navigateTo({
url: '/pages/meeting/meetingReservation/meetingReservation?time=' + e.detail,
})
},
// 跳转菜单 // 跳转菜单
jumpMenu(e) { jumpMenu(e) {
console.log('jumpMenu', e); console.log('jumpMenu', e);
let obj = e.currentTarget.dataset.obj let obj = e.currentTarget.dataset.obj
console.log(obj.path)
if (obj.visible) { if (obj.visible) {
// 未授权
if (obj.name == '会议预约') {
// 会议预约需要先选择时间
this.showTimePicker()
} else {
wx.navigateTo({ wx.navigateTo({
url: obj.path, url: obj.path,
}) })
}
} else {
if (obj.name === '会议预约') {
// 未授权
app.selfShowMsg('您暂无权限使用该功能请联系机关事务局XXX电话15888888888进行赋权后使用')
} else { } else {
app.vantNotifyErrTop(Notify, `"${obj.name}"无权限访问!`) app.vantNotifyErrTop(Notify, `"${obj.name}"无权限访问!`)
return return
} }
}
}, },
// 展示模块 // 展示模块

View File

@ -2,6 +2,8 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"usingComponents": { "usingComponents": {
"van-icon": "@vant/weapp/icon/index", "van-icon": "@vant/weapp/icon/index",
"van-notify": "@vant/weapp/notify/index" "van-notify": "@vant/weapp/notify/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-popup": "@vant/weapp/popup/index"
} }
} }

View File

@ -6,7 +6,7 @@
<view class="maskView3"></view> <view class="maskView3"></view>
<view class="homeView" bind:tap="back"> <view class="homeView" bind:tap="back">
<van-icon name="wap-home-o" size="30rpx" color="#ffffff"/> <van-icon name="wap-home-o" size="30rpx" color="#ffffff" />
</view> </view>
<view class="title">会议系统</view> <view class="title">会议系统</view>
@ -30,3 +30,7 @@
<!-- 消息通知 --> <!-- 消息通知 -->
<van-notify id="van-notify" /> <van-notify id="van-notify" />
<van-popup show="{{ timeShow }}" bind:close="hideTimePicker" position="bottom" round="true">
<van-datetime-picker title="请选择会议日期" type="date" value="{{ currentDate }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" formatter="{{ formatter }}" bind:confirm="goRes" bind:cancel="hideTimePicker" />
</van-popup>

View File

@ -15,13 +15,54 @@ Page({
data: { data: {
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
roomDataList: {}, roomDataList: {},
date: '',
queryParam: { queryParam: {
timeRangeDict: {
list: [{
text: '全天',
value: null
}, {
text: '上午',
value: 1
}, {
text: '下午',
value: 2
}, {
text: '晚上',
value: 3
}],
value: null,
},
meetingTypeDict: { meetingTypeDict: {
list: [], list: [],
value: null, value: null,
}, },
personDict: { personDict: {
list: [], list: [{
text: "人数",
value: null
}, {
text: "0-10",
value: 1
}, {
text: "11-20",
value: 2
}, {
text: "21-30",
value: 3
}, {
text: "31-40",
value: 4
}, {
text: "41-50",
value: 5
}, {
text: "50-100",
value: 6
}, {
text: "100以上",
value: 7
}],
value: null, value: null,
}, },
itemDict: { itemDict: {
@ -46,7 +87,22 @@ Page({
title: options.name title: options.name
}) })
} }
const time = options.time
if (!time || time === '') {
app.selfShowMsg('请选择时间!', '/pages/meeting/index/index')
return
}
this.setData({
date: time
})
const _date = new Date(parseInt(time))
const _year = _date.getFullYear()
const _month = _date.getMonth() + 1 // 月份从0开始需要+1
const _day = _date.getDate()
// 设置标题
wx.setNavigationBarTitle({
title: _year + '年' + _month + '月' + _day + '日'
})
// 初始化数据 // 初始化数据
this.initData(); this.initData();
}, },
@ -76,27 +132,27 @@ Page({
}) })
console.log('meetingRoomDict("1")=>', list); console.log('meetingRoomDict("1")=>', list);
}) })
meetingRoomDict("2").then(res => { // meetingRoomDict("2").then(res => {
console.log('meetingRoomDict("2")', res); // console.log('meetingRoomDict("2")', res);
// 封装参数 // // 封装参数
let list = res.roomContents.map(item => { // let list = res.roomContents.map(item => {
return { // return {
text: item.capacityNum + '人', // text: item.capacityNum + '人',
value: item.capacityNum // value: item.capacityNum
} // }
}) // })
list = [{ // list = [{
text: "人数", // text: "人数",
value: null // value: null
}, ...list] // }, ...list]
// 赋值参数 // // 赋值参数
let queryParam = _this.data.queryParam; // let queryParam = _this.data.queryParam;
queryParam.personDict.list = list; // queryParam.personDict.list = list;
_this.setData({ // _this.setData({
queryParam // queryParam
}) // })
console.log('meetingRoomDict("2")=>', list); // console.log('meetingRoomDict("2")=>', list);
}) // })
meetingRoomDict("3").then(res => { meetingRoomDict("3").then(res => {
console.log('meetingRoomDict("3")', res); console.log('meetingRoomDict("3")', res);
// 封装参数 // 封装参数
@ -135,7 +191,6 @@ Page({
}) })
console.log('meetingRoomDict("4")=>', list); console.log('meetingRoomDict("4")=>', list);
}) })
// 数据-会议室列表 // 数据-会议室列表
this.meetingRoomList() this.meetingRoomList()
}, },
@ -199,16 +254,16 @@ Page({
"capacityNum": queryParam.personDict.value, "capacityNum": queryParam.personDict.value,
"roomItemList": roomItemList, "roomItemList": roomItemList,
"shape": queryParam.shapeDict.value, "shape": queryParam.shapeDict.value,
timeRange: queryParam.timeRangeDict.value
} }
// 会议室列表数据 // 会议室列表数据
meetingRoomListRq(param).then(res => { meetingRoomListRq(param).then(res => {
console.log('meetingRoomListRq', res); console.log('meetingRoomListRq', res);
let roomArr = {} let roomArr = {}
let valueObj = res.rows let valueObj = res.rows
for(let key in valueObj) { for (let key in valueObj) {
let eachObj = valueObj[key] let eachObj = valueObj[key]
if (eachObj['type'] in roomArr) { if (eachObj['type'] in roomArr) {} else {
} else {
roomArr[eachObj['type']] = { roomArr[eachObj['type']] = {
name: eachObj['typeName'], name: eachObj['typeName'],
list: [] list: []
@ -216,6 +271,7 @@ Page({
} }
roomArr[eachObj['type']]['list'].push(eachObj) roomArr[eachObj['type']]['list'].push(eachObj)
} }
// console.log(roomArr)
_this.setData({ _this.setData({
roomDataList: roomArr roomDataList: roomArr
}) })
@ -224,18 +280,12 @@ Page({
// 会议室 // 会议室
jumpMeetingRoom(e) { jumpMeetingRoom(e) {
console.log('jumpMeetingRoom', e); console.log('jumpMeetingRoom', e)
if (e.currentTarget.dataset.id == 47) { let timeRange = this.data.queryParam.timeRangeDict.value
Notify({ timeRange = timeRange ? timeRange : 0
type: 'danger',
message: '内部会议室不可预约',
duration: 3 * 1000,
});
return
}
// 跳转预约详情 // 跳转预约详情
wx.navigateTo({ wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingRoom?id=" + e.currentTarget.dataset.id, url: "/pages/meeting/meetingRoom/meetingRoom?id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange,
}) })
}, },

View File

@ -3,6 +3,8 @@
<!-- 筛选条件 --> <!-- 筛选条件 -->
<view class="queryView"> <view class="queryView">
<van-dropdown-menu active-color="#4e96f8"> <van-dropdown-menu active-color="#4e96f8">
<!-- 时间范围 -->
<van-dropdown-item value="{{ queryParam.timeRangeDict.value }}" options="{{ queryParam.timeRangeDict.list }}" bind:change="dictChange" data-type="timeRangeDict" />
<!-- 字典-会议室 --> <!-- 字典-会议室 -->
<van-dropdown-item value="{{ queryParam.meetingTypeDict.value }}" options="{{ queryParam.meetingTypeDict.list }}" bind:change="dictChange" data-type="meetingTypeDict" /> <van-dropdown-item value="{{ queryParam.meetingTypeDict.value }}" options="{{ queryParam.meetingTypeDict.list }}" bind:change="dictChange" data-type="meetingTypeDict" />
<!-- 字典-人数 --> <!-- 字典-人数 -->

View File

@ -20,14 +20,21 @@ Page({
*/ */
data: { data: {
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
date: '',
dateText: '',
timeRange: '',
timeRangeText: '',
meetingRoomId: null, meetingRoomId: null,
minTime: null, minTime: null,
maxTime: null, maxTime: null,
endMaxTime: null, endMinTime: null, // 结束时间最小小时(与开始时间联动)
endMaxTime: null, // 结束时间最大小时(根据范围固定)
startTime: null, startTime: null,
endTime: null, endTime: null,
showTime: false, showTime: true,
showRangePicker: false,
dataList: [], dataList: [],
rangeOp: [],
filterTime(type, options) { filterTime(type, options) {
// if (type === 'minute') { // if (type === 'minute') {
// return options.filter((option) => option == '00'); // return options.filter((option) => option == '00');
@ -35,12 +42,39 @@ Page({
return options; return options;
}, },
}, },
showRange() {
this.setData({
showRangePicker: true
});
},
hideRange() {
this.setData({
showRangePicker: false
});
},
rangePick(e) {
let _this = this
let value = e.detail.value
let _timeRange = ''
if (value === '上午') {
_timeRange = 1
} else if (value === '下午') {
_timeRange = 2
} else if (value === '晚上') {
_timeRange = 3
}
_this.setData({
timeRange: _timeRange,
timeRangeText: value,
showRangePicker: false
})
_this.initParamTime()
},
// 选择-开始时间 // 选择-开始时间
onInputStartTime(event) { onInputStartTime(event) {
this.setData({ this.setData({
startTime: event.detail, startTime: event.detail,
}); })
this.setEndMaxTime(event.detail) this.setEndMaxTime(event.detail)
}, },
@ -54,103 +88,183 @@ Page({
// 预约时间 // 预约时间
reservationTime() { reservationTime() {
this.setData({ // this.setData({
showTime: true // showTime: true
}) // })
}, },
// 确认时间 // 确认时间
confirmTime() { confirmTime() {
let _this = this; let _this = this;
let meetingRoomId = _this.data.meetingRoomId; let date = this.data.date
let startTime = _this.data.startTime; let meetingRoomId = _this.data.meetingRoomId
let endTime = _this.data.endTime; let startTime = _this.data.startTime
let endTime = _this.data.endTime
// 计算时间戳
let startTimeArr = startTime.split(':')
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); let paramUrl = "?meetingRoomId=" + meetingRoomId + "&startTime=" + selfFormatTimeYMDHMS(startTime) + "&endTime=" + selfFormatTimeYMDHMS(endTime);
// 结束时间不能小于开始时间
if (startTime >= endTime) {
Notify('结束时间不能小于开始时间!')
return
}
// // 预约时间不能小于1小时
// if ((1000 * 60 * 60) > (endTime - startTime)) {
// Notify({
// type: 'danger',
// message: '预约时间不能小于1小时',
// duration: 1000,
// selector: '#notify',
// });
// return
// }
// 当前会议室是否可以预约
selectFreeMeetingRoomRq({
"roomContentId": meetingRoomId,
"startTime": selfFormatTimeYMDHMS(startTime),
"endDate": selfFormatTimeYMDHMS(endTime)
}).then(res => {
console.log('selectFreeMeetingRoomRq', res);
// 可以预约
if (!res.count) {
wx.navigateTo({ wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingOrder/meetingOrder" + paramUrl, url: "/pages/meeting/meetingRoom/meetingOrder/meetingOrder" + paramUrl,
}) })
_this.setData({
showTime: false // // 当前会议室是否可以预约
}) // selectFreeMeetingRoomRq({
} else { // 不能预约 // "roomContentId": meetingRoomId,
Notify({ // "startTime": selfFormatTimeYMDHMS(startTime),
type: 'danger', // "endDate": selfFormatTimeYMDHMS(endTime)
message: res.msg, // }).then(res => {
duration: 1000, // console.log('selectFreeMeetingRoomRq', res);
selector: '#notify', // // 可以预约
}); // if (!res.count) {
} // wx.navigateTo({
}) // url: "/pages/meeting/meetingRoom/meetingOrder/meetingOrder" + paramUrl,
// })
// // _this.setData({
// // showTime: false
// // })
// } else { // 不能预约
// Notify({
// type: 'danger',
// message: res.msg,
// duration: 1000,
// selector: '#notify',
// });
// }
// })
}, },
// 取消时间 // 取消时间
cancelTime() { cancelTime() {
this.setData({ // this.setData({
showTime: false // showTime: false
}) // })
}, },
// 初始化时间 // 初始化时间
initParamTime() { initParamTime() {
let maxTime = new Date(); let _date = this.data.date
maxTime.setFullYear(maxTime.getFullYear() + 3) _date = parseInt(_date)
let _timeRange = this.data.timeRange
_timeRange = parseInt(_timeRange)
let _minTime = ''
let _maxTime = ''
let _startTime = ''
if (_timeRange === 1) {
// 上午从600 - 1200
_minTime = 6
_maxTime = 11
_startTime = '8:30'
} else if (_timeRange === 2) {
// 下午从1200 - 1800
_minTime = 12
_maxTime = 17
_startTime = '14:00'
} else if (_timeRange === 3) {
// 下午从1200 - 1800
_minTime = 18
_maxTime = 23
_startTime = '18:00'
}
// let maxTime = new Date(_date)
// maxTime.setFullYear(maxTime.getFullYear() + 3)
this.setData({ this.setData({
maxTime: maxTime.getTime() // startTime: _startTime,
minTime: _minTime,
maxTime: _maxTime
// maxTime: maxTime.getTime()
}) })
this.setEndMaxTime(this.data.startTime) // this.setEndMaxTime(this.data.startTime)
// 设置最小时间 // 设置最小时间
this.setMinTime() // this.setMinTime()
}, },
// 设置最小时间 // 设置最小时间
setMinTime() { // setMinTime() {
// let minTime = new Date(selfFormatTimeYMDH(new Date()) + ':00:00').getTime() // // let minTime = new Date(selfFormatTimeYMDH(new Date()) + ':00:00').getTime()
let minTime = new Date().getTime() // let minTime = new Date().getTime()
this.setData({ // this.setData({
minTime, // minTime,
startTime: minTime // startTime: minTime
}) // })
}, // },
// 指定天的最后一秒 // 获取结束时间的最大时间和最小时间
setEndMaxTime(time) { setEndMaxTime(time) {
let endMaxTime = new Date(new Date(time).toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1; let timeArr = time.split(':')
// let endMaxTime = new Date(new Date(time).toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
let _endMinTime = timeArr[0]
let _endMaxTime = ''
let _timeRange = this.data.timeRange
_timeRange = parseInt(_timeRange)
if (_timeRange === 1) {
// 上午从600 - 1200
_endMaxTime = 11
} else if (_timeRange === 2) {
// 下午从1200 - 1800
_endMaxTime = 17
} else if (_timeRange === 3) {
// 下午从1200 - 1800
_endMaxTime = 23
}
this.setData({ this.setData({
endMaxTime: endMaxTime endMinTime: _endMinTime,
endMaxTime: _endMaxTime
}) })
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
console.log('onLoad', options); console.log('onLoad', options);
let time = options.time
let _timeRange = options.timeRange
let _rangeOp = []
let _timeRangeText = ''
if (_timeRange === '0') {
// 全天此时默认给1上午
_timeRange = '1'
}
if (_timeRange === '1') {
_timeRangeText = '上午'
} else if (_timeRange === '2') {
_timeRangeText = '下午'
} else if (_timeRange === '3') {
_timeRangeText = '晚上'
}
if (options.timeRange === '0') {
// 全天,则三个都可选
_rangeOp = ['上午', '下午', '晚上']
} else {
_rangeOp = [_timeRangeText]
}
const _date = new Date(parseInt(time))
const _year = _date.getFullYear()
const _month = _date.getMonth() + 1 // 月份从0开始需要+1
const _day = _date.getDate()
// 获取传递参数 // 获取传递参数
this.setData({ this.setData({
...options meetingRoomId: options.meetingRoomId,
date: time,
dateText: _year + '年' + _month + '月' + _day + '日',
timeRange: _timeRange,
timeRangeText: _timeRangeText,
rangeOp: _rangeOp
}) })
// minTime: null,
// maxTime: null,
// endMaxTime: null,
// startTime: null,
// endTime: null,
// 初始化时间 // 初始化时间
this.initParamTime() this.initParamTime()
}, },
@ -166,26 +280,26 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
console.log('onShow', 111); // console.log('onShow', 111);
let _this = this; let _this = this;
meetingRoomBookedRecordRq(this.data.meetingRoomId).then(res => { // meetingRoomBookedRecordRq(this.data.meetingRoomId).then(res => {
console.log('meetingRoomBookedRecordRq', res); // console.log('meetingRoomBookedRecordRq', res);
let dataList = res.data; // let dataList = res.data;
dataList.map(item => { // dataList.map(item => {
item.nowDate = item.nowDate.substring(0, 10); // item.nowDate = item.nowDate.substring(0, 10);
item.reservations = item.reservations.map(record => { // item.reservations = item.reservations.map(record => {
record.startTime = record.startTime.substring(11) // record.startTime = record.startTime.substring(11)
record.endDate = record.endDate.substring(11) // record.endDate = record.endDate.substring(11)
record.userName = record.userName.substring(0,1) + "某" // record.userName = record.userName.substring(0, 1) + "某"
record.phone = record.phone.substring(0,3) + "****" + record.phone.substring(7,record.phone.length) // record.phone = record.phone.substring(0, 3) + "****" + record.phone.substring(7, record.phone.length)
return record; // return record;
}) // })
return item // return item
}) // })
_this.setData({ // _this.setData({
dataList // dataList
}) // })
}) // })
}, },
/** /**

View File

@ -3,7 +3,10 @@
"van-datetime-picker": "@vant/weapp/datetime-picker/index", "van-datetime-picker": "@vant/weapp/datetime-picker/index",
"van-popup": "@vant/weapp/popup/index", "van-popup": "@vant/weapp/popup/index",
"van-notify": "@vant/weapp/notify/index", "van-notify": "@vant/weapp/notify/index",
"van-icon": "@vant/weapp/icon/index" "van-icon": "@vant/weapp/icon/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-picker": "@vant/weapp/picker/index"
}, },
"navigationBarTitleText": "会议室已预约" "navigationBarTitleText": "预约会议室"
} }

View File

@ -1,67 +1,40 @@
<view class="containerView public"> <view class="containerView">
<view class="dataView">
<!-- 标题 -->
<view class="leftLineTitle">会议预约情况</view>
<!-- 预约列表 -->
<view class="itemVIew" wx:for="{{dataList}}" wx:for-item="item" wx:key="*this">
<view class="item">{{item.nowDate}}</view>
<view class="itemTimeCellView" wx:for="{{item.reservations}}" wx:for-item="record" wx:key="*this">
<view class="itemTimeView">
<view class="time">{{record.startTime}}~{{record.endDate}}</view>
<view class="status">已预约</view>
</view>
<view class="personView">
<view class="name">
<van-icon name="manager-o" size="30rpx" />
<view class="content">预约人:{{record.userName}}</view>
</view>
<view class="phone">
<van-icon name="phone-o" size="30rpx" />
<view class="content">联系电话:{{record.phone}}</view>
</view>
</view>
</view>
</view>
<!-- 没有记录 -->
<view class="noneView" wx:if="{{dataList.length <= 0}}">
<image class="img" src="{{IMG_NAME + '/profile/static/meeting/reservationRecord/none.png'}}" mode="aspectFill"></image>
<view class="describe">暂无记录</view>
</view>
</view>
<!-- 预约时间 -->
<view class="submitBtn" bind:tap="reservationTime">预约时间</view>
<!-- 选择时间 --> <!-- 选择时间 -->
<view class="selfPop" wx:if="{{showTime}}"> <view class="selfPop" wx:if="{{showTime}}">
<view wx:if="{{rangeOp.length > 1}}">
<view class="labelView">
<view class="leftLineTitle">请选择时间范围</view>
</view>
<van-cell bind:tap="showRange" title="{{dateText}}" is-link value="{{timeRangeText}}" arrow-direction="down" />
</view>
<view wx:if="{{rangeOp.length == 1}}">
<view class="labelView">
<view class="leftLineTitle">会议时间范围</view>
</view>
<van-cell title="{{dateText}}" value="{{timeRangeText}}" />
</view>
<view class="labelView"> <view class="labelView">
<view class="leftLineTitle">请选择开始时间</view> <view class="leftLineTitle">请选择开始时间</view>
</view> </view>
<view class="labelTimeView"> <view class="labelTimeView">
<view>年</view> <view style="width: 50%;text-align: center;">时</view>
<view>月</view> <view style="width: 50%;text-align: center;">分</view>
<view>日</view>
<view>时</view>
<view>分</view>
</view> </view>
<van-datetime-picker type="datetime" visible-item-count="5" value="{{ startTime }}" min-date="{{ minTime }}" max-date="{{ maxTime }}" bind:input="onInputStartTime" bind:confirm="confirmTime" bind:cancel="cancelTime" confirm-button-text="" cancel-button-text="" filter="{{ filterTime }}" /> <van-datetime-picker type="time" visible-item-count="4" value="{{ startTime }}" min-hour="{{ minTime }}" max-hour="{{ maxTime }}" bind:input="onInputStartTime" confirm-button-text="" cancel-button-text="" filter="{{ filterTime }}" show-toolbar="{{false}}" />
<view class="labelView"> <view class="labelView">
<view class="leftLineTitle">请选择结束时间</view> <view class="leftLineTitle">请选择结束时间</view>
<view class="enter" bind:tap="confirmTime">确定</view>
</view> </view>
<view class="labelTimeView"> <view class="labelTimeView">
<view>年</view> <view style="width: 50%;text-align: center;">时</view>
<view>月</view> <view style="width: 50%;text-align: center;">分</view>
<view>日</view>
<view>时</view>
<view>分</view>
</view> </view>
<van-datetime-picker type="datetime" visible-item-count="4" value="{{ endTime }}" min-date="{{ startTime }}" max-date="{{ endMaxTime }}" bind:input="onInputEndTime" bind:confirm="confirmTime" confirm-button-text="" cancel-button-text="" bind:cancel="cancelTime" filter="{{ filterTime }}" /> <van-datetime-picker type="time" visible-item-count="4" value="{{ endTime }}" min-hour="{{ endMinTime }}" max-hour="{{ endMaxTime }}" bind:input="onInputEndTime" confirm-button-text="" cancel-button-text="" show-toolbar="{{false}}" filter="{{ filterTime }}" />
</view> </view>
<view class="submitBtn" bind:tap="confirmTime">确认时间</view>
<van-popup show="{{ showRangePicker }}" bind:close="hideRange" position="bottom">
<van-picker show-toolbar title="请选择会议时段" bind:cancel="hideRange" bind:confirm="rangePick" columns="{{ rangeOp }}" />
</van-popup>
<!-- 消息提示 --> <!-- 消息提示 -->
<van-notify id="notify" /> <van-notify id="van-notify" />
</view> </view>

View File

@ -1,6 +1,6 @@
.containerView.public { /* .containerView.public {
padding-bottom: 300rpx; padding-bottom: 300rpx;
} } */
.dataView { .dataView {
padding: 20rpx; padding: 20rpx;
@ -82,7 +82,7 @@
left: 0; left: 0;
top: 0; top: 0;
background: #ffffff; background: #ffffff;
transition: 1s all; /* transition: 1s all; */
} }
.selfPop .labelView { .selfPop .labelView {
@ -105,7 +105,7 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
font-size: 34rpx; font-size: 34rpx;
padding: 20rpx 60rpx; padding: 20rpx 0rpx;
} }

View File

@ -1,7 +1,7 @@
<view class="containerView"> <view class="containerView">
<!-- 轮播图 --> <!-- 轮播图 -->
<view class="swiperView"> <view class="swiperView">
<view class="tag">会议室</view> <view class="tag">{{room.meetingName}}</view>
<swiper class='swiper-box' indicator-dots autoplay interval="3000" duration="1000" circular='true'> <swiper class='swiper-box' indicator-dots autoplay interval="3000" duration="1000" circular='true'>
<swiper-item wx:for="{{bannerList}}" wx:key="index"> <swiper-item wx:for="{{bannerList}}" wx:key="index">
<image class="img" src="{{IMG_NAME + item}}" mode="aspectFill"></image> <image class="img" src="{{IMG_NAME + item}}" mode="aspectFill"></image>
@ -12,9 +12,10 @@
<!-- 详细信息 --> <!-- 详细信息 -->
<view class="meetingDetailView"> <view class="meetingDetailView">
<view class="detailView"> <view class="detailView">
<view class="title">{{room.capacityNum}}人间 | {{room.roomName}} | {{room.buildingName}}</view> <view class="title">{{room.buildingName}} | {{room.roomName}} | {{room.capacityNum}}人 | {{room.shape}}</view>
<view class="itemList"> <view class="itemList">
<view class="item" wx:for="{{room.roomItemList}}" wx:for-item="roomItem" wx:key="*this">#{{roomItem.name}}</view> <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>
</view> </view>
</view> </view>
<!-- <view class="priceView"> <!-- <view class="priceView">

View File

@ -13,9 +13,25 @@ Page({
data: { data: {
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
meetingRoomId: null, meetingRoomId: null,
date: '',
timeRange: '',
detail: {}, detail: {},
bannerList: [], bannerList: [],
mapData: {} mapData: {},
resList: [{
date: '2024年9月18日',
time: '14:00 - 17:30',
user: '王XX',
dep: '司法局',
tel: '15811111111'
},{
date: '2024年9月19日',
time: '14:00 - 17:30',
user: '王XX',
dep: '司法局',
tel: '15811111111'
}],
canRes: true // 是否允许预约
}, },
/** /**
@ -24,6 +40,12 @@ Page({
onLoad(options) { onLoad(options) {
let _this = this; let _this = this;
console.log('onLoad', options); console.log('onLoad', options);
let time = options.time
let timeRange = options.timeRange
_this.setData({
date: time,
timeRange: timeRange
})
let meetingRoomId = options.id; let meetingRoomId = options.id;
meetingRoomDetailRq(meetingRoomId).then(res => { meetingRoomDetailRq(meetingRoomId).then(res => {
console.log('meetingRoomDetailRq', res); console.log('meetingRoomDetailRq', res);
@ -43,10 +65,10 @@ Page({
}) })
}) })
// 获取地址信息 // 获取地址信息
_this.getAddress() // _this.getAddress()
}, },
// 获取地址信息 // 获取地址信息(不需要地址)
getAddress() { getAddress() {
let _this = this; let _this = this;
selectCoordinateRq().then(res => { selectCoordinateRq().then(res => {
@ -88,8 +110,10 @@ Page({
// 跳转-会议室已预约 // 跳转-会议室已预约
jumpMeetingBooked() { jumpMeetingBooked() {
let meetingRoomId = this.data.meetingRoomId; let meetingRoomId = this.data.meetingRoomId;
let time = this.data.date
let timeRange = this.data.timeRange
wx.navigateTo({ wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingBooked/meetingBooked?meetingRoomId=" + meetingRoomId, url: "/pages/meeting/meetingRoom/meetingBooked/meetingBooked?meetingRoomId=" + meetingRoomId + '&time=' + time + '&timeRange=' + timeRange,
}) })
}, },

View File

@ -1,6 +1,8 @@
{ {
"usingComponents": { "usingComponents": {
"van-icon": "@vant/weapp/icon/index" "van-icon": "@vant/weapp/icon/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index"
}, },
"navigationBarTitleText": "会议室" "navigationBarTitleText": "会议室"
} }

View File

@ -1,35 +1,38 @@
<view class="containerView public"> <view class="containerView public">
<!-- 轮播图 --> <!-- 轮播图 -->
<view class="swiperView">
<view class="tag">{{detail.meetingName}}</view>
<swiper class='swiper-box' indicator-dots autoplay interval="3000" duration="1000" circular='true'> <swiper class='swiper-box' indicator-dots autoplay interval="3000" duration="1000" circular='true'>
<swiper-item wx:for="{{bannerList}}" wx:key="index"> <swiper-item wx:for="{{bannerList}}" wx:key="index">
<image class="img" src="{{IMG_NAME + item}}" mode="aspectFill"></image> <image class="img" src="{{IMG_NAME + item}}" mode="aspectFill"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view>
<view class="meetingDetailView">
<view class="detailView">
<view class="title">{{detail.buildingName}} | {{detail.roomName}} | {{detail.capacityNum}}人 | {{detail.shape}}</view>
<view class="itemList">
<view class="item" wx:for="{{detail.roomItemList}}" wx:for-item="serviceItem" wx:key="*this">#{{serviceItem.name}}</view>
<view class="item" wx:for="{{detail.roomServeList}}" wx:for-item="serveItem" wx:key="*this">#{{serveItem.serveName}}</view>
</view>
</view>
</view>
<!-- 会议室详细信息 --> <!-- 会议室详细信息 -->
<view class="roomView"> <view class="facilitiesView">
<!-- 类型信息 --> <view class="leftLineTitle">会议室描述</view>
<view class="typeView"> <view class="content">{{detail.content ? detail.content : '无描述'}}</view>
<view class="typeItem">
<view class="name">所在楼层</view>
<view class="value">{{detail.buildingName}}</view>
</view>
<view class="typeItem">
<view class="name">空间面积</view>
<view class="value">{{detail.renArea}}m</view>
</view>
<view class="typeItem">
<view class="name">形式</view>
<view class="value">{{detail.shape}}</view>
</view>
</view> </view>
<!-- 文字内容 --> <view class="resView">
<view class="content">{{detail.content ? detail.content : ''}}</view> <view class="leftLineTitle">预约情况</view>
<van-cell-group>
<van-cell wx:for="{{resList}}" title="{{item.date}}" value="{{item.time}}" label="{{item.dep}} | {{item.user}} | {{item.tel}}" />
</van-cell-group>
</view> </view>
<!-- 设施 --> <!-- 设施 -->
<view class="facilitiesView"> <!-- <view class="facilitiesView">
<view class="leftLineTitle">空间设施</view> <view class="leftLineTitle">空间设施</view>
<view class="itemView"> <view class="itemView">
<view class="singleItem" wx:for="{{detail.roomItemList}}" wx:for-item="serviceItem" wx:key="*this"> <view class="singleItem" wx:for="{{detail.roomItemList}}" wx:for-item="serviceItem" wx:key="*this">
@ -37,7 +40,7 @@
<view class="name">{{serviceItem.name}}</view> <view class="name">{{serviceItem.name}}</view>
</view> </view>
</view> </view>
</view> </view> -->
<!-- 价格 --> <!-- 价格 -->
<!-- <view class="priceView"> <!-- <view class="priceView">
@ -50,12 +53,11 @@
</view> --> </view> -->
<!-- 地图 --> <!-- 地图 -->
<view class="mapView"> <!-- <view class="mapView">
<view class="leftLineTitle">会议地点</view> <view class="leftLineTitle">会议地点</view>
<map class="myMap" latitude="{{mapData.latitude}}" longitude="{{mapData.longitude}}" markers="{{mapData.markers}}" show-location bindtap="openMap"></map> <map class="myMap" latitude="{{mapData.latitude}}" longitude="{{mapData.longitude}}" markers="{{mapData.markers}}" show-location bindtap="openMap"></map>
</view> </view> -->
<!-- 预约 --> <!-- 预约 -->
<view class="submitBtn" bind:tap="jumpMeetingBooked">会议预约</view> <view wx:if="canRes" class="submitBtn" bind:tap="jumpMeetingBooked">会议预约</view>
</view> </view>

View File

@ -2,6 +2,24 @@
padding-bottom: 200rpx; padding-bottom: 200rpx;
} }
.swiperView {
position: relative;
}
.swiperView .tag {
position: absolute;
left: 22rpx;
top: 20rpx;
background: #76aef9;
font-size: 28rpx;
color: white;
font-weight: bold;
padding: 10rpx 40rpx;
border-top-right-radius: 6rpx;
border-bottom-right-radius: 6rpx;
z-index: 1;
}
.swiper-box { .swiper-box {
border-radius: 14rpx; border-radius: 14rpx;
box-sizing: border-box; box-sizing: border-box;
@ -43,6 +61,56 @@
width: 40rpx; width: 40rpx;
} }
.meetingDetailView {
display: flex;
justify-content: space-between;
align-items: center;
margin: 30rpx 22rpx;
padding: 0 16rpx;
}
.meetingDetailView .detailView {
flex: 1;
word-break: break-all;
margin-right: 20rpx;
}
.meetingDetailView .detailView .title {
font-size: 32rpx;
font-weight: 700;
}
.meetingDetailView .detailView .itemList {
display: flex;
flex-wrap: wrap;
justify-content: start;
align-items: center;
margin-top: 14rpx;
font-size: 26rpx;
color: gray;
}
.meetingDetailView .detailView .itemList .item {
margin-right: 12rpx;
}
.meetingDetailView .priceView {
display: flex;
justify-content: start;
align-items: flex-end;
line-height: 1;
}
.meetingDetailView .priceView .price {
font-size: 36rpx;
color: red;
}
.meetingDetailView .priceView .unit {
font-size: 24rpx;
}
.roomView { .roomView {
margin-top: 30rpx; margin-top: 30rpx;
} }
@ -88,6 +156,11 @@
margin: 50rpx 20rpx; margin: 50rpx 20rpx;
} }
.facilitiesView .content {
margin: 40rpx 20rpx 0;
font-size: 26rpx;
}
.facilitiesView .itemView { .facilitiesView .itemView {
display: flex; display: flex;
justify-content: start; justify-content: start;
@ -146,3 +219,22 @@
height: 500rpx; height: 500rpx;
} }
.roomView .device {
margin: 40rpx 20rpx 0;
font-size: 26rpx;
}
.roomView .device .deviceName {
float: left;
color: grey;
}
.resView {
margin: 50rpx 20rpx;
}
.resView .leftLineTitle{
margin-bottom: 30rpx;
}
.resView .content {
margin: 40rpx 20rpx 0;
font-size: 26rpx;
}