Commit b007dc77 by fengzhaoyu

11

parents 21f7e539 0d7e05bb
{
"pages": [
"pages/index/index",
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/meetingRoomList/meetingRoomList",
"pages/place/place",
"pages/uploadFile/uploadFile",
"pages/addRemark/addRemark",
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/meetingRoomList/meetingRoomList",
"pages/uploadFile/uploadFile",
"pages/repetitionTime/repetitionTime",
"pages/repeatMechanism/repeatMechanism",
......
......@@ -53,14 +53,14 @@
}
.treeLi {
display: block;
height: 62rpx;
height: 70rpx;
font-size: 28rpx;
line-height: 62rpx;
line-height: 70rpx;
}
.treeName {
height: 60rpx;
height: 70rpx;
font-size: 28rpx;
line-height: 60rpx;
line-height: 70rpx;
width: 100%;
display: flex;
}
......@@ -83,11 +83,11 @@
}
/* icon */
.labelIsShow .iconsanjiao{
font-size: 28rpx;
font-size: 20rpx;
color: #D8D8D8;
}
.labelIsShow .iconsanjiao1{
font-size: 28rpx;
font-size: 20rpx;
color: #D8D8D8;
}
.labelIsShow .iconxuanzhong1{
......@@ -108,6 +108,7 @@
font-size: 24rpx;
margin-right: 16rpx;
color: #191F25;
margin-left: 8rpx;
}
.treeLabel .iconjianzhu1 {
font-size: 24rpx;
......@@ -116,4 +117,10 @@
}
.labelIsShow{
padding-left: 4rpx;
}
.cancelSelectAre{
font-size: 32rpx;
}
.sureSelectAre{
font-size: 32rpx;
}
\ No newline at end of file
<view class="lableTreeBox">
<view class="lableTreeContent">
<view class="lableTreeHeader">
<view catchTap="cancelSelectAre">
<view class="cancelSelectAre" catchTap="cancelSelectAre">
取消
</view>
<view catchTap="sureSelectAre">
<view class="sureSelectAre" catchTap="sureSelectAre">
确定
</view>
</view>
<view class="lableTreeModal">
<scroll-view scroll-y="{{true}}" style="height: 422rpx;">
<scroll-view scroll-y="{{true}}" style="height: 422rpx;padding-top: 8rpx">
<view class="treeUl">
<block a:for="{{lableTree}}">
<view data-selectid="{{item.id}}" class="treeLi">
......@@ -20,7 +20,7 @@
</view>
<view class="treeLabel" data-id="{{item.id}}" data-name="{{item.name}}" data-cycle="1" catchTap="onChangeAreId">
<view>
<text class="iconfont iconchengshi-"></text>{{item.name}}
<text class="iconfont iconchengshi-"></text><text style="font-size:28rpx">{{item.name}}</text>
</view>
<view a:if="{{item.id===locationId}}" style="color: #1890FF;">
<text class="iconfont iconxuanzhong1"></text>
......@@ -37,7 +37,7 @@
</view>
<view class="treeLabel" data-id="{{item2.id}}" data-name="{{item2.name}}" catchTap="onChangeAreId">
<view>
<text class="iconfont iconjianzhu1"></text>{{item2.name}}
<text class="iconfont iconjianzhu1"></text><text style="font-size:28rpx">{{item2.name}}</text>
</view>
<view a:if="{{item2.id===locationId}}" style="color: #1890FF;">
<text class="iconfont iconxuanzhong1"></text>
......@@ -45,13 +45,13 @@
</view>
</view>
</view>
<view a:if="{{item2.children.length > 0 && item2.status}}" class="treeUl">
<view a:if="{{item2.children.length > 0 && item2.status}}" class="treeUl" style="margin-left: 50rpx">
<block a:for="{{item2.children}}" a:for-index="index3" a:for-item="item3">
<view data-selectid="{{item3.id}}" class="treeLi">
<view class="treeName {{ item3.id===locationId ? 'lableTreeChecked' : '' }}">
<view class="treeLabel" data-id="{{item3.id}}" data-name="{{item3.name}}" catchTap="onChangeAreId">
<view>
<text class="iconfont iconlouceng-"></text>{{item3.name}}
<text class="iconfont iconlouceng-"></text><text style="font-size:28rpx">{{item3.name}}</text>
</view>
<view a:if="{{item3.id===locationId}}" style="color: #1890FF;">
<text class="iconfont iconxuanzhong1"></text>
......
.beOverdue{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: rgba(25,31,37,0.12);
/* border-radius: 50%; */
/* background: rgba(25,31,37,0.12); */
box-sizing: border-box;
}
.Unchecked{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
/* border-radius: 50%; */
box-sizing: border-box;
border: 3px solid #979797;
/* border: 3px solid #979797; */
}
.checked{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: #3296FA;
/* border-radius: 50%; */
/* background: #3296FA; */
box-sizing: border-box;
}
\ No newline at end of file
......@@ -63,9 +63,13 @@ create.Page({
var w = weekList[date.getDay()];
var h = date.getHours()
var min = date.getMinutes();
let DateTimeStr = `${y}/${m}/${d} ${min < 30 ? h < 10 ? '0' + h : h : (h + 1) < 10 ? '0' + (h + 1) : h + 1}:${min < 30 ? '30' : '00'}:00`
let date1 = new Date(DateTimeStr)
let date2 = new Date(DateTimeStr);
date2.setMinutes(date2.getMinutes() + 30)
this.setData({
time1: `${y}/${m}/${d} ${min < 30 ? h < 10 ? '0' + h : h : (h + 1) < 10 ? '0' + (h + 1) : h + 1}:${min < 30 ? '30' : '00'}:00`,
time2: `${y}/${m}/${d} ${(h + 1) < 10 ? '0' + (h + 1) : h + 1}:${min < 30 ? '00' : '30'}:00`,
time1: `${date1.getFullYear()}/${date1.getMonth() < 9 ? '0'+(date1.getMonth()+1):date1.getMonth()+1}/${date1.getDate() < 10 ? "0" + date1.getDate() : date1.getDate()} ${date1.getHours() < 10 ? '0' + date1.getHours() : date1.getHours()}:${date1.getMinutes()<10? '0'+date1.getMinutes():date1.getMinutes()}`,
time2: `${date2.getFullYear()}/${date2.getMonth() < 9 ? '0'+(date2.getMonth()+1):date2.getMonth()+1}/${date2.getDate() < 10 ? "0" + date2.getDate() : date2.getDate()} ${date2.getHours() < 10 ? '0' + date2.getHours() : date2.getHours()}:${date2.getMinutes()<10? '0'+date2.getMinutes():date2.getMinutes()}`,
week1: w,
week2: w,
type: event.type,
......@@ -128,9 +132,8 @@ create.Page({
},
// 选择时间组件回调
changeSelectTime(e) {
console.log(e.time.substr(0, 16))
let that = this
let timeStr = e.time.substr(0, 16)
let timeStr = e.status === 1 ? e.time.substr(0, 16) : ''
if (e.status === 1) {
var date1 = new Date(timeStr.substr(0, 16));
var weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
......
......@@ -11,11 +11,11 @@ page {
}
.month {
font-family: PingFangSC-Medium;
padding: 0 32rpx;
height: 48rpx;
line-height: 48rpx;
margin-bottom: 50rpx;
font-weight: bold;
}
.manyWeeks {
......@@ -115,8 +115,8 @@ page {
.thisDayLine::after {
content: '';
position: absolute;
left: -2rpx;
bottom: -2rpx;
left: 0;
bottom: -3rpx;
width: 8rpx;
height: 8rpx;
border-radius: 50%;
......
......@@ -217,6 +217,7 @@
display: flex;
align-items: flex-end;
background: rgba(0, 0, 0, .15);
z-index: 999;
}
.modalContent {
......@@ -282,6 +283,8 @@
padding-left: 32rpx;
display: flex;
align-items: center;
font-size: 24rpx;
color: rgba(25,31,37,0.56);
}
.OccupyTimeList>view:nth-of-type(1) {
......@@ -318,24 +321,20 @@
.beOverdue {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
background: rgba(25, 31, 37, 0.12);
box-sizing: border-box;
/* background: rgba(25, 31, 37, 0.12); */
}
.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;
/* background: #3296FA; */
box-sizing: border-box;
}
......@@ -429,4 +428,31 @@
margin-top: 32rpx;
font-size: 30rpx;
color: rgba(25,31,37,0.56);
}
.modalFooter{
height: 120rpx;
line-height: 120rpx;
font-size: 26rpx;
color: #3296FA;
letter-spacing: -0.63px;
padding-left: 32rpx;
width: 100%;
box-sizing: border-box;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.beOverdue .iconxuanzhong2{
color: rgba(25,31,37,0.12);
font-size: 40rpx;
}
.checked .iconxuanzhong2{
color: #3296FA;
font-size: 40rpx;
}
.Unchecked .iconweigouxuan{
color: rgba(25,31,37,0.12);
font-size: 40rpx;
}
\ No newline at end of file
......@@ -111,13 +111,13 @@
</view> -->
<view>
<view a:if="{{item.status==='BeOverdue'}}" class="beOverdue">
<text class="iconfont iconxuanzhong2"></text>
</view>
<view a:elif="{{item.status==='Uncheck'}}" class="Unchecked">
<text class="iconfont iconweigouxuan"></text>
</view>
<view a:elif="{{item.status==='checked'}}" class="checked">
<text class="iconfont iconxuanzhong2"></text>
</view>
</view>
<view>
......@@ -131,6 +131,10 @@
</view>
</view>
</scroll-view>
<view class="modalFooter">
<text a:if="{{!modalFooter.startTime || !modalFooter.endTime}}">会议时间:请选择会议时间</text>
<text a:if="{{modalFooter.startTime && modalFooter.endTime}}">会议时间:{{modalFooter.startTime}}至{{modalFooter.isOneDay ? modalFooter.endTime.substr(11,16):modalFooter.endTime}} 共{{modalFooter.allMinutes}}分钟</text>
</view>
</view>
</view>
<lable-tree
......
......@@ -18,6 +18,12 @@ create.Page({
equipFacilityIds: [],
time: ''
},
modalFooter: {
startTime: '',
endTime: '',
allMinutes: '',
isOneDay: true
},
dataNum: '0',
noRoom: false,
location:{
......@@ -38,8 +44,8 @@ create.Page({
toThisTime: '123'
},
onLoad(query) {
let date = new Date(this.store.data.startTime.replace(/-/g, "/"))
// let date = new Date()
// let date = new Date(this.store.data.startTime.replace(/-/g, "/"))
let date = new Date()
let year = date.getFullYear()
let month = `${date.getMonth() + 1}`
let day = `${date.getDate()}`
......@@ -184,9 +190,15 @@ create.Page({
// 判断是否有开始时间
console.log('判断是否有开始时间')
let listStr = `modalList[${index}].status`
let modalFooterTime = new Date(data.reserveStartTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
this.setData({
'meetingTime.startTime': data.reserveStartTime,
[listStr]: 'checked'
[listStr]: 'checked',
'modalFooter.startTime': data.reserveStartTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': 30,
'modalFooter.isOneDay': true,
})
} else if (this.data.meetingTime.startTime && !this.data.meetingTime.endTime) {
// 判断有开时间,没有结束时间
......@@ -195,7 +207,11 @@ create.Page({
let listStr = `modalList[${index}].status`
this.setData({
'meetingTime.startTime': '',
[listStr]: 'Uncheck'
[listStr]: 'Uncheck',
'modalFooter.startTime': data.reserveStartTime,
'modalFooter.endTime': '',
'modalFooter.allMinutes': '',
'modalFooter.isOneDay': true,
})
console.log('2.1')
} else if (new Date(this.data.meetingTime.startTime.replace(/-/g, '/')).getTime() > new Date(data.reserveStartTime.replace(/-/g, '/')).getTime()){
......@@ -204,9 +220,16 @@ create.Page({
if (this.isDaySpan(this.data.meetingTime.startTime.replace(/-/g, '/'),data.reserveStartTime.replace(/-/g, '/'))) {
//非跨天
if (this.isOptional(data.reserveStartTime, this.data.meetingTime.startTime)) {
let modalFooterTime = new Date(that.data.meetingTime.startTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(data.reserveStartTime.replace(/-/g, '/')).getTime())/60000
this.setData({
'meetingTime.startTime': data.reserveStartTime,
'meetingTime.endTime': this.data.meetingTime.startTime,
'meetingTime.endTime': that.data.meetingTime.startTime,
'modalFooter.startTime': data.reserveStartTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
'modalFooter.isOneDay': true,
}, () => {
that.refreshModalList()
})
......@@ -217,9 +240,16 @@ create.Page({
//跨天
this.getAllScheduleWithMeetingRoomByTime(data.reserveStartTime, this.data.meetingTime.startTime).then(res => {
if (res) {
let modalFooterTime = new Date(that.data.meetingTime.startTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(data.reserveStartTime.replace(/-/g, '/')).getTime())/60000
that.setData({
'meetingTime.startTime': data.reserveStartTime,
'meetingTime.endTime': this.data.meetingTime.startTime,
'meetingTime.endTime': that.data.meetingTime.startTime,
'modalFooter.startTime': data.reserveStartTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
'modalFooter.isOneDay': false,
}, () => {
that.refreshModalList()
})
......@@ -236,8 +266,15 @@ create.Page({
if (this.isDaySpan(this.data.meetingTime.startTime.replace(/-/g, '/'),data.reserveStartTime.replace(/-/g, '/'))) {
// 非跨天
if (this.isOptional(this.data.meetingTime.startTime, data.reserveStartTime)) {
let modalFooterTime = new Date(data.reserveStartTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(that.data.meetingTime.startTime.replace(/-/g, '/')).getTime())/60000
this.setData({
'meetingTime.endTime': data.reserveStartTime,
'modalFooter.startTime': that.data.meetingTime.startTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
'modalFooter.isOneDay': true,
}, () => {
that.refreshModalList()
})
......@@ -248,8 +285,15 @@ create.Page({
// 跨天
this.getAllScheduleWithMeetingRoomByTime(data.reserveStartTime, this.data.meetingTime.startTime).then(res => {
if (res) {
that.setData({
let modalFooterTime = new Date(data.reserveStartTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(that.data.meetingTime.startTime.replace(/-/g, '/')).getTime())/60000
this.setData({
'meetingTime.endTime': data.reserveStartTime,
'modalFooter.startTime': that.data.meetingTime.startTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
'modalFooter.isOneDay': false,
}, () => {
that.refreshModalList()
})
......@@ -270,15 +314,27 @@ create.Page({
startTimeDate.setMinutes(startTimeDate.getMinutes() + 30)
let meetingStartTime = `${startTimeDate.getFullYear()}-${startTimeDate.getMonth()+1<10 ? '0' + (startTimeDate.getMonth()+1) : startTimeDate.getMonth()+1}-${startTimeDate.getDate()<10? '0' + startTimeDate.getDate(): startTimeDate.getDate()} ${startTimeDate.getHours()<10?'0'+startTimeDate.getHours():startTimeDate.getHours()}:${startTimeDate.getMinutes()<10?'0'+startTimeDate.getMinutes():startTimeDate.getMinutes()}`
if (meetingStartTime === this.data.meetingTime.endTime) {
let modalFooterTime = new Date(that.data.meetingTime.endTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
this.setData({
'meetingTime.startTime': meetingStartTime,
'meetingTime.endTime': ''
'meetingTime.endTime': '',
'modalFooter.startTime': meetingStartTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': 30,
'modalFooter.isOneDay': true,
},() => {
that.refreshModalList()
})
} else {
let modalFooterTime = new Date(that.data.meetingTime.endTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(meetingStartTime.replace(/-/g, '/')).getTime())/60000
this.setData({
'meetingTime.startTime': meetingStartTime
'meetingTime.startTime': meetingStartTime,
'modalFooter.startTime': meetingStartTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
},() => {
that.refreshModalList()
})
......@@ -290,14 +346,25 @@ create.Page({
endTimeDate.setMinutes(endTimeDate.getMinutes() - 30)
let meetingEndTime = `${endTimeDate.getFullYear()}-${endTimeDate.getMonth()+1<10 ? '0' + (endTimeDate.getMonth()+1) : endTimeDate.getMonth()+1}-${endTimeDate.getDate()<10?'0'+endTimeDate.getDate():endTimeDate.getDate()} ${endTimeDate.getHours()<10?'0'+endTimeDate.getHours():endTimeDate.getHours()}:${endTimeDate.getMinutes()<10?'0'+endTimeDate.getMinutes():endTimeDate.getMinutes()}`
if (meetingEndTime === this.data.meetingTime.startTime) {
let modalFooterTime = new Date(this.data.meetingTime.startTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
this.setData({
'meetingTime.endTime': ''
'meetingTime.endTime': '',
'modalFooter.startTime': that.data.meetingTime.startTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': 30,
},() => {
that.refreshModalList()
})
} else {
let modalFooterTime = new Date(meetingEndTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(that.data.meetingTime.startTime.replace(/-/g, '/')).getTime())/60000
this.setData({
'meetingTime.endTime': meetingEndTime
'meetingTime.endTime': meetingEndTime,
'modalFooter.startTime': that.data.meetingTime.startTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
},() => {
that.refreshModalList()
})
......@@ -309,8 +376,15 @@ create.Page({
if (this.isDaySpan(this.data.meetingTime.startTime.replace(/-/g, '/'),data.reserveStartTime.replace(/-/g, '/'))) {
// 非跨天
if (data.reserveStartTime, this.data.meetingTime.startTime) {
let modalFooterTime = new Date(that.data.meetingTime.endTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(data.reserveStartTime.replace(/-/g, '/')).getTime())/60000
this.setData({
'meetingTime.startTime': data.reserveStartTime,
'modalFooter.startTime': data.reserveStartTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
'modalFooter.isOneDay': true,
},() => {
that.refreshModalList()
})
......@@ -319,8 +393,15 @@ create.Page({
// 跨天
this.getAllScheduleWithMeetingRoomByTime(data.reserveStartTime, this.data.meetingTime.startTime).then(res => {
if (res) {
that.setData({
let modalFooterTime = new Date(that.data.meetingTime.endTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(data.reserveStartTime.replace(/-/g, '/')).getTime())/60000
this.setData({
'meetingTime.startTime': data.reserveStartTime,
'modalFooter.startTime': data.reserveStartTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
'modalFooter.isOneDay': false,
},() => {
that.refreshModalList()
})
......@@ -338,8 +419,16 @@ create.Page({
// 非跨天
if (this.isOptional(this.data.meetingTime.startTime, data.reserveStartTime)) {
//是否可选中
let modalFooterTime2 = new Date(data.reserveStartTime.replace(/-/g, '/'))
modalFooterTime2.setMinutes(modalFooterTime2.getMinutes() + 30)
let allMinutes = (modalFooterTime2 - new Date(that.data.meetingTime.startTime.replace(/-/g, '/')).getTime())/60000
console.log('3.4.1',allMinutes)
this.setData({
'meetingTime.endTime': data.reserveStartTime,
'modalFooter.startTime': that.data.meetingTime.startTime,
'modalFooter.endTime': `${modalFooterTime2.getFullYear()}-${modalFooterTime2.getMonth()<9 ? '0'+(modalFooterTime2.getMonth()+1):modalFooterTime2.getMonth()+1}-${modalFooterTime2.getDate()<10? '0'+modalFooterTime2.getDate(): modalFooterTime2.getDate()} ${modalFooterTime2.getHours()<10? '0'+modalFooterTime2.getHours(): modalFooterTime2.getHours()}:${modalFooterTime2.getMinutes()<10? '0'+modalFooterTime2.getMinutes(): modalFooterTime2.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
'modalFooter.isOneDay': true,
},() => {
that.refreshModalList()
})
......@@ -348,8 +437,15 @@ create.Page({
// 跨天
this.getAllScheduleWithMeetingRoomByTime(data.reserveStartTime, this.data.meetingTime.startTime).then(res => {
if (res) {
that.setData({
'meetingTime.endTime': data.reserveStartTime,
let modalFooterTime = new Date(data.reserveStartTime.replace(/-/g, '/'))
modalFooterTime.setMinutes(modalFooterTime.getMinutes() + 30)
let allMinutes = (modalFooterTime - new Date(that.data.meetingTime.startTime.replace(/-/g, '/')).getTime())/60000
this.setData({
'meetingTime.endTime': data.reserveStartTime,
'modalFooter.startTime': that.data.meetingTime.startTime,
'modalFooter.endTime': `${modalFooterTime.getFullYear()}-${modalFooterTime.getMonth()<9 ? '0'+(modalFooterTime.getMonth()+1):modalFooterTime.getMonth()+1}-${modalFooterTime.getDate()<10? '0'+modalFooterTime.getDate(): modalFooterTime.getDate()} ${modalFooterTime.getHours()<10? '0'+modalFooterTime.getHours(): modalFooterTime.getHours()}:${modalFooterTime.getMinutes()<10? '0'+modalFooterTime.getMinutes(): modalFooterTime.getMinutes()}`,
'modalFooter.allMinutes': allMinutes,
'modalFooter.isOneDay': false,
},() => {
that.refreshModalList()
})
......
......@@ -52,7 +52,9 @@
}
.timeView>view:nth-of-type(1) {
text-align: right;
margin-right: 32rpx;
padding-right: 32rpx;
box-sizing: border-box;
width: 100%;
}
.timeView picker-view{
width: 100%;
......@@ -73,6 +75,7 @@
display: flex;
align-items: center;
justify-content: flex-end;
border-bottom: 1px solid rgba(25,31,37,0.12);
/* font-weight: bold; */
}
.timeViewSwich switch{
......
......@@ -14,7 +14,7 @@
<view>
永不截止
</view>
<switch checked="{{recurrenceModel.forever == '1'}}" onChange="switchChange"/>
<switch checked="{{forever == '1'}}" onChange="switchChange"/>
</view>
<view>
<picker-view value="{{pickerValue}}" class="parent" onChange="onChange">
......
......@@ -13,6 +13,7 @@ create.Page({
day: '',
week: '',
isBeOverdue: false,
forever: '1'
},
onLoad() {
if (!this.store.data.recurrenceModel.terminateTime || this.store.data.recurrenceModel.forever == '1') {
......@@ -69,6 +70,9 @@ create.Page({
pickerValue: [timeYear.indexOf(`${date2.getFullYear()}年`),timeMonth.indexOf(`${date2.getMonth()+1}月`),timeDay.indexOf(`${date2.getDate()}${weekList[date2.getDay()]}`)]
})
}
this.setData({
forever: this.store.data.recurrenceModel.forever
})
},
getMonthLength(year, month ,day) {
let d = new Date(year, month ,day)
......@@ -80,8 +84,9 @@ create.Page({
return d.getDate()
},
switchChange(e) {
this.store.data.recurrenceModel.forever = e.detail.value ? '1' : '0'
this.update()
this.setData({
forever: e.detail.value ? '1' : '0'
})
},
save(){
if(this.data.isBeOverdue) {
......@@ -89,10 +94,11 @@ create.Page({
} else {
if (this.store.data.recurrenceModel.forever == '1') {
let data = this.getTwoYearToday();
this.store.data.recurrenceModel.terminateTime = data
this.store.data.recurrenceModel.terminateTime = data;
} else {
this.store.data.recurrenceModel.terminateTime = `${this.data.year}-${this.data.month<10 ? '0' + this.data.month: this.data.month}-${this.data.day<10 ? '0'+ this.data.day : this.data.day}`
}
this.store.data.recurrenceModel.forever = this.data.forever
this.update();
dd.navigateBack({
delta: 1
......@@ -135,7 +141,8 @@ create.Page({
isBeOverdue: isBeOverdue,
pickerValue: [data[0],data[1],data[2]]
})
this.store.data.recurrenceModel.forever = '0'
this.update()
this.setData({
forever: '0'
})
}
});
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