会议预约功能

修改预约时间,允许设置时间(避免input变化的BUG),修复列表页、添加是无parkId导致查不出数据的BUG;
This commit is contained in:
471615499@qq.com 2024-09-16 23:14:30 +08:00
parent 34701558f3
commit 84c9e6f7c4
13 changed files with 668 additions and 478 deletions

View File

@ -366,18 +366,20 @@ image {
.submitBtn { .submitBtn {
box-sizing: border-box; box-sizing: border-box;
position: fixed; /* position: fixed; */
z-index: 10; /* z-index: 10; */
width: 600rpx; width: 600rpx;
left: 50%; /* left: 50%; */
transform: translateX(-50%); /* transform: translateX(-50%); */
bottom: 120rpx; /* bottom: 120rpx; */
border-radius: 10rpx; border-radius: 10rpx;
padding: 20rpx; padding: 20rpx;
background: #4e96f8; background: #4e96f8;
color: white; color: white;
font-size: 30rpx; font-size: 30rpx;
text-align: center; text-align: center;
margin: 0px auto;
margin-top: 50rpx;
} }
.ellipsisFont { .ellipsisFont {

View File

@ -72,18 +72,23 @@ Page({
}, },
// 选择-开始时间 // 选择-开始时间
onInputStartTime(event) { onInputStartTime(event) {
let valueArr = event.detail.getValues()
let detail = valueArr[0] + ':' + valueArr[1]
this.setData({ this.setData({
startTime: event.detail, startTime: detail,
}) })
this.setEndMaxTime(event.detail) console.log(detail)
this.setEndMaxTime(detail)
}, },
// 选择-结束时间 // 选择-结束时间
onInputEndTime(event) { onInputEndTime(event) {
let _this = this; let valueArr = event.detail.getValues()
let detail = valueArr[0] + ':' + valueArr[1]
console.log(detail)
this.setData({ this.setData({
endTime: event.detail, endTime: detail,
}); })
}, },
// 预约时间 // 预约时间
@ -162,7 +167,7 @@ Page({
// 上午从600 - 1200 // 上午从600 - 1200
_minTime = 6 _minTime = 6
_maxTime = 11 _maxTime = 11
_startTime = '8:30' _startTime = '9:00'
} else if (_timeRange === 2) { } else if (_timeRange === 2) {
// 下午从1200 - 1800 // 下午从1200 - 1800
_minTime = 12 _minTime = 12
@ -177,12 +182,12 @@ Page({
// let maxTime = new Date(_date) // let maxTime = new Date(_date)
// maxTime.setFullYear(maxTime.getFullYear() + 3) // maxTime.setFullYear(maxTime.getFullYear() + 3)
this.setData({ this.setData({
// startTime: _startTime, startTime: _startTime,
minTime: _minTime, minTime: _minTime,
maxTime: _maxTime maxTime: _maxTime
// maxTime: maxTime.getTime() // maxTime: maxTime.getTime()
}) })
// this.setEndMaxTime(this.data.startTime) this.setEndMaxTime(this.data.startTime)
// 设置最小时间 // 设置最小时间
// this.setMinTime() // this.setMinTime()
}, },
@ -216,6 +221,7 @@ Page({
_endMaxTime = 23 _endMaxTime = 23
} }
this.setData({ this.setData({
endTime: _endMinTime + ':' + '00',
endMinTime: _endMinTime, endMinTime: _endMinTime,
endMaxTime: _endMaxTime endMaxTime: _endMaxTime
}) })

View File

@ -21,7 +21,7 @@
<view style="width: 50%;text-align: center;">时</view> <view style="width: 50%;text-align: center;">时</view>
<view style="width: 50%;text-align: center;">分</view> <view style="width: 50%;text-align: center;">分</view>
</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}}" /> <van-datetime-picker type="time" visible-item-count="4" value="{{ startTime }}" min-hour="{{ minTime }}" max-hour="{{ maxTime }}" bind:change="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> </view>
@ -29,7 +29,7 @@
<view style="width: 50%;text-align: center;">时</view> <view style="width: 50%;text-align: center;">时</view>
<view style="width: 50%;text-align: center;">分</view> <view style="width: 50%;text-align: center;">分</view>
</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 }}" /> <van-datetime-picker type="time" visible-item-count="4" value="{{ endTime }}" min-hour="{{ endMinTime }}" max-hour="{{ endMaxTime }}" bind:change="onInputEndTime" confirm-button-text="" cancel-button-text="" show-toolbar="{{false}}" filter="{{ filterTime }}" />
</view> </view>
<view class="submitBtn" bind:tap="confirmTime">确认时间</view> <view class="submitBtn" bind:tap="confirmTime">确认时间</view>
<van-popup show="{{ showRangePicker }}" bind:close="hideRange" position="bottom"> <van-popup show="{{ showRangePicker }}" bind:close="hideRange" position="bottom">

View File

@ -72,7 +72,21 @@
} }
.submitBtn { .submitBtn {
z-index: 0; box-sizing: border-box;
position: fixed;
z-index: 10;
width: 600rpx;
left: 50%;
transform: translateX(-50%);
bottom: 120rpx;
border-radius: 10rpx;
padding: 20rpx;
background: #4e96f8;
color: white;
font-size: 30rpx;
text-align: center;
margin: 0px auto;
margin-top: 50rpx;
} }
.selfPop { .selfPop {

View File

@ -4,196 +4,249 @@ import Dialog from '@vant/weapp/dialog/dialog';
import Notify from '@vant/weapp/notify/notify'; import Notify from '@vant/weapp/notify/notify';
import { import {
meetingRoomDetailRq, meetingRoomDetailRq,
getCustomerTicketRq, getCustomerTicketRq,
calculateMeetingRoomAmountRq, calculateMeetingRoomAmountRq,
saveMeetingRecordRq, saveMeetingRecordRq,
saveChangyangMeetingRecordRq saveChangyangMeetingRecordRq,
meetingRoomBookedRecordRq
} from "../../../../api/meeting/meetingRoom.js" } from "../../../../api/meeting/meetingRoom.js"
import { import {
selfFormatTimeYMD, selfFormatTimeYMD,
selfFormatTimeHM, selfFormatTimeHM,
twoTimeInterval, twoTimeInterval,
selfArrSum selfArrSum
} from "../../../../utils/util.js" } from "../../../../utils/util.js"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_NAME: app.IMG_NAME, id: '',
meetingRoomId: null, IMG_NAME: app.IMG_NAME,
startTime: null, detail: {},
endTime: null, meetingRoomId: null,
selectDay: null, startTime: null,
selectCountTime: null, endTime: null,
bannerList: [], selectDay: null,
room: {}, selectCountTime: null,
userData: {}, bannerList: [],
serviceList: [], room: {},
title: '', userData: {},
personNum: '', serviceList: [],
}, },
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('onLoad', options);
let selectCountTime = selfFormatTimeHM(options.startTime) + "-" + selfFormatTimeHM(options.endTime) + ' 共计' + twoTimeInterval(options.startTime, options.endTime)
this.setData({
...options,
userData: wx.getStorageSync('user'),
selectDay: selfFormatTimeYMD(options.startTime),
selectCountTime
})
// 详细信息
this.getDetail();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log('onLoad', options);
let selectCountTime = selfFormatTimeHM(options.startTime) + "-" + selfFormatTimeHM(options.endTime) + ' 共计' + twoTimeInterval(options.startTime, options.endTime)
this.setData({
...options,
userData: wx.getStorageSync('user'),
selectDay: selfFormatTimeYMD(options.startTime),
selectCountTime
})
// 详细信息 // 详细信息
getDetail() { this.getDetail();
let _this = this; },
meetingRoomDetailRq(this.data.meetingRoomId).then(res => {
let detail = res.roomContent;
let bannerList = []
if (detail.indoorPicUrl) {
try {
bannerList = JSON.parse(detail.indoorPicUrl).map(item => item.url)
} catch (error) {
console.log(`JSON error : ${error}`);
}
}
_this.setData({
room: detail,
bannerList
})
})
},
// input修改监听 // 详细信息
inputChange(e) { getDetail() {
console.log('input change', e); let _this = this;
let _this = this let _dataId = _this.data.id
let name = e.currentTarget.dataset.name if (_dataId === '') {
let value = e.detail // 为新增新增的会议室id是传来的
let data = _this.data let _meetingRoomId = _this.data.meetingRoomId
data[name] = value _this.getRoomInfo(_meetingRoomId)
this.setData({ _this.setData({
...data detail: {
}) orderUser: _this.data.userData.username,
}, orderTel: _this.data.userData.mobile,
title: '',
// 跳转-空间设施 personNum: '',
jumpMeetingFacilities() { leader: '',
let meetingRoomId = this.data.meetingRoomId; depName: '',
let serviceListJsonStr = JSON.stringify(this.data.serviceList) remark: ''
wx.navigateTo({
url: `/pages/meeting/meetingRoom/meetingService/meetingService?meetingRoomId=${meetingRoomId}&serviceList=${serviceListJsonStr}`
})
},
// 提交订单
submitCase() {
let _this = this
// 参数校验
if (!_this.data.title) {
// 错误提示
Notify({
type: 'danger',
message: '请输入会议主题!'
});
return;
} }
if (_this.data.personNum == '') { })
// 错误提示 } else {
Notify({ // 为编辑此时根据id获取信息获取信息后其中有roomId
type: 'danger', meetingRoomBookedRecordRq(_dataId).then(res => {
message: '请输入参会人数!' console.log(res)
}); })
return;
}
saveChangyangMeetingRecordRq({
"roomContentId": _this.data.meetingRoomId,
"userId": _this.data.userData.id,
"customerId": _this.data.userData.icsCustomerId,
"title": _this.data.title,
"personNum": _this.data.personNum,
"startTime": _this.data.startTime,
"endDate": _this.data.endTime,
"orderMoney": 0,
"reservationServes" : _this.data.serviceList,
}).then(res => {
console.log('saveMeetingRecordRq', res);
if (res.code == 0) {
wx.reLaunch({
url: '/pages/meeting/pay/waitComplete/waitComplete',
})
} else {
// 错误提示
Notify({
type: 'danger',
message: res.msg
});
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log('onShow');
let _this = this
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
} }
},
getRoomInfo(roomId) {
// 获取会议室详情
let _this = this
meetingRoomDetailRq(this.data.meetingRoomId).then(res => {
let detail = res.roomContent;
let bannerList = []
if (detail.indoorPicUrl) {
try {
bannerList = JSON.parse(detail.indoorPicUrl).map(item => item.url)
} catch (error) {
console.log(`JSON error : ${error}`);
}
}
_this.setData({
room: detail,
bannerList
})
})
},
// input修改监听
inputChange(e) {
console.log('input change', e);
let _this = this
let name = e.currentTarget.dataset.name
let value = e.detail
let data = _this.data
data['detail'][name] = value
this.setData({
...data
})
},
// 跳转-空间设施
jumpMeetingFacilities() {
let meetingRoomId = this.data.meetingRoomId;
let serviceListJsonStr = JSON.stringify(this.data.serviceList)
wx.navigateTo({
url: `/pages/meeting/meetingRoom/meetingService/meetingService?meetingRoomId=${meetingRoomId}&serviceList=${serviceListJsonStr}`
})
},
// 提交订单
submitCase() {
let _this = this
// 参数校验
if (!_this.data.detail.title) {
// 错误提示
Notify({
type: 'danger',
message: '请输入会议名称!'
});
return;
}
if (_this.data.detail.personNum == '') {
// 错误提示
Notify({
type: 'danger',
message: '请输入参会人数!'
});
return;
}
// if (_this.data.detail.orderName == '') {
// // 错误提示
// Notify({
// type: 'danger',
// message: '无队名单位!'
// });
// return;
// }
if (_this.data.detail.orderUser == '') {
// 错误提示
Notify({
type: 'danger',
message: '请输入预约人!'
});
return;
}
if (_this.data.detail.orderTel == '') {
// 错误提示
Notify({
type: 'danger',
message: '请输入联系方式!'
});
return;
}
saveChangyangMeetingRecordRq({
"roomContentId": _this.data.meetingRoomId,
"userId": _this.data.userData.id,
"customerId": _this.data.userData.icsCustomerId,
"title": _this.data.detail.title,
"personNum": _this.data.detail.personNum,
"startTime": _this.data.startTime,
"endDate": _this.data.endTime,
"orderMoney": 0,
"reservationServes": _this.data.serviceList,
"remark": _this.data.detail.remark,
"orderUser": _this.data.detail.orderUser,
"orderTel": _this.data.detail.orderTel,
"parkId": 25, // 写死园区ID
}).then(res => {
console.log('saveMeetingRecordRq', res);
if (res.code == 0) {
wx.reLaunch({
url: '/pages/meeting/pay/waitComplete/waitComplete?id=' + res.reservationId,
})
} else {
// 错误提示
Notify({
type: 'danger',
message: res.msg
});
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log('onShow');
let _this = this
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -34,24 +34,54 @@
<van-icon name="clock-o" size="54rpx" /> <van-icon name="clock-o" size="54rpx" />
<view class="time">{{selectCountTime}}</view> <view class="time">{{selectCountTime}}</view>
</view> </view>
<view class="item"> <!-- <view class="item">
<van-icon name="contact-o" size="54rpx" /> <van-icon name="contact-o" size="54rpx" />
<view class="time">{{userData.username}} {{userData.mobile}}</view> <view class="time">{{userData.username}} {{userData.mobile}}</view>
</view> </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="{{ detail.title }}" placeholder="请输入会议名称" clearable input-align="right" 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="{{ detail.personNum }}" placeholder="请输入参会人数" type="number" clearable input-align="right" data-name="personNum" bind:change="inputChange" />
</view>
</view>
<view class="itemView">
<view class="label">参会领导</view>
<view class="content">
<van-field value="{{ detail.leader }}" placeholder="请输入参会领导" clearable input-align="right" data-name="leader" bind:change="inputChange" />
</view>
</view>
<view class="itemView">
<view class="label">预约部门</view>
<view class="content">
<van-field value="{{ detail.depName }}" placeholder="" readonly clearable input-align="right" data-name="depName" />
</view>
</view>
<view class="itemView">
<view class="label">预约人</view>
<view class="content">
<van-field value="{{ detail.orderUser }}" placeholder="请输入预约人" clearable input-align="right" data-name="orderUser" bind:change="inputChange" />
</view>
</view>
<view class="itemView">
<view class="label">联系方式</view>
<view class="content">
<van-field value="{{ detail.orderTel }}" placeholder="请输入联系方式" clearable input-align="right" data-name="orderTel" bind:change="inputChange" />
</view>
</view>
<view class="itemView">
<view class="label">备注(选填)</view>
<view class="content">
<van-field value="{{ detail.remark }}" placeholder="请输入备注" clearable input-align="right" data-name="remark" bind:change="inputChange" />
</view> </view>
</view> </view>
<view class="itemView" bind:tap="jumpMeetingFacilities"> <view class="itemView" bind:tap="jumpMeetingFacilities">

View File

@ -1,168 +1,209 @@
const app = getApp() const app = getApp()
import { import {
meetingRoomDetailRq, meetingRoomDetailRq,
selectCoordinateRq selectCoordinateRq,
meetingRoomBookedRecordRq
} from "../../../api/meeting/meetingRoom.js" } from "../../../api/meeting/meetingRoom.js"
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
IMG_NAME: app.IMG_NAME, IMG_NAME: app.IMG_NAME,
meetingRoomId: null, meetingRoomId: null,
date: '', date: '',
timeRange: '', timeRange: '',
detail: {}, detail: {},
bannerList: [], bannerList: [],
mapData: {}, mapData: {},
resList: [{ recordList: [{
date: '2024年9月18日', date: '2024年9月18日',
time: '14:00 - 17:30', time: '14:00 - 17:30',
user: '王XX', user: '王XX',
dep: '司法局', dep: '司法局',
tel: '15811111111' tel: '15811111111'
},{ }, {
date: '2024年9月19日', date: '2024年9月19日',
time: '14:00 - 17:30', time: '14:00 - 17:30',
user: '王XX', user: '王XX',
dep: '司法局', dep: '司法局',
tel: '15811111111' tel: '15811111111'
}], }],
canRes: true // 是否允许预约 canRes: true // 是否允许预约
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
let _this = this; let _this = this;
console.log('onLoad', options); console.log('onLoad', options);
let time = options.time let time = options.time
let timeRange = options.timeRange let timeRange = options.timeRange
_this.setData({ _this.setData({
date: time, date: time,
timeRange: timeRange 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);
let detail = res.roomContent; let detail = res.roomContent;
let bannerList = [] let bannerList = []
if (detail.indoorPicUrl) { if (detail.indoorPicUrl) {
try { try {
bannerList = JSON.parse(detail.indoorPicUrl).map(item=>item.url) bannerList = JSON.parse(detail.indoorPicUrl).map(item => item.url)
} catch (error) { } catch (error) {
console.log(`JSON error : ${error}`); console.log(`JSON error : ${error}`);
} }
} }
_this.setData({ _this.setData({
meetingRoomId, meetingRoomId,
detail, detail,
bannerList bannerList
}) })
}) })
// 获取地址信息 meetingRoomBookedRecordRq(meetingRoomId).then(res => {
// _this.getAddress() console.log('meetingRoomBookedRecordRq', res);
}, let _recordList = []
for (let key in res.data) {
let eachObj = res.data[key]
let _date = eachObj['nowDate']
let _dataList = eachObj['reservations']
for (let i in _dataList) {
let dateObj = _dataList[i]
let _eachData = {
date: _date,
time: dateObj.startTime.substr(11, 5) + ' - ' + dateObj.endDate.substr(11, 5),
user: dateObj.userName,
dep: '暂无',
tel: dateObj.phone,
}
_recordList.push(_eachData)
}
}
_this.setData({
recordList: _recordList
})
// console.log(_recordList)
// let recordList = res.data;
// recordList.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({
// recordList
// })
// console.log(_this.data.recordList)
})
// 获取地址信息
// _this.getAddress()
},
// 获取地址信息(不需要地址) // 获取地址信息(不需要地址)
getAddress() { getAddress() {
let _this = this; let _this = this;
selectCoordinateRq().then(res => { selectCoordinateRq().then(res => {
_this.setData({ _this.setData({
address: res, address: res,
mapData: { mapData: {
latitude: res.lat, latitude: res.lat,
longitude: res.lng, longitude: res.lng,
markers: [{ markers: [{
id: 1, id: 1,
latitude: res.lat, latitude: res.lat,
longitude: res.lng, longitude: res.lng,
title: res.address, title: res.address,
}] }]
}, },
}) })
}) })
}, },
// 打开地图 // 打开地图,不需要地图
openMap(e) { openMap(e) {
console.log('openMap', e); console.log('openMap', e);
let _this = this; let _this = this;
wx.openLocation({ wx.openLocation({
name: _this.data.address.address, name: _this.data.address.address,
latitude: _this.data.address.lat, latitude: _this.data.address.lat,
longitude: _this.data.address.lng, longitude: _this.data.address.lng,
}) })
}, },
// 跳转空间设施 // 跳转空间设施,不需要
jumpMeetingFacilities() { jumpMeetingFacilities() {
let meetingRoomId = this.data.meetingRoomId; let meetingRoomId = this.data.meetingRoomId;
wx.navigateTo({ wx.navigateTo({
url: '/pages/meeting/meetingRoom/meetingFacilities/meetingFacilities?meetingRoomId=' + meetingRoomId, url: '/pages/meeting/meetingRoom/meetingFacilities/meetingFacilities?meetingRoomId=' + meetingRoomId,
}) })
}, },
// 跳转-会议室已预约 // 跳转-会议室已预约
jumpMeetingBooked() { jumpMeetingBooked() {
let meetingRoomId = this.data.meetingRoomId; let meetingRoomId = this.data.meetingRoomId;
let time = this.data.date let time = this.data.date
let timeRange = this.data.timeRange let timeRange = this.data.timeRange
wx.navigateTo({ wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingBooked/meetingBooked?meetingRoomId=" + meetingRoomId + '&time=' + time + '&timeRange=' + timeRange, url: "/pages/meeting/meetingRoom/meetingBooked/meetingBooked?meetingRoomId=" + meetingRoomId + '&time=' + time + '&timeRange=' + timeRange,
}) })
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
} }
}) })

