Commit bd071410 by liang ce

会议室列表模块

parent 112bd921
......@@ -208,3 +208,19 @@ export function deleteSchedule(data) {
url: `/meet/schedule/deleteSchedule`
})
}
// 可用会议室列表
export function queryAvailableMeetingRoomByTime(data) {
return $http({
method: 'post',
data: JSON.stringify(data),
url: `/meet/meeting-room/queryAvailableMeetingRoomByTime`
})
}
// 跨天会议判断是否可点击
export function getAllScheduleWithMeetingRoomByTime(data) {
return $http({
method: 'post',
data: JSON.stringify(data),
url: `/meet/meeting-room/getAllScheduleWithMeetingRoomByTime`
})
}
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/meetingRoomList/meetingRoomList",
"pages/repetitionTime/repetitionTime",
"pages/repeatMechanism/repeatMechanism",
"pages/attendingSituation/attendingSituation",
"pages/addRemark/addRemark",
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/remind/remind",
"pages/scheduleDetail/scheduleDetail",
"pages/place/place",
"pages/participantsDetail/participantsDetail"
],
"window": {
"defaultTitle": "My App"
}
]
}
.beOverdue{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: rgba(25,31,37,0.12);
box-sizing: border-box;
}
.Unchecked{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-sizing: border-box;
border: 3px solid #979797;
}
.checked{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #3296FA;
box-sizing: border-box;
}
\ No newline at end of file
<view>
<view a:if="{{disable}}" class="beOverdue">
</view>
<view a:elif="{{!disable && isCheck}}" class="checked" data-type="0" catchTap="changeIsCheck">
</view>
<view a:else="{{!disable && !isCheck}}" class="Unchecked" data-type="1" catchTap="changeIsCheck">
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {
isCheck: false,
disable: false
},
props: {
date: '',
startTime: '',
endTime: '',
sectionStartTime: '',
sectionEndTime: ''
},
didMount() {
console.log('开始')
let dateSectionStartTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.sectionStartTime);//选框开始时间
let dateSectionEndTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.sectionEndTime);//选框结束时间
// 判断是否过期
if (dateSectionStartTime.getTime() <= new Date().getTime()) {
this.setData({
disable: true
})
} else {
// 判断是否有开始结束时间
if (this.props.startTime && this.props.endTime){
let dateMS = new Date(this.props.date.replace(/-/g, "/"));
let dateStartTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.startTime); // 已选开始时间
let dateEndTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.endTime);// 已选结束时间
// 有开时间判断是否选中
if (dateStartTime.getTime() <= dateSectionStartTime.getTime() && dateEndTime.getTime() >= dateSectionEndTime.getTime()) { // 判断当前时间短是否选中
this.setData({
isCheck: true
})
} else {
this.setData({
isCheck: false
})
}
}
}
},
didUpdate() {
let dateSectionStartTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.sectionStartTime);//选框开始时间
let dateSectionEndTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.sectionEndTime);//选框结束时间
// 判断是否过期
if (dateSectionEndTime.getTime() <= new Date().getTime()) {
this.setData({
disable: true
})
} else {
// 判断是否有开始结束时间
if (startTime && endTime){
let dateMS = new Date(this.props.date.replace(/-/g, "/"));
let dateStartTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.startTime); // 已选开始时间
let dateEndTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.endTime);// 已选结束时间
// 有开时间判断是否选中
if (dateStartTime.getTime() <= dateSectionStartTime.getTime() && dateEndTime.getTime() >= dateSectionEndTime.getTime()) { // 判断当前时间短是否选中
this.setData({
isCheck: true
})
} else {
this.setData({
isCheck: false
})
}
}
}
},
didUnmount() {},
methods: {
changeIsCheck(e) {
console.log(e)
let dateSectionStartTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.sectionStartTime);//选框开始时间
let dateSectionEndTime = new Date(this.props.date.replace(/-/g, "/")+' '+this.props.sectionEndTime);//选框结束时间
let data = {
startTime: dateSectionStartTime,
endTime:dateSectionEndTime
}
if (e.currentTarget.dataset.type == 0) {
let data = {
startTime: dateSectionStartTime,
endTime:dateSectionEndTime,
type: 0
}
this.props.onselectTime(data)
} else {
let data = {
startTime: dateSectionStartTime,
endTime:dateSectionEndTime,
type: 1
}
this.props.onselectTime(date)
}
}
},
});
{
"component": true
}
\ No newline at end of file
......@@ -29,8 +29,6 @@ create.Page({
organizer: ''
},
onLoad(event) {
console.log(this.selectedelRequired([1, 2, 4, 5], [1, 2, 4, 6]))
let index = new Date().getDay()
this.data.repeatWeek = this.data.repeatWeek[index - 1]
this.store.data.remark = ''
......@@ -85,6 +83,17 @@ create.Page({
setTimeout(function () {
_that.update()
}, 100)
if (this.store.data.startTime && this.store.data.endTime) {
var weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
var date1 = new Date(this.store.data.startTime);
var date2 = new Date(this.store.data.endTime);
this.setData({
time1: this.store.data.startTime,
time2: this.store.data.endTime,
week1: weekList[date1.getDay()],
week2: weekList[date2.getDay()]
})
}
},
// 选择时间
selectTime(event) {
......@@ -118,13 +127,17 @@ create.Page({
week2: w2
})
this.conflict()
this.store.data.startTime = `${e.time}:00`
this.store.data.endTime = `${y}/${m}/${d} ${h < 10 ? "0" + date.getHours() : date.getHours()}:${min < 10 ? "0" + min : min}:00`
this.update()
} else {
this.setData({
time1: `${e.time}:00`,
isShowModal: false,
week1: w1
})
this.store.data.startTime = `${e.time}:00`
this.update()
this.conflict()
}
} else {
......@@ -142,6 +155,8 @@ create.Page({
isShowModal: false,
week2: w1
})
this.store.data.endTime = `${e.time}:00`
this.update()
this.conflict()
}
}
......@@ -173,7 +188,6 @@ create.Page({
} else {
select = [...this.store.data.participatorUserId]
require = [...this.data.requireUsers]
console.log(require)
}
dd.complexChoose({
limitTips: "超出了", //超过限定人数返回提示
......@@ -226,6 +240,9 @@ create.Page({
dd.navigateTo({ url: `./../participantsDetail/participantsDetail?time=${JSON.stringify(time)}` })
break;
case 'place':
this.store.data.startTime = this.data.time1
this.store.data.startTime = this.data.time2
this.update()
dd.navigateTo({ url: './../place/place' })
break;
case 'remind':
......@@ -256,6 +273,28 @@ create.Page({
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return year + '-' + month + '-' + day
},
resetStore(){
this.store.data = {
participatorList: [], // 参会人列表
locationName: '',
conflictPeople: [],
participatorUserId: [], // 参会人的userId
userList: [],
// 重复 重复机制
repeatable:0,
recurrenceModel:{
model:"no_repeat",
},
editList: [{ icon: 'icondingwei', text: '地点' }, { icon: 'iconhuiqiantixing', text: '提醒' }, { icon: 'iconchongfu', text: '重复' }, { icon: 'icondidianmiaoshu', text: '描述' }, { icon: 'iconshanchu', text: '删除' }],
remark: '', // 会议描述
aheadTimes: [],
requireUserList: [],
startTime: '',
endTime: '',
roomId: ''
}
this.update()
},
// 保存
saveCreate() {
if (!!this.data.scheduleItem) {
......@@ -263,9 +302,6 @@ create.Page({
this.store.data.recurrenceModel.terminateTime = this.getTwoYearToday();
this.update()
}
console.log(1111111)
console.log(JSON.stringify(this.data.addUserList))
console.log(1111111)
let data = {
shcheduleType: 'common',
deleteUserList: this.data.deleteUserList,
......@@ -282,16 +318,16 @@ create.Page({
},
startTime: `${this.data.time1.replace(/\//g, "-")}`,
endTime: `${this.data.time2.replace(/\//g, '-')}`,
scheduleType: 'common',
scheduleType: this.store.data.roomId ? 'meeting' : 'common',
noticeType: 'dd_notice',
participatorList: this.store.data.participatorList,
repeatable: this.store.data.repeatable,
aheadTimes: this.store.data.aheadTimes,
recurrenceModel: this.store.data.recurrenceModel,
meetingRoomId: null,
meetingRoomId: this.store.data.roomId,
remark: this.store.data.remark
}
this.resetStore()
modifySchedule(data).then(res => {
dd.navigateBack({
delta: 2
......@@ -341,6 +377,7 @@ create.Page({
break;
case 'icondingwei':
this.store.data.locationName = null
this.store.data.roomId = null
break;
}
this.update()
......@@ -359,7 +396,6 @@ create.Page({
if (res.data.data[value]) {
this.store.data.conflictPeople.push(value)
}
}
}
this.update()
......@@ -395,10 +431,9 @@ create.Page({
title: res.data.data.title,
time1: res.data.data.startTime.replace(/-/g, '/'),
time2: res.data.data.endTime.replace(/-/g, '/'),
week1: this.data.weekList[new Date(res.data.data.startTime.replace(/\//g, "-")).getDay()],
week2: this.data.weekList[new Date(res.data.data.endTime.replace(/\//g, "-")).getDay()]
week1: this.data.weekList[new Date(res.data.data.startTime.replace(/-/g, "/")).getDay()],
week2: this.data.weekList[new Date(res.data.data.endTime.replace(/-/g, "/")).getDay()]
})
this.update()
this.conflict()
})
......@@ -416,6 +451,9 @@ create.Page({
dd.navigateTo({ url: './../remind/remind' })
break;
case 'icondingwei':
this.store.data.startTime = this.data.time1;
this.store.data.endTime = this.data.time2;
this.update()
dd.navigateTo({ url: './../place/place' })
break;
case 'iconshanchu':
......@@ -437,31 +475,15 @@ create.Page({
})
}
})
break;
}
},
// 选择终止时间
selectTerminal() {
// let time2 = this.data.time2
// dd.datePicker({
// format: 'yyyy-MM-dd',
// currentDate: '',
// success: (res) => {
// this.store.data.recurrenceModel.terminateTime = `${res.date} `
// this.update()
// },
// error: (err) => {
// console.log(JSON.stringify(err))
// }
// })
dd.navigateTo(({ url: `./../repetitionTime/repetitionTime` }))
},
// 数组取差值 原先的数组与现在的比较 增加与减少
arrayPoor(origin, now) {
console.log(JSON.stringify(origin))
console.log(JSON.stringify(now))
let originMap = new Map()
let nowMap = new Map()
let add = []
......@@ -482,8 +504,6 @@ create.Page({
del.push(x)
}
}
console.log(1111)
console.log(JSON.stringify(add))
this.setData({
addUserList: add,
deleteUserList: del
......
/* 预定会议列表 */
.searchHeader {
box-sizing: border-box;
background: #fff;
width: 100%;
}
.searchHeader1 {
border-bottom: 1px solid rgba(25,31,37,0.12);
font-size: 26rpx;
letter-spacing: -0.31rpx;
height: 96rpx;
box-sizing: border-box;
padding: 0 32rpx;
display: flex;
align-items: center;
}
.searchHeader1 > view {
display: flex;
justify-content: flex-end;
}
.searchHeader2 {
width: 750rpx;
height: 96rpx;
overflow: hidden;
border-bottom: 1px solid rgba(25,31,37,0.12);
box-sizing: border-box;
}
.searchTime {
width: 176rpx;
}
.searchTime>view:nth-of-type(1) {
flex: 1;
}
.searchTime>view:nth-of-type(2) {
margin: 0 10rpx 0 16rpx;
width: 24rpx;
}
.searchCategory {
display: flex;
width: 200rpx;
}
.searchCategory>view:nth-of-type(1) {
flex: 1;
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: right;
}
.searchCategory>view:nth-of-type(2) {
margin: 0 10rpx 0 16rpx;
width: 24rpx;
}
.searchLocation {
width: 200rpx;
}
.searchLocation>view:nth-of-type(1) {
flex: 1;
overflow:hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-align: right;
}
.searchLocation>view:nth-of-type(2) {
margin: 0 10rpx 0 16rpx;
width: 24rpx;
}
.reserveMeeting {
width: 100%;
}
.meetingRoomContent{
padding: 32rpx 32rpx 28rpx 32rpx;
margin-top: 16rpx;
background: #ffffff;
}
.searchHeader2 > scroll-view{
overflow-x: scroll;
display: flex;
height: 100%;
padding: 0 32rpx;
align-items: center;
}
.equipFacilityList{
margin-right: 24rpx;
white-space: nowrap;
display: flex;
align-items: center;
}
.roomMessage {
width: 100%;
align-items: center
}
.reserveRoomTitle {
font-size: 32rpx;
color: #191F25;
line-height: 34rpx;
margin-bottom: 16rpx;
}
.reserveRoomEquipFacility {
font-size: 24rpx;
color: rgba(25,31,37,0.56);
letter-spacing: 0;
line-height: 26rpx;
margin-bottom: 16rpx;
}
.reserveRoomEquipFacility text {
color: rgba(25,31,37,0.56);
}
.reserveRoomNumAndLocation {
display: flex;
font-size: 24rpx;
color: rgba(25,31,37,0.56);
letter-spacing: 0;
}
.reserveRoomNum {
margin-right: 16rpx;
color: rgba(25,31,37,0.56);
}
.reserveRoomLocation {
color: rgba(25,31,37,0.56);
}
.reserveRoomTimeBarBg{
width: 100%;
display: flex;
margin-top: 32rpx;
border: 1px solid rgba(25,31,37,0.08);
box-sizing: border-box;
}
.reserveRoomTimeBarBg>view{
flex: 1;
height: 32rpx;
border-right: 1px solid #ffffff;
box-sizing: border-box;
}
.preemption {
background: #FFFFFF;
}
.expired {
background: #EDEDEE;
}
.reservation {
background: #FFFFFF;
}
.occupied {
background: #3296FA;
}
.reserveRoomTimeBarNum {
display: flex;
margin-top: 12rpx;
font-size: 20rpx;
color: #A3A5A8;
}
.reserveRoomTimeBarNum > view {
flex: 1;
}
/* 弹框的样式 */
.modal{
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
display: flex;
align-items: flex-end;
}
.modalContent{
width: 100%;
height: 838rpx;
background: #FFFFFF;
box-shadow: 0 -2px 20px 0 rgba(25,31,37,0.12);
}
.modalHeader{
height: 104rpx;
line-height: 104rpx;
font-size: 34rpx;
display: flex;
padding: 0 32rpx;
box-sizing: border-box;
border-bottom: 1px solid rgba(25,31,37,0.12);
}
.modalHeader>view{
flex: 1;
}
.modalHeader>view:nth-of-type(1){
color: #191F25;
text-align: left;
}
.modalHeader>view:nth-of-type(2){
color: #3296FA;
text-align: right;
}
.changeDay{
width: 100%;
border-bottom: 1px solid rgba(25,31,37,0.12);
font-size: 30rpx;
text-align: center;
display: flex;
height: 104rpx;
line-height: 104rpx;
}
.changeDay>view {
flex: 1;
}
.modalOccupyTimeSlot{
height: 504rpx;
width: 100%;
}
.modalOccupyTimeSlot>view{
height: 100rpx;
width: 100%;
padding-left: 32rpx;
}
.OccupyTimeList{
height: 100rpx;
width: 100%;
box-sizing: border-box;
padding-left: 32rpx;
display: flex;
align-items: center;
}
.OccupyTimeList>view:nth-of-type(1){
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-right: 32rpx;
}
.OccupyTimeList>view:nth-of-type(2){
flex: 1;
display: flex;
height: 100rpx;
line-height: 100rpx;
box-sizing: border-box;
border-bottom: 1px solid rgba(25,31,37,0.12);
}
.OccupyTimeList>view:nth-of-type(2) view{
flex: 1;
}
.OccupyTimeList>view:nth-of-type(2) view:nth-of-type(1){
color: #000000;
font-size: 34rpx;
font-weight: bold;
}
.OccupyTimeList>view:nth-of-type(2) view:nth-of-type(2){
text-align: right;
margin-right: 32rpx;
}
.beOverdue{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: rgba(25,31,37,0.12);
box-sizing: border-box;
}
.Unchecked{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-sizing: border-box;
border: 3px solid #979797;
}
.checked{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #3296FA;
box-sizing: border-box;
}
\ No newline at end of file
<view class="searchHeader">
<view class="searchHeader1">
<view class="searchTime" onTap="selectSearchTime">
<view>
{{search.time.replace(/-/g,".")}}
</view>
<view class="xialakuangSize">
<text class="iconfont iconxialakuang"></text>
</view>
</view>
<view class="searchLocation">
<view>
{{search.location}}
</view>
<view class="xialakuangSize">
<text class="iconfont iconxialakuang"></text>
</view>
</view>
</view>
<view class="searchHeader2">
<scroll-view scroll-x='{{true}}' scroll-left='{{100}}' scroll-into-view='searchList'>
<view a:for="{{equipFacilityList}}" class="equipFacilityList" onTap="changeSearchEquipFacility" data-id='{{item.id}}'>
<view class="selectListcheck {{ search.checkList.indexOf(item.id) === -1 ? 'selectListcheck' : 'selectListCheckAciton'}}">
<text class="iconfont iconyigouxuan"></text>
</view>
<view>
{{item.name}}
</view>
</view>
</scroll-view>
</view>
</view>
<view class="reserveMeeting">
<scroll-view scroll-y='{{true}}' scroll-into-view='searchList' class="reserveMeetingScrollView">
<view class="meetingRoomContent" a:for="{{reserveRoomList}}" data-roomid="{{item.meetingRoomId}}" data-roomname="{{item.name}}" onTap="changeRoomTime">
<view class="roomMessage">
<view class="reserveRoomMsg">
<view class="reserveRoomTitle">
{{item.name}}
</view>
<view class="reserveRoomEquipFacility">
设备:<text a:for="{{item.equipFacilityNames}}" a:if="{{item2 !== null}}" a:for-item="item2" a:for-index="index2">{{item2}}{{index2 === item.equipFacilityNames.length-1 ? '' : '/'}}</text>
</view>
<view class="reserveRoomNumAndLocation">
<view class="reserveRoomNum">
<text class="locationIcon iconfont icondingwei"></text>{{item.capacityNum}}
</view>
<view class="reserveRoomLocation">
<text class="locationIcon iconfont iconbeifangren"></text>{{item.locationName}}
</view>
</view>
</view>
</view>
<view class="reserveRoomTimeBar">
<view class="reserveRoomTimeBarBg">
<block a:for="{{item.timeSlotWithMeetingVOS}}" a:for-item="item2" a:for-index="index2">
<view class="expired" a:if="{{item2.reserveStatus === 'expired'}}">
</view>
<view class="occupied" a:if="{{item2.reserveStatus === 'occupied'}}">
</view>
<view class="reservation" a:if="{{item2.reserveStatus === 'reservation'}}">
</view>
</block>
</view>
<view class="reserveRoomTimeBarNum">
<view a:for="{{timeListStr}}" a:for-item="item2" a:for-index="index2">
{{item2}}
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<view a:if="{{isShowModal}}" class="modal">
<view class="modalContent">
<view class="modalHeader">
<view data-type="0" onTap="onCancel">
取消
</view>
<view data-type="1" onTap="onDetermine">
确定
</view>
</view>
<view class="changeDay">
<view onTap="chooseDate" data-num="0">今天</view>
<view onTap="chooseDate" data-num="1">明天</view>
<view onTap="chooseDate" data-num="2">后天</view>
<!-- <view onTap="selectDate">自定义</view> -->
</view>
<scroll-view scroll-y='{{true}}' class="modalOccupyTimeSlot">
<view class="OccupyTimeList" a:for="{{modalList}}">
<!-- <view data-status="{{item.reserveStatus}}" data-index="{{index}}">
<timecheckmodal
startTime="{{meetingTime.startTime}}"
endTime="{{meetingTime.endTime}}"
date="{{meetingTime.date}}"
sectionStartTime="{{item.reserveStartTime}}"
sectionEndTime="{{item.reserveEndTime}}"
onselectTime="{{onselectTime}}"
>
</timecheckmodal>
</view> -->
<view>
<view a:if="{{item.status==='BeOverdue'}}" class="beOverdue">
</view>
<view a:elif="{{item.status==='Uncheck'}}" data-index="{{index}}" class="Unchecked" onTap="onChangeModalTime">
</view>
<view a:elif="{{item.status==='checked'}}" data-index="{{index}}" class="checked" onTap="onChangeModalTime">
</view>
</view>
<view>
<view>{{item.reserveStartTime.substr(10,15)}} ~ {{item.reserveEndTime.substr(10,15)}} </view>
<view class="expiredStatus" a:if="{{item.reserveStatus === 'expired'}}">
已过期
</view>
<view class="occupiedStatus" a:if="{{item.reserveStatus === 'occupied'}}">
已被{{item.scheduleList[0].participatorList[0].username}}预定
</view>
</view>
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file
{
"usingComponents": {
"timecheckmodal": "../../components/timeCheckModal/timeCheckModal"
}
}
\ No newline at end of file
......@@ -8,66 +8,26 @@
<view class="title">
可用会议室
</view>
<view class="mettingRoom" data-locationName="未来Park1" onTap="selectPlace">
<block a:for="{{availableMeetingRoom}}">
<view class="mettingRoom" data-locationName="{{item.name}}" data-locationid="{{item.meetingRoomId}}" onTap="selectMeetingRoom">
<view class="icon iconfont iconhuiyishi">
</view>
<view class="mettingRoomRight">
<view class="name">
未来Park-5F-510
{{item.name}}
</view>
<view class="mettingRoomDetail">
<view class="num">
<text class="numIcon iconfont iconbeifangren"></text>
<text>10</text>
<text>{{item.capacityNum}}</text>
</view>
<view class="equipment">
<text>投影</text>
<text>粉笔</text>
<text>黑板</text>
</view>
</view>
</view>
</view>
<view class="mettingRoom" data-locationName="未来Park2" onTap="selectPlace">
<view class="icon iconfont iconhuiyishi">
</view>
<view class="mettingRoomRight">
<view class="name">
未来Park-5F-510
</view>
<view class="mettingRoomDetail">
<view class="num">
<text class="numIcon iconfont iconbeifangren"></text>
<text>10</text>
</view>
<view class="equipment">
<text>投影</text>
<text>粉笔</text>
<text>黑板</text>
</view>
</view>
</view>
</view>
<view class="mettingRoom" data-locationName="未来Park3" onTap="selectPlace">
<view class="icon iconfont iconhuiyishi">
</view>
<view class="mettingRoomRight">
<view class="name">
未来Park-5F-510
</view>
<view class="mettingRoomDetail">
<view class="num">
<text class="numIcon iconfont iconbeifangren"></text>
<text>10</text>
</view>
<view class="equipment">
<text>投影</text>
<text>粉笔</text>
<text>黑板</text>
<text a:for="{{item.equipFacilityLabelList}}" a:for-item="equipmentList">{{equipmentList.name}}</text>
</view>
</view>
</view>
</view>
</block>
</view>
<view class="customLocation" data-locationName="{{place}}" onTap="selectPlace" a:else>
<view class="customName">
......@@ -78,7 +38,7 @@
</view>
</view>
<view class="allMettingRoom" a:if="{{true}}" >
<view class="allMettingRoom" a:if="{{true}}" onTap="toRoomList">
查看所有会议室
</view>
</view>
......
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
import {queryAvailableMeetingRoomByTime} from './../../api/request'
create.Page({
store: exampleStore,
useAll: true,
data: {
place: ''
place: '',
availableMeetingRoom: []
},
onLoad() {
onLoad(e) {
dd.setNavigationBar({
title: '会议地点'
})
let that = this
let data = {
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-")
}
queryAvailableMeetingRoomByTime(data).then(res => {
that.setData({
availableMeetingRoom: res.data.data
})
})
},
selectPlace(event) {
this.store.data.locationName = event.target.dataset.locationName
this.store.data.roomId = ''
this.update()
dd.navigateBack({
delta: 1
})
},
selectMeetingRoom(e) {
this.store.data.locationName = e.target.dataset.locationName
this.store.data.roomId = e.target.dataset.locationid
this.update()
dd.navigateBack({
delta: 1
......@@ -22,5 +43,8 @@ create.Page({
this.setData({
place: event.detail.value
})
},
toRoomList() {
dd.navigateTo({ url: `./../meetingRoomList/meetingRoomList` })
}
});
......@@ -136,88 +136,5 @@ create.Page({
isBeOverdue: isBeOverdue,
pickerValue: [data[0],data[1],data[2]]
})
// let weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
// if (this.data.timeYear[data[0]] == this.data.year && this.data.timeMonth[data[1]] == this.data.month) {
// // 修改日
// console.log('日')
// let date = new Date(this.data.year, this.data.month - 1, this.data.timeDay[data[2]])
// let week = weekList[date.getDay()]
// this.setData({
// day: this.data.timeDay[data[2]],
// week: week
// })
// } else if (this.data.timeDay[data[2]] == this.data.day && this.data.timeMonth[data[1]] == this.data.month) {
// debugger
// // 修改年
// console.log('年')
// let changeYearDate = new Date(this.data.timeYear[data[0]], this.data.timeMonth[data[1]], this.data.timeDay[data[2]]);
// let timeMonth = [];
// let timeDay = [];
// let isSameYear = this.data.timeYear[data[0]] == new Date().getFullYear()
// if (isSameYear) {
// for (let i = new Date().getMonth() + 1 > this.data.timeMonth[data[1]] ? new Date().getMonth() + 1 : changeYearDate.getMonth(); i <= 12;i++) {
// timeMonth.push(i)
// }
// let day = this.getMonthLength(this.data.timeYear[data[0]],changeYearDate.getMonth(),1)
// for (let i = new Date().getMonth() + 1 == this.data.timeMonth[data[1]] ? new Date().getDate() : 1 ;i <= day;i++) {
// timeDay.push(i)
// }
// let week = weekList[changeYearDate.getDay()]
// this.setData ({
// timeMonth: timeMonth,
// timeDay: timeMonth,
// year: this.data.timeYear[data[0]],
// month: data[1] > timeMonth.length ? timeMonth[timeMonth.length] : timeMonth[data[1]],
// day: data[2] > timeDay.length ? timeDay[timeDay.length] : timeDay[data[2]],
// // pickerValue: pickerValue,
// week: week
// })
// } else {
// for (let i = 1; i <= 12;i++) {
// timeMonth.push(i)
// }
// let day = this.getMonthLength(this.data.timeYear[data[0]],timeMonth[data[1]],1)
// for (let i = 1 ;i <= day;i++) {
// timeDay.push(i)
// }
// let week = weekList[changeYearDate.getDay()]
// this.setData ({
// timeMonth: timeMonth,
// timeDay: timeMonth,
// year: this.data.timeYear[data[0]],
// month: data[1] > timeMonth.length ? timeMonth[timeMonth.length] : timeMonth[data[1]],
// day: data[2] > timeDay.length ? timeDay[timeDay.length] : timeDay[data[2]],
// // pickerValue: pickerValue,
// week: week
// })
// }
// // let pickerValue = [data[0],data[1] > timeMonth.length ? timeMonth.length : data[1],data[2] > timeDay.length ? timeDay.length : data[2]]
// } else if (this.data.timeYear[data[0]] == this.data.year && this.data.timeDay[data[2]] == this.data.day) {
// // 修改月
// console.log('月')
// let changeMonthDate = new Date(this.data.timeYear[data[0]],this.data.timeMonth[data[1]]-1,1);
// let getMonthNum = this.getMonthLength(this.data.year,this.data.timeMonth[data[1]] - 1,1);
// let changeMonthTimeDay = [];
// if (this.data.timeYear[data[0]] == new Date().getFullYear()) {
// for (let i = this.data.timeMonth[data[1]] == new Date().getMonth() + 1 ? new Date().getDate() : 1 ;i < getMonthNum;i++){
// changeMonthTimeDay.push(i)
// }
// console.log(changeMonthTimeDay)
// } else {
// for (let i = 1;i<getMonthNum;i++){
// changeMonthTimeDay.push(i)
// }
// console.log(changeMonthTimeDay)
// }
// let weekMonthDate = new Date(this.data.timeYear[data[0]],this.data.timeMonth[data[1]],changeMonthTimeDay[data[2] > changeMonthTimeDay.length ? changeMonthTimeDay.length : data[2]])
// let week = weekList[weekMonthDate.getDay()];
// this.setData({
// month: this.data.timeMonth[data[1]],
// timeDay: changeMonthTimeDay,
// day: data[2] > changeMonthTimeDay.length ? changeMonthTimeDay[changeMonthTimeDay.length] : changeMonthTimeDay[data[2]],
// // pickerValue: [date[0], data[1],data[2] > timeDay.length ? timeDay.length : data[2]],
// week: week
// })
// }
}
});
......@@ -13,8 +13,10 @@ class Store {
editList: [{ icon: 'icondingwei', text: '地点' }, { icon: 'iconhuiqiantixing', text: '提醒' }, { icon: 'iconchongfu', text: '重复' }, { icon: 'icondidianmiaoshu', text: '描述' }, { icon: 'iconshanchu', text: '删除' }],
remark: '', // 会议描述
aheadTimes: [],
requireUserList: []
requireUserList: [],
startTime: '',
endTime: '',
roomId: ''
}
}
export default new Store()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment