会议功能修改

完成会议首页、会议室列表页、会议室详情页、会议预约时间选择功能
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

@ -4,145 +4,186 @@ import Notify from '@vant/weapp/notify/notify';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
userDetail: {}, userDetail: {},
menuList: [{ menuList: [{
type: "report", type: "report",
name: "会议预约", name: "会议预约",
img: "/profile/static/repair/index/my.png", img: "/profile/static/repair/index/my.png",
path: "/pages/meeting/meetingReservation/meetingReservation", path: "/pages/meeting/meetingReservation/meetingReservation",
visible: true visible: true
}, { }, {
type: "query", type: "query",
name: "预约记录", name: "预约记录",
img: "/profile/static/repair/index/query.png", img: "/profile/static/repair/index/query.png",
path: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord", path: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord",
visible: true visible: true
}, { }, {
type: "assign", type: "assign",
name: "会议审核", name: "会议审核",
img: "/profile/static/repair/index/case.png", img: "/profile/static/repair/index/case.png",
path: "/pages/meeting/visitorIinvitation/list/list", path: "/pages/meeting/visitorIinvitation/list/list",
visible: false visible: false
}, { }, {
type: "repair", type: "repair",
name: "会务服务", name: "会务服务",
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 });
*/ },
onLoad(options) { hideTimePicker() {
let _this = this this.setData({ timeShow: false });
let userDetail = wx.getStorageSync('user') },
_this.setData({ /**
userDetail * 生命周期函数--监听页面加载
}) */
// 展示模块 onLoad(options) {
_this.visibleBlock() let _this = this
}, // 获取一月后时间,默认只能选一个月之后
const today = new Date()
// 跳转菜单 const newDate = new Date(today)
jumpMenu(e) { newDate.setMonth(newDate.getMonth() + 1)
console.log('jumpMenu', e); let userDetail = wx.getStorageSync('user')
let obj = e.currentTarget.dataset.obj _this.setData({
console.log(obj.path) userDetail,
if (obj.visible) { maxDate: newDate.getTime()
wx.navigateTo({ })
url: obj.path,
})
} else {
app.vantNotifyErrTop(Notify, `"${obj.name}"无权限访问!`)
return
}
},
// 展示模块 // 展示模块
visibleBlock() { _this.visibleBlock()
let _this = this },
let userDetail = _this.data.userDetail // 跳转会议预约页面
let dataType = userDetail.dataType goRes(e) {
let menuList = _this.data.menuList wx.navigateTo({
// 角色类型 1.普通用户3派单员5维修工7管理员 , 9楼层 url: '/pages/meeting/meetingReservation/meetingReservation?time=' + e.detail,
// if (dataType == 3 || dataType == 7) { // 展示-派单入口,仅有派单员、管理员能进 })
// menuList = menuList.map(item => { },
// if (item.type == 'assign') { // 跳转菜单
// item.visible = true jumpMenu(e) {
// } console.log('jumpMenu', e);
// return item let obj = e.currentTarget.dataset.obj
// }) if (obj.visible) {
// } // 未授权
// if (dataType == 5) { // 展示-维修入口 if (obj.name == '会议预约') {
// menuList = menuList.map(item => { // 会议预约需要先选择时间
// if (item.type == 'repair') { this.showTimePicker()
// item.visible = true } else {
// } wx.navigateTo({
// return item url: obj.path,
// }) })
// } }
// _this.setData({ } else {
// menuList if (obj.name === '会议预约') {
// }) // 未授权
}, app.selfShowMsg('您暂无权限使用该功能请联系机关事务局XXX电话15888888888进行赋权后使用')
} else {
back() { app.vantNotifyErrTop(Notify, `"${obj.name}"无权限访问!`)
wx.navigateBack() return
}, }
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
} }
},
// 展示模块
visibleBlock() {
let _this = this
let userDetail = _this.data.userDetail
let dataType = userDetail.dataType
let menuList = _this.data.menuList
// 角色类型 1.普通用户3派单员5维修工7管理员 , 9楼层
// if (dataType == 3 || dataType == 7) { // 展示-派单入口,仅有派单员、管理员能进
// menuList = menuList.map(item => {
// if (item.type == 'assign') {
// item.visible = true
// }
// return item
// })
// }
// if (dataType == 5) { // 展示-维修入口
// menuList = menuList.map(item => {
// if (item.type == 'repair') {
// item.visible = true
// }
// return item
// })
// }
// _this.setData({
// menuList
// })
},
back() {
wx.navigateBack()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

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

@ -1,32 +1,36 @@
<view class="containerView public"> <view class="containerView public">
<view class="topHead"> <view class="topHead">
<view class="maskView1"></view> <view class="maskView1"></view>
<view class="maskView2" style="background: no-repeat center/cover url({{IMG_NAME + '/profile/static/repair/index/person.png'}});"></view> <view class="maskView2" style="background: no-repeat center/cover url({{IMG_NAME + '/profile/static/repair/index/person.png'}});"></view>
<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 class="title">会议系统</view>
<view class="contentView">
<view class="label1">欢迎进入</view>
<view class="label2">淮安市行政中心会议管理系统</view>
</view>
<view class="logo" style="background: no-repeat center/cover url({{IMG_NAME + '/profile/static/repair/index/logo.png'}});"></view>
</view> </view>
<view class="menuContainerView"> <view class="title">会议系统</view>
<view class="menuView" wx:for="{{menuList}}" wx:key="*this" bind:tap="jumpMenu" data-obj="{{item}}"> <view class="contentView">
<view class="menuImg" style="background: no-repeat center/cover url({{IMG_NAME + item.img}});"></view> <view class="label1">欢迎进入</view>
<view class="menuTitle">{{item.name}}</view> <view class="label2">淮安市行政中心会议管理系统</view>
</view>
</view> </view>
<view class="logo" style="background: no-repeat center/cover url({{IMG_NAME + '/profile/static/repair/index/logo.png'}});"></view>
</view>
<!-- <view class="ownership">{{ownership}}</view> --> <view class="menuContainerView">
<view class="menuView" wx:for="{{menuList}}" wx:key="*this" bind:tap="jumpMenu" data-obj="{{item}}">
<view class="menuImg" style="background: no-repeat center/cover url({{IMG_NAME + item.img}});"></view>
<view class="menuTitle">{{item.name}}</view>
</view>
</view>
<!-- <view class="ownership">{{ownership}}</view> -->
</view> </view>
<!-- 消息通知 --> <!-- 消息通知 -->
<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

@ -1,7 +1,7 @@
const app = getApp() const app = getApp()
import { import {
meetingRoomDict, meetingRoomDict,
meetingRoomListRq, meetingRoomListRq,
} from "../../../api/meeting/meetingRoom.js" } from "../../../api/meeting/meetingRoom.js"
import Notify from '@vant/weapp/notify/notify'; import Notify from '@vant/weapp/notify/notify';
@ -9,282 +9,332 @@ import Notify from '@vant/weapp/notify/notify';
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
roomDataList: {}, roomDataList: {},
queryParam: { date: '',
meetingTypeDict: { queryParam: {
list: [], timeRangeDict: {
value: null, list: [{
}, text: '全天',
personDict: { value: null
list: [], }, {
value: null, text: '上午',
}, value: 1
itemDict: { }, {
list: [], text: '下午',
value: null, value: 2
title: '设备' }, {
}, text: '晚上',
shapeDict: { value: 3
list: [], }],
value: null, value: null,
}, },
} meetingTypeDict: {
}, list: [],
value: null,
/** },
* 生命周期函数--监听页面加载 personDict: {
*/ list: [{
onLoad(options) { text: "人数",
// 页面初始化 options为页面跳转所带来的参数 value: null
if (options.name) { }, {
wx.setNavigationBarTitle({ text: "0-10",
title: options.name value: 1
}) }, {
} text: "11-20",
value: 2
// 初始化数据 }, {
this.initData(); text: "21-30",
}, value: 3
}, {
// 初始化数据 text: "31-40",
initData() { value: 4
let _this = this; }, {
// 1.会议室类型2.人数3.会议室设备4.形式 text: "41-50",
meetingRoomDict("1").then(res => { value: 5
console.log('meetingRoomDict("1")', res); }, {
// 封装参数 text: "50-100",
let list = res.roomContents.map(item => { value: 6
return { }, {
text: item.typeName, text: "100以上",
value: item.typeValue value: 7
} }],
}) value: null,
list = [{ },
text: "楼层", itemDict: {
value: null list: [],
}, ...list] value: null,
// 赋值参数 title: '设备'
let queryParam = _this.data.queryParam; },
queryParam.meetingTypeDict.list = list; shapeDict: {
_this.setData({ list: [],
queryParam value: null,
}) },
console.log('meetingRoomDict("1")=>', list);
})
meetingRoomDict("2").then(res => {
console.log('meetingRoomDict("2")', res);
// 封装参数
let list = res.roomContents.map(item => {
return {
text: item.capacityNum + '人',
value: item.capacityNum
}
})
list = [{
text: "人数",
value: null
}, ...list]
// 赋值参数
let queryParam = _this.data.queryParam;
queryParam.personDict.list = list;
_this.setData({
queryParam
})
console.log('meetingRoomDict("2")=>', list);
})
meetingRoomDict("3").then(res => {
console.log('meetingRoomDict("3")', res);
// 封装参数
let list = res.roomItem.map(item => {
return {
text: item.name,
value: item.id
}
})
// 赋值参数
let queryParam = _this.data.queryParam;
queryParam.itemDict.list = list;
_this.setData({
queryParam
})
console.log('meetingRoomDict("3")=>', list);
})
meetingRoomDict("4").then(res => {
console.log('meetingRoomDict("4")', res);
// 封装参数
let list = res.roomContents.map(item => {
return {
text: item.shape,
value: item.shape
}
})
list = [{
text: "形式",
value: null
}, ...list]
// 赋值参数
let queryParam = _this.data.queryParam;
queryParam.shapeDict.list = list;
_this.setData({
queryParam
})
console.log('meetingRoomDict("4")=>', list);
})
// 数据-会议室列表
this.meetingRoomList()
},
// 查询条件变动
dictChange(e) {
console.log('dictChange', e);
let queryParam = this.data.queryParam;
queryParam[e.currentTarget.dataset.type].value = e.detail;
this.setData({
queryParam
})
// 数据-会议室列表
this.meetingRoomList()
},
// 设备-多选
dictSwitchChange(e) {
console.log('dictSwitchChange', e);
let select = e.detail;
let name = e.currentTarget.dataset.name;
let id = e.currentTarget.dataset.id;
let queryParam = this.data.queryParam;
queryParam.itemDict.list = queryParam.itemDict.list.map(item => {
if (item.value == id) {
item.select = select;
}
return item
})
// 计算选择数量
let selectCount = queryParam.itemDict.list.filter(item => item.select).length;
console.log('selectCount', selectCount);
if (selectCount > 0) {
queryParam.itemDict.title = '设备+' + selectCount;
} else {
queryParam.itemDict.title = '设备';
}
this.setData({
queryParam
})
// 数据-会议室列表
this.meetingRoomList()
},
// 设备多选收起
itemDictConfirm() {
this.selectComponent('#itemSelect').toggle();
},
// 数据-会议室列表
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 param = {
"type": queryParam.meetingTypeDict.value,
"capacityNum": queryParam.personDict.value,
"roomItemList": roomItemList,
"shape": queryParam.shapeDict.value,
}
// 会议室列表数据
meetingRoomListRq(param).then(res => {
console.log('meetingRoomListRq', res);
let roomArr = {}
let valueObj = res.rows
for(let key in valueObj) {
let eachObj = valueObj[key]
if (eachObj['type'] in roomArr) {
} else {
roomArr[eachObj['type']] = {
name: eachObj['typeName'],
list: []
}
}
roomArr[eachObj['type']]['list'].push(eachObj)
}
_this.setData({
roomDataList: roomArr
})
})
},
// 会议室
jumpMeetingRoom(e) {
console.log('jumpMeetingRoom', e);
if (e.currentTarget.dataset.id == 47) {
Notify({
type: 'danger',
message: '内部会议室不可预约',
duration: 3 * 1000,
});
return
}
// 跳转预约详情
wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingRoom?id=" + e.currentTarget.dataset.id,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
} }
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// 页面初始化 options为页面跳转所带来的参数
if (options.name) {
wx.setNavigationBarTitle({
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();
},
// 初始化数据
initData() {
let _this = this;
// 1.会议室类型2.人数3.会议室设备4.形式
meetingRoomDict("1").then(res => {
console.log('meetingRoomDict("1")', res);
// 封装参数
let list = res.roomContents.map(item => {
return {
text: item.typeName,
value: item.typeValue
}
})
list = [{
text: "楼层",
value: null
}, ...list]
// 赋值参数
let queryParam = _this.data.queryParam;
queryParam.meetingTypeDict.list = list;
_this.setData({
queryParam
})
console.log('meetingRoomDict("1")=>', list);
})
// meetingRoomDict("2").then(res => {
// console.log('meetingRoomDict("2")', res);
// // 封装参数
// let list = res.roomContents.map(item => {
// return {
// text: item.capacityNum + '人',
// value: item.capacityNum
// }
// })
// list = [{
// text: "人数",
// value: null
// }, ...list]
// // 赋值参数
// let queryParam = _this.data.queryParam;
// queryParam.personDict.list = list;
// _this.setData({
// queryParam
// })
// console.log('meetingRoomDict("2")=>', list);
// })
meetingRoomDict("3").then(res => {
console.log('meetingRoomDict("3")', res);
// 封装参数
let list = res.roomItem.map(item => {
return {
text: item.name,
value: item.id
}
})
// 赋值参数
let queryParam = _this.data.queryParam;
queryParam.itemDict.list = list;
_this.setData({
queryParam
})
console.log('meetingRoomDict("3")=>', list);
})
meetingRoomDict("4").then(res => {
console.log('meetingRoomDict("4")', res);
// 封装参数
let list = res.roomContents.map(item => {
return {
text: item.shape,
value: item.shape
}
})
list = [{
text: "形式",
value: null
}, ...list]
// 赋值参数
let queryParam = _this.data.queryParam;
queryParam.shapeDict.list = list;
_this.setData({
queryParam
})
console.log('meetingRoomDict("4")=>', list);
})
// 数据-会议室列表
this.meetingRoomList()
},
// 查询条件变动
dictChange(e) {
console.log('dictChange', e);
let queryParam = this.data.queryParam;
queryParam[e.currentTarget.dataset.type].value = e.detail;
this.setData({
queryParam
})
// 数据-会议室列表
this.meetingRoomList()
},
// 设备-多选
dictSwitchChange(e) {
console.log('dictSwitchChange', e);
let select = e.detail;
let name = e.currentTarget.dataset.name;
let id = e.currentTarget.dataset.id;
let queryParam = this.data.queryParam;
queryParam.itemDict.list = queryParam.itemDict.list.map(item => {
if (item.value == id) {
item.select = select;
}
return item
})
// 计算选择数量
let selectCount = queryParam.itemDict.list.filter(item => item.select).length;
console.log('selectCount', selectCount);
if (selectCount > 0) {
queryParam.itemDict.title = '设备+' + selectCount;
} else {
queryParam.itemDict.title = '设备';
}
this.setData({
queryParam
})
// 数据-会议室列表
this.meetingRoomList()
},
// 设备多选收起
itemDictConfirm() {
this.selectComponent('#itemSelect').toggle();
},
// 数据-会议室列表
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 param = {
"type": queryParam.meetingTypeDict.value,
"capacityNum": queryParam.personDict.value,
"roomItemList": roomItemList,
"shape": queryParam.shapeDict.value,
timeRange: queryParam.timeRangeDict.value
}
// 会议室列表数据
meetingRoomListRq(param).then(res => {
console.log('meetingRoomListRq', res);
let roomArr = {}
let valueObj = res.rows
for (let key in valueObj) {
let eachObj = valueObj[key]
if (eachObj['type'] in roomArr) {} else {
roomArr[eachObj['type']] = {
name: eachObj['typeName'],
list: []
}
}
roomArr[eachObj['type']]['list'].push(eachObj)
}
// console.log(roomArr)
_this.setData({
roomDataList: roomArr
})
})
},
// 会议室
jumpMeetingRoom(e) {
console.log('jumpMeetingRoom', e)
let timeRange = this.data.queryParam.timeRangeDict.value
timeRange = timeRange ? timeRange : 0
// 跳转预约详情
wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingRoom?id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange,
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

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

@ -3,223 +3,337 @@ const app = getApp()
import Notify from '@vant/weapp/notify/notify'; import Notify from '@vant/weapp/notify/notify';
import { import {
meetingRoomBookedRecordRq, meetingRoomBookedRecordRq,
selectFreeMeetingRoomRq selectFreeMeetingRoomRq
} from "../../../../api/meeting/meetingRoom.js" } from "../../../../api/meeting/meetingRoom.js"
import { import {
selfFormatTimeReturnSecond59, selfFormatTimeReturnSecond59,
selfFormatTimeYMDHMS, selfFormatTimeYMDHMS,
selfFormatTimeYMDH selfFormatTimeYMDH
} from "../../../../utils/util.js" } from "../../../../utils/util.js"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
meetingRoomId: null, date: '',
minTime: null, dateText: '',
maxTime: null, timeRange: '',
endMaxTime: null, timeRangeText: '',
startTime: null, meetingRoomId: null,
endTime: null, minTime: null,
showTime: false, maxTime: null,
dataList: [], endMinTime: null, // 结束时间最小小时(与开始时间联动)
filterTime(type, options) { endMaxTime: null, // 结束时间最大小时(根据范围固定)
// if (type === 'minute') { startTime: null,
// return options.filter((option) => option == '00'); endTime: null,
// } showTime: true,
return options; showRangePicker: false,
}, dataList: [],
rangeOp: [],
filterTime(type, options) {
// if (type === 'minute') {
// return options.filter((option) => option == '00');
// }
return options;
}, },
},
// 选择-开始时间 showRange() {
onInputStartTime(event) { this.setData({
this.setData({ showRangePicker: true
startTime: event.detail, });
}); },
this.setEndMaxTime(event.detail) hideRange() {
}, this.setData({
showRangePicker: false
// 选择-结束时间 });
onInputEndTime(event) { },
let _this = this; rangePick(e) {
this.setData({ let _this = this
endTime: event.detail, let value = e.detail.value
}); let _timeRange = ''
}, if (value === '上午') {
_timeRange = 1
// 预约时间 } else if (value === '下午') {
reservationTime() { _timeRange = 2
this.setData({ } else if (value === '晚上') {
showTime: true _timeRange = 3
})
},
// 确认时间
confirmTime() {
let _this = this;
let meetingRoomId = _this.data.meetingRoomId;
let startTime = _this.data.startTime;
let endTime = _this.data.endTime;
let paramUrl = "?meetingRoomId=" + meetingRoomId + "&startTime=" + selfFormatTimeYMDHMS(startTime) + "&endTime=" + selfFormatTimeYMDHMS(endTime);
// // 预约时间不能小于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({
url: "/pages/meeting/meetingRoom/meetingOrder/meetingOrder" + paramUrl,
})
_this.setData({
showTime: false
})
} else { // 不能预约
Notify({
type: 'danger',
message: res.msg,
duration: 1000,
selector: '#notify',
});
}
})
},
// 取消时间
cancelTime() {
this.setData({
showTime: false
})
},
// 初始化时间
initParamTime() {
let maxTime = new Date();
maxTime.setFullYear(maxTime.getFullYear() + 3)
this.setData({
maxTime: maxTime.getTime()
})
this.setEndMaxTime(this.data.startTime)
// 设置最小时间
this.setMinTime()
},
// 设置最小时间
setMinTime() {
// let minTime = new Date(selfFormatTimeYMDH(new Date()) + ':00:00').getTime()
let minTime = new Date().getTime()
this.setData({
minTime,
startTime: minTime
})
},
// 指定天的最后一秒
setEndMaxTime(time) {
let endMaxTime = new Date(new Date(time).toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1;
this.setData({
endMaxTime: endMaxTime
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('onLoad', options);
// 获取传递参数
this.setData({
...options
})
// 初始化时间
this.initParamTime()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log('onShow', 111);
let _this = this;
meetingRoomBookedRecordRq(this.data.meetingRoomId).then(res => {
console.log('meetingRoomBookedRecordRq', res);
let dataList = res.data;
dataList.map(item => {
item.nowDate = item.nowDate.substring(0, 10);
item.reservations = item.reservations.map(record => {
record.startTime = record.startTime.substring(11)
record.endDate = record.endDate.substring(11)
record.userName = record.userName.substring(0,1) + "某"
record.phone = record.phone.substring(0,3) + "****" + record.phone.substring(7,record.phone.length)
return record;
})
return item
})
_this.setData({
dataList
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
} }
_this.setData({
timeRange: _timeRange,
timeRangeText: value,
showRangePicker: false
})
_this.initParamTime()
},
// 选择-开始时间
onInputStartTime(event) {
this.setData({
startTime: event.detail,
})
this.setEndMaxTime(event.detail)
},
// 选择-结束时间
onInputEndTime(event) {
let _this = this;
this.setData({
endTime: event.detail,
});
},
// 预约时间
reservationTime() {
// this.setData({
// showTime: true
// })
},
// 确认时间
confirmTime() {
let _this = this;
let date = this.data.date
let meetingRoomId = _this.data.meetingRoomId
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);
// 结束时间不能小于开始时间
if (startTime >= endTime) {
Notify('结束时间不能小于开始时间!')
return
}
wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingOrder/meetingOrder" + paramUrl,
})
// // 当前会议室是否可以预约
// selectFreeMeetingRoomRq({
// "roomContentId": meetingRoomId,
// "startTime": selfFormatTimeYMDHMS(startTime),
// "endDate": selfFormatTimeYMDHMS(endTime)
// }).then(res => {
// console.log('selectFreeMeetingRoomRq', res);
// // 可以预约
// 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() {
// this.setData({
// showTime: false
// })
},
// 初始化时间
initParamTime() {
let _date = this.data.date
_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({
// startTime: _startTime,
minTime: _minTime,
maxTime: _maxTime
// maxTime: maxTime.getTime()
})
// this.setEndMaxTime(this.data.startTime)
// 设置最小时间
// this.setMinTime()
},
// 设置最小时间
// setMinTime() {
// // let minTime = new Date(selfFormatTimeYMDH(new Date()) + ':00:00').getTime()
// let minTime = new Date().getTime()
// this.setData({
// minTime,
// startTime: minTime
// })
// },
// 获取结束时间的最大时间和最小时间
setEndMaxTime(time) {
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({
endMinTime: _endMinTime,
endMaxTime: _endMaxTime
})
},
/**
* 生命周期函数--监听页面加载
*/
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({
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()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
// console.log('onShow', 111);
let _this = this;
// meetingRoomBookedRecordRq(this.data.meetingRoomId).then(res => {
// console.log('meetingRoomBookedRecordRq', res);
// let dataList = res.data;
// dataList.map(item => {
// item.nowDate = item.nowDate.substring(0, 10);
// item.reservations = item.reservations.map(record => {
// record.startTime = record.startTime.substring(11)
// record.endDate = record.endDate.substring(11)
// record.userName = record.userName.substring(0, 1) + "某"
// record.phone = record.phone.substring(0, 3) + "****" + record.phone.substring(7, record.phone.length)
// return record;
// })
// return item
// })
// _this.setData({
// dataList
// })
// })
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -1,9 +1,12 @@
{ {
"usingComponents": { "usingComponents": {
"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",
"navigationBarTitleText": "会议室已预约" "van-cell-group": "@vant/weapp/cell-group/index",
"van-picker": "@vant/weapp/picker/index"
},
"navigationBarTitleText": "预约会议室"
} }

View File

@ -1,67 +1,40 @@
<view class="containerView public"> <view class="containerView">
<!-- 选择时间 -->
<view class="selfPop" wx:if="{{showTime}}">
<view wx:if="{{rangeOp.length > 1}}">
<view class="labelView">
<view class="leftLineTitle">请选择时间范围</view>
<view class="dataView"> </view>
<!-- 标题 --> <van-cell bind:tap="showRange" title="{{dateText}}" is-link value="{{timeRangeText}}" arrow-direction="down" />
<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>
<view wx:if="{{rangeOp.length == 1}}">
<!-- 预约时间 --> <view class="labelView">
<view class="submitBtn" bind:tap="reservationTime">预约时间</view> <view class="leftLineTitle">会议时间范围</view>
</view>
<!-- 选择时间 --> <van-cell title="{{dateText}}" value="{{timeRangeText}}" />
<view class="selfPop" wx:if="{{showTime}}">
<view class="labelView">
<view class="leftLineTitle">请选择开始时间</view>
</view>
<view class="labelTimeView">
<view>年</view>
<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 }}" />
<view class="labelView">
<view class="leftLineTitle">请选择结束时间</view>
<view class="enter" bind:tap="confirmTime">确定</view>
</view>
<view class="labelTimeView">
<view>年</view>
<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 }}" />
</view> </view>
<view class="labelView">
<!-- 消息提示 --> <view class="leftLineTitle">请选择开始时间</view>
<van-notify id="notify" /> </view>
<view class="labelTimeView">
<view style="width: 50%;text-align: center;">时</view>
<view style="width: 50%;text-align: center;">分</view>
</view>
<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="leftLineTitle">请选择结束时间</view>
</view>
<view class="labelTimeView">
<view style="width: 50%;text-align: center;">时</view>
<view style="width: 50%;text-align: center;">分</view>
</view>
<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 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="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,92 +1,93 @@
<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>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<!-- 详细信息 --> <!-- 详细信息 -->
<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> <view class="item" wx:for="{{room.roomServeList}}" wx:for-item="serveItem" wx:key="*this">#{{serveItem.serveName}}</view>
</view> </view>
<!-- <view class="priceView"> </view>
<!-- <view class="priceView">
<view class="price">¥{{room.money > 0 ? room.money * room.duration : '免费'}}/</view> <view class="price">¥{{room.money > 0 ? room.money * room.duration : '免费'}}/</view>
<view class="unit"><text decode>&nbsp;</text>{{room.duration}}小时 起</view> <view class="unit"><text decode>&nbsp;</text>{{room.duration}}小时 起</view>
</view> --> </view> -->
</view> </view>
<!-- 内容 --> <!-- 内容 -->
<view class="contentView"> <view class="contentView">
<view class="item"> <view class="item">
<van-icon name="calendar-o" size="54rpx" /> <van-icon name="calendar-o" size="54rpx" />
<view class="time">{{selectDay}}</view> <view class="time">{{selectDay}}</view>
</view>
<view class="item">
<van-icon name="clock-o" size="54rpx" />
<view class="time">{{selectCountTime}}</view>
</view>
<view class="item">
<van-icon name="contact-o" size="54rpx" />
<view class="time">{{userData.username}} {{userData.mobile}}</view>
</view>
</view> </view>
<view class="item">
<van-icon name="clock-o" size="54rpx" />
<view class="time">{{selectCountTime}}</view>
</view>
<view class="item">
<van-icon name="contact-o" size="54rpx" />
<view class="time">{{userData.username}} {{userData.mobile}}</view>
</view>
</view>
<!-- 填写信息 --> <!-- 填写信息 -->
<view class="fillMsgView"> <view class="fillMsgView">
<view class="itemView"> <view class="itemView">
<view class="label">会议主题</view> <view class="label">会议主题</view>
<view class="content"> <view class="content">
<van-field value="{{ title }}" placeholder="请输入会议主题" clearable input-align="right" border="{{ false }}" data-name="title" bind:change="inputChange" /> <van-field value="{{ title }}" placeholder="请输入会议主题" clearable input-align="right" border="{{ false }}" data-name="title" bind:change="inputChange" />
</view> </view>
</view> </view>
<view class="itemView"> <view class="itemView">
<view class="label">参会人数</view> <view class="label">参会人数</view>
<view class="content"> <view class="content">
<van-field value="{{ personNum }}" placeholder="请输入参会人数" type="number" clearable input-align="right" border="{{ false }}" data-name="personNum" bind:change="inputChange" /> <van-field value="{{ personNum }}" placeholder="请输入参会人数" type="number" clearable input-align="right" border="{{ false }}" data-name="personNum" bind:change="inputChange" />
</view> </view>
</view> </view>
<view class="itemView" bind:tap="jumpMeetingFacilities"> <view class="itemView" bind:tap="jumpMeetingFacilities">
<view class="label">会议服务</view> <view class="label">会议服务</view>
<view class="content"> <view class="content">
<van-icon name="arrow" size="44rpx" /> <van-icon name="arrow" size="44rpx" />
</view> </view>
</view> </view>
<!-- <view class="itemView" bind:tap="jumpMeetingCoupon"> <!-- <view class="itemView" bind:tap="jumpMeetingCoupon">
<view class="label">优惠券</view> <view class="label">优惠券</view>
<view class="content"> <view class="content">
<view class="coupon {{couponId ? 'select' : ''}}">{{couponId? couponData.ticketName : couponUseCount + '张可用'}}</view> <view class="coupon {{couponId ? 'select' : ''}}">{{couponId? couponData.ticketName : couponUseCount + '张可用'}}</view>
<van-icon name="arrow" size="44rpx" /> <van-icon name="arrow" size="44rpx" />
</view> </view>
</view> --> </view> -->
<!-- <view class="itemView"> <!-- <view class="itemView">
<view class="label">总金额</view> <view class="label">总金额</view>
<view class="content"> <view class="content">
<view class="price">¥{{countAmount}}</view> <view class="price">¥{{countAmount}}</view>
</view> </view>
</view> --> </view> -->
</view>
<view class="submitBtn" bind:tap="submitCase">提交预约</view>
<!-- 提示 -->
<van-dialog id="van-dialog" />
<van-dialog use-slot title="价格明细" show="{{ priceDialogShow }}">
<view class="priceDialogView">
<view class="content">{{room.money}}/小时({{room.duration}}小时起)</view>
<view class="remark">
<van-icon name="info-o" size="28rpx" />
{{room.remake}}
</view>
</view> </view>
</van-dialog>
<view class="submitBtn" bind:tap="submitCase">提交预约</view> <!-- 提示 -->
<van-notify id="van-notify" />
<!-- 提示 -->
<van-dialog id="van-dialog" />
<van-dialog use-slot title="价格明细" show="{{ priceDialogShow }}">
<view class="priceDialogView">
<view class="content">{{room.money}}/小时({{room.duration}}小时起)</view>
<view class="remark">
<van-icon name="info-o" size="28rpx" />
{{room.remake}}
</view>
</view>
</van-dialog>
<!-- 提示 -->
<van-notify id="van-notify" />
</view> </view>

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",
"navigationBarTitleText": "会议室" "van-cell-group": "@vant/weapp/cell-group/index"
},
"navigationBarTitleText": "会议室"
} }

