Commit b007dc77 by fengzhaoyu

11

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