View File

@ -27,7 +27,7 @@
<view class="resView"> <view class="resView">
<view class="leftLineTitle">预约情况</view> <view class="leftLineTitle">预约情况</view>
<van-cell-group> <van-cell-group>
<van-cell wx:for="{{resList}}" 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.dep}} | {{item.user}} | {{item.tel}}" />
</van-cell-group> </van-cell-group>
</view> </view>

View File

@ -1,75 +1,76 @@
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
id: ''
},
}, /**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let _this = this;
_this.setData({
...options
})
},
/** // 跳转-会议预约记录
* 生命周期函数--监听页面加载 jumpMeetingRecord() {
*/ let _id = this.data.id
onLoad(options) { wx.reLaunch({
let _this = this; url: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord",
_this.setData({ })
...options },
})
},
// 跳转-会议预约记录 /**
jumpMeetingRecord() { * 生命周期函数--监听页面初次渲染完成
wx.reLaunch({ */
url: "/pages/meeting/reservationRecord/meetingRecord/meetingRecord", onReady() {
})
},
/** },
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
}, /**
* 生命周期函数--监听页面显示
*/
onShow() {
/** },
* 生命周期函数--监听页面显示
*/
onShow() {
}, /**
* 生命周期函数--监听页面隐藏
*/
onHide() {
/** },
* 生命周期函数--监听页面隐藏
*/
onHide() {
}, /**
* 生命周期函数--监听页面卸载
*/
onUnload() {
/** },
* 生命周期函数--监听页面卸载
*/
onUnload() {
}, /**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
/** },
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
}, /**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
/** },
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
}, /**
* 用户点击右上角分享
*/
onShareAppMessage() {
/** }
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

View File

@ -4,8 +4,8 @@
<view class="contentView"> <view class="contentView">
<image class="img" src="{{IMG_NAME + detail.roomContent.indoorPicUrlFirst}}" mode="aspectFill"></image> <image class="img" src="{{IMG_NAME + detail.roomContent.indoorPicUrlFirst}}" mode="aspectFill"></image>
<view class="msgView"> <view class="msgView">
<view class="title">{{detail.roomContent.capacityNum}}人间 | {{detail.roomContent.roomName}} | {{detail.roomContent.buildingName}}</view> <view class="title">{{detail.roomContent.buildingName}} | {{detail.roomContent.roomName}} | {{detail.roomContent.capacityNum}}人 | {{detail.roomContent.shape}}</view>
<view class="name">{{detail.title}}</view> <view class="name">{{detail.roomContent.meetingName}}</view>
<view class="time">{{detail.timeSlot}}</view> <view class="time">{{detail.timeSlot}}</view>
</view> </view>
<!-- <view class="priceView"> <!-- <view class="priceView">
@ -16,6 +16,18 @@
</view> </view>
<!-- 基本信息 --> <!-- 基本信息 -->
<view class="basicView">
<view class="labelTitle leftLineTitle">预约情况</view>
<view class="cellView">
<view class="label">预约状态</view>
<view class="content status" style="color: {{detail.statusColor}};">{{detail.statusName}}</view>
</view>
<view class="cellView" wx:if="{{detail.statusValue == 4}}">
<view class="label">取消原因</view>
<view class="content status" style="color: {{detail.statusColor}};">{{detail.cancelResaon}}</view>
</view>
</view>
<view class="basicView"> <view class="basicView">
<view class="labelTitle leftLineTitle">基本信息</view> <view class="labelTitle leftLineTitle">基本信息</view>
<view class="cellView"> <view class="cellView">
@ -23,13 +35,21 @@
<view class="content">{{detail.timeSlot}} 共计{{detail.countTime}}小时</view> <view class="content">{{detail.timeSlot}} 共计{{detail.countTime}}小时</view>
</view> </view>
<view class="cellView"> <view class="cellView">
<view class="label">会议主题</view> <view class="label">会议名称</view>
<view class="content">{{detail.title}}</view> <view class="content">{{detail.title}}</view>
</view> </view>
<view class="cellView"> <view class="cellView">
<view class="label">参会人数</view> <view class="label">参会人数</view>
<view class="content">{{detail.personNum}}</view> <view class="content">{{detail.personNum}}</view>
</view> </view>
<view class="cellView">
<view class="label">参会领导</view>
<view class="content">{{detail.leader}}</view>
</view>
<view class="cellView">
<view class="label">预约部门</view>
<view class="content">{{detail.depName}}</view>
</view>
<view class="cellView"> <view class="cellView">
<view class="label">会议预约人</view> <view class="label">会议预约人</view>
<view class="content">{{detail.userName}}</view> <view class="content">{{detail.userName}}</view>
@ -39,24 +59,16 @@
<view class="content">{{detail.phone}}</view> <view class="content">{{detail.phone}}</view>
</view> </view>
<view class="cellView"> <view class="cellView">
<view class="label">预约状态</view> <view class="label">备注</view>
<view class="content status" style="color: {{detail.statusColor}};">{{detail.statusName}}</view> <view class="content">{{detail.remark}}</view>
</view> </view>
<view class="serviceItemView"> <view class="serviceItemView">
<view class="label">空间设施</view> <view class="label">会议室设备</view>
<!-- 设施 --> <view class="serviceItem" wx:for="{{facilities.roomItem}}" wx:key="*this">
<view class="facilitiesView"> <view class="name">{{item.name}}</view>
<view class="itemView">
<view class="singleItem" wx:for="{{facilities.roomItem}}" 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>
<view class="cellView" wx:if="{{detail.statusValue == 4}}">
<view class="label">取消原因</view>
<view class="content status" style="color: {{detail.statusColor}};">{{detail.cancelResaon}}</view>
</view> </view>
<view class="serviceItemView"> <view class="serviceItemView">
<view class="label">会议服务</view> <view class="label">会议服务</view>
@ -72,7 +84,7 @@
</view> </view>
<!-- 参与人员 --> <!-- 参与人员 -->
<view class="basicView"> <!-- <view class="basicView">
<view class="labelTitle leftLineTitle">参与人员({{joinPersonList.length}}/{{detail.personNum}}</view> <view class="labelTitle leftLineTitle">参与人员({{joinPersonList.length}}/{{detail.personNum}}</view>
<view class="cellView borderNone"> <view class="cellView borderNone">
<view class="joinView"> <view class="joinView">
@ -82,14 +94,14 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
<!-- 底部区域 --> <!-- 底部区域 -->
<view class="bottomFix" wx:if="{{detail.showPay || detail.showInvite || detail.showCancel}}"> <view class="bottomFix" wx:if="{{detail.showPay || detail.showInvite || detail.showCancel}}">
<!-- <view class="btn" wx:if="{{detail.showPay}}" bind:tap="jumpPay" data-id="{{detail.id}}">去支付</view> --> <!-- <view class="btn" wx:if="{{detail.showPay}}" bind:tap="jumpPay" data-id="{{detail.id}}">去支付</view> -->
<view class="btn" wx:if="{{detail.showInvite}}">去邀请 <!-- <view class="btn" wx:if="{{detail.showInvite}}">去邀请
<button class="shareBtn" open-type="share" data-id="{{detail.id}}">转发</button> <button class="shareBtn" open-type="share" data-id="{{detail.id}}">转发</button>
</view> </view> -->
<view class="btn" wx:if="{{detail.showCancel}}" bind:tap="cancelOrder" data-id="{{detail.id}}">取消预约</view> <view class="btn" wx:if="{{detail.showCancel}}" bind:tap="cancelOrder" data-id="{{detail.id}}">取消预约</view>
</view> </view>

View File

@ -29,11 +29,11 @@ Page({
reservationPageSize: 10, reservationPageSize: 10,
reservationDataList: [], reservationDataList: [],
reservationIsDataAll: false, reservationIsDataAll: false,
// 参与记录参数 // 参与记录参数,不需要
participatePageNum: 1, // participatePageNum: 1,
participatePageSize: 10, // participatePageSize: 10,
participateDataList: [], // participateDataList: [],
participateIsDataAll: false, // participateIsDataAll: false,
}, },
/** /**
@ -53,11 +53,11 @@ Page({
pageSize: _this.data.reservationPageSize, pageSize: _this.data.reservationPageSize,
}) })
// 获取参与数据 // 获取参与数据
_this.getParticipateData({ // _this.getParticipateData({
userId, // userId,
pageNum: _this.data.participatePageNum, // pageNum: _this.data.participatePageNum,
pageSize: _this.data.participatePageSize // pageSize: _this.data.participatePageSize
}) // })
}, },
// 获取数据 // 获取数据
@ -69,24 +69,28 @@ Page({
let isDataAll = null let isDataAll = null
let pageNum = null let pageNum = null
let pageSize = null let pageSize = null
if (tabTitle == '预约记录') { // 预约记录参数,目前只保留预约记录,其余去掉
// 预约记录参数 isDataAll = _this.data.reservationIsDataAll
isDataAll = _this.data.reservationIsDataAll pageNum = _this.data.reservationPageNum
pageNum = _this.data.reservationPageNum pageSize = _this.data.reservationPageSize
pageSize = _this.data.reservationPageSize // if (tabTitle == '预约记录') {
// // 预约记录参数
// isDataAll = _this.data.reservationIsDataAll
// pageNum = _this.data.reservationPageNum
// pageSize = _this.data.reservationPageSize
} else if (tabTitle == '预约记录') { // } else if (tabTitle == '预约记录') {
// 参与记录参数 // // 参与记录参数
isDataAll = _this.data.participateIsDataAll // isDataAll = _this.data.participateIsDataAll
pageNum = _this.data.participatePageNum // pageNum = _this.data.participatePageNum
pageSize = _this.data.participatePageSize // pageSize = _this.data.participatePageSize
} else { // } else {
wx.showToast({ // wx.showToast({
title: `tab 切换错误(${tabTitle})`, // title: `tab 切换错误(${tabTitle})`,
icon: 'none', // icon: 'none',
}); // });
return; // return;
} // }
// 判断数据是否已全部加载 // 判断数据是否已全部加载
if (isDataAll) { if (isDataAll) {
@ -98,13 +102,14 @@ Page({
pageNum, pageNum,
pageSize pageSize
} }
if (tabTitle == '预约记录') { _this.getReservationData(param)
// 获取预约数据 // if (tabTitle == '预约记录') {
_this.getReservationData(param) // // 获取预约数据
} else if (tabTitle == '预约记录') { // _this.getReservationData(param)
// 获取参与数据 // } else if (tabTitle == '预约记录') {
_this.getParticipateData(param) // // 获取参与数据
} // _this.getParticipateData(param)
// }
}, },
// 获取预约数据 // 获取预约数据
@ -119,7 +124,8 @@ Page({
selectReservationListByUserIdRq({ selectReservationListByUserIdRq({
pageNum, pageNum,
pageSize, pageSize,
userId userId,
parkId: 25,
}).then(res => { }).then(res => {
console.log('selectReservationListByUserIdRq', res); console.log('selectReservationListByUserIdRq', res);
// 判断数据是否全部查询 // 判断数据是否全部查询
@ -140,7 +146,7 @@ Page({
}) })
}, },
// 获取参与数据 // 获取参与数据,此处不需要
getParticipateData(param) { getParticipateData(param) {
let _this = this; let _this = this;
let { let {
@ -244,8 +250,9 @@ Page({
}, },
// 跳转-支付 // 跳转-支付,此处不需要
jumpPay(e) { jumpPay(e) {
return
console.log('jumpPay', e); console.log('jumpPay', e);
wx.navigateTo({ wx.navigateTo({
url: "/pages/meeting/pay/waitPay/waitPay?id=" + e.currentTarget.dataset.id + "&type=meetingRoom" url: "/pages/meeting/pay/waitPay/waitPay?id=" + e.currentTarget.dataset.id + "&type=meetingRoom"
@ -263,6 +270,7 @@ Page({
// 跳转-参与详情 // 跳转-参与详情
jumpParticipateDetail(e) { jumpParticipateDetail(e) {
return
console.log('jumpParticipateDetail', e); console.log('jumpParticipateDetail', e);
let id = e.currentTarget.dataset.id let id = e.currentTarget.dataset.id
wx.navigateTo({ wx.navigateTo({
@ -272,6 +280,7 @@ Page({
// tab 点击切换 // tab 点击切换
tabClickSwitch(event) { tabClickSwitch(event) {
return
console.log('tabClickSwitch', event); console.log('tabClickSwitch', event);
let _this = this; let _this = this;
_this.setData({ _this.setData({
@ -345,9 +354,9 @@ Page({
reservationDataList: [], reservationDataList: [],
reservationIsDataAll: false, reservationIsDataAll: false,
// 参与记录参数 // 参与记录参数
participatePageNum: 1, // participatePageNum: 1,
participateDataList: [], // participateDataList: [],
participateIsDataAll: false, // participateIsDataAll: false,
}) })
// 获取数据 // 获取数据
@ -359,11 +368,11 @@ Page({
pageSize: _this.data.reservationPageSize, pageSize: _this.data.reservationPageSize,
}) })
// 获取参与数据 // 获取参与数据
_this.getParticipateData({ // _this.getParticipateData({
userId, // userId,
pageNum: _this.data.participatePageNum, // pageNum: _this.data.participatePageNum,
pageSize: _this.data.participatePageSize // pageSize: _this.data.participatePageSize
}) // })
} }
}, },
@ -386,7 +395,6 @@ Page({
*/ */
onPullDownRefresh() { onPullDownRefresh() {
console.log('onPullDownRefresh', '页面相关事件处理函数--监听用户下拉动作'); console.log('onPullDownRefresh', '页面相关事件处理函数--监听用户下拉动作');
}, },
/** /**

View File

@ -6,6 +6,6 @@
"van-dialog": "@vant/weapp/dialog/index", "van-dialog": "@vant/weapp/dialog/index",
"van-notify": "@vant/weapp/notify/index" "van-notify": "@vant/weapp/notify/index"
}, },
"navigationBarTitleText": "会议预约记录", "navigationBarTitleText": "预约记录",
"onReachBottomDistance": 100 "onReachBottomDistance": 100
} }

View File

@ -1,5 +1,5 @@
<view class="containerView public"> <view class="containerView public">
<van-tabs bind:click="tabClickSwitch" color="#4e96f8" border animated title-active-color="black" title-inactive-color="gray"> <!-- <van-tabs bind:click="tabClickSwitch" color="#4e96f8" border animated title-active-color="black" title-inactive-color="gray">
<van-tab title="预约记录"> <van-tab title="预约记录">
<view class="itemView" wx:for="{{reservationDataList}}" wx:for-item="item" wx:key="*this"> <view class="itemView" wx:for="{{reservationDataList}}" wx:for-item="item" wx:key="*this">
<view class="headView"> <view class="headView">
@ -16,13 +16,8 @@
</view> </view>
<view class="priceView"> <view class="priceView">
<view class="cancelContent" wx:if="{{item.statusValue == 4 && item.cancelResaon}}">取消原因: {{item.cancelResaon}}</view> <view class="cancelContent" wx:if="{{item.statusValue == 4 && item.cancelResaon}}">取消原因: {{item.cancelResaon}}</view>
<!-- <view class="priceContent">
<view class="name">总价:</view>
<view class="price">¥{{item.orderMoney}}</view>
</view> -->
</view> </view>
<view class="btnView"> <view class="btnView">
<!-- <view class="btn" wx:if="{{item.showPay}}" bind:tap="jumpPay" data-id="{{item.id}}">去支付</view> -->
<view class="btn" wx:if="{{item.showInvite}}">去邀请 <view class="btn" wx:if="{{item.showInvite}}">去邀请
<button class="shareBtn" open-type="share" data-id="{{item.id}}">转发</button> <button class="shareBtn" open-type="share" data-id="{{item.id}}">转发</button>
</view> </view>
@ -54,11 +49,39 @@
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider> <van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
</view> </view>
</van-tab> </van-tab>
</van-tabs> </van-tabs> -->
<!-- 提示框 --> <view class="itemView" wx:for="{{reservationDataList}}" wx:for-item="item" wx:key="*this">
<van-dialog id="van-dialog" /> <view class="headView">
<!-- 提示框 --> <view class="number">{{item.title}}</view>
<van-notify id="van-notify" /> <view class="status" style="color: {{item.statusColor}};">{{item.statusName}}</view>
</view>
<view class="contentView" bind:tap="jumpMeetingDetail" data-id="{{item.id}}">
<image class="img" src="{{IMG_NAME + item.roomContent.indoorPicUrlFirst}}" mode="aspectFill"></image>
<view class="msgView">
<view class="title">{{item.roomContent.buildingName}} | {{item.roomContent.roomName}} | {{item.roomContent.capacityNum}} | {{item.roomContent.shape}}</view>
<view class="name">预约人: {{item.createBy}}</view>
<view class="time">{{item.timeSlot}}</view>
</view>
</view>
<view class="priceView">
<view class="cancelContent" wx:if="{{item.statusValue == 4 && item.cancelResaon}}">取消原因: {{item.cancelResaon}}</view>
</view>
<view class="btnView">
<!-- <view class="btn" wx:if="{{item.showInvite}}">去邀请
<button class="shareBtn" open-type="share" data-id="{{item.id}}">转发</button>
</view> -->
<view class="btn" wx:if="{{item.showCancel}}" bind:tap="cancelOrder" data-id="{{item.id}}">取消预约</view>
<view class="btn" wx:if="{{item.showDetail}}" bind:tap="jumpMeetingDetail" data-id="{{item.id}}">查看详情</view>
</view>
</view>
<view class="loadAllLine" wx:if="{{reservationIsDataAll}}">
<van-divider class="van-divider" customStyle="font-size: 26rpx;" contentPosition="center">数据已全部加载</van-divider>
</view>
<!-- 提示框 -->
<van-dialog id="van-dialog" />
<!-- 提示框 -->
<van-notify id="van-notify" />
</view> </view>