View File

@ -1,46 +1,49 @@
<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 class="roomView">
<!-- 类型信息 -->
<view class="typeView">
<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 class="content">{{detail.content ? detail.content : ''}}</view>
</view> </view>
</view>
<!-- 会议室详细信息 -->
<view class="facilitiesView">
<view class="leftLineTitle">会议室描述</view>
<view class="content">{{detail.content ? detail.content : '无描述'}}</view>
</view>
<!-- 设施 --> <view class="resView">
<view class="facilitiesView"> <view class="leftLineTitle">预约情况</view>
<view class="leftLineTitle">空间设施</view> <van-cell-group>
<view class="itemView"> <van-cell wx:for="{{resList}}" title="{{item.date}}" value="{{item.time}}" label="{{item.dep}} | {{item.user}} | {{item.tel}}" />
<view class="singleItem" wx:for="{{detail.roomItemList}}" wx:for-item="serviceItem" wx:key="*this"> </van-cell-group>
<image class="img" src="{{IMG_NAME + serviceItem.picUrl}}" mode="aspectFill"></image> </view>
<view class="name">{{serviceItem.name}}</view>
</view> <!-- 设施 -->
</view> <!-- <view class="facilitiesView">
<view class="leftLineTitle">空间设施</view>
<view class="itemView">
<view class="singleItem" wx:for="{{detail.roomItemList}}" wx:for-item="serviceItem" wx:key="*this">
<image class="img" src="{{IMG_NAME + serviceItem.picUrl}}" mode="aspectFill"></image>
<view class="name">{{serviceItem.name}}</view>
</view>
</view> </view>
</view> -->
<!-- 价格 --> <!-- 价格 -->
<!-- <view class="priceView"> <!-- <view class="priceView">
<view class="leftLineTitle">价格</view> <view class="leftLineTitle">价格</view>
<view class="content">¥{{detail.money > 0 ? detail.money + '/小时' : '免费'}}<text decode>&nbsp;</text>{{detail.duration}}小时起)</view> <view class="content">¥{{detail.money > 0 ? detail.money + '/小时' : '免费'}}<text decode>&nbsp;</text>{{detail.duration}}小时起)</view>
<view class="remark" wx:if="{{detail.remake}}"> <view class="remark" wx:if="{{detail.remake}}">
@ -49,13 +52,12 @@
</view> </view>
</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;
}