Commit 7e71e24f by xiexiaoqin
parents 20dbd095 9a117d37
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"pages": [ "pages": [
"pages/meetingDetail/meetingDetail", "pages/meetingDetail/meetingDetail",
"pages/index/index", "pages/index/index",
"pages/editMeeting/editMeeting",
"pages/createMeeting/createMeeting", "pages/createMeeting/createMeeting",
"pages/outLookContact/outLookContact", "pages/outLookContact/outLookContact",
"pages/uploadFile/uploadFile", "pages/uploadFile/uploadFile",
......
...@@ -7,11 +7,16 @@ Component({ ...@@ -7,11 +7,16 @@ Component({
iconType: 'icon' iconType: 'icon'
}, },
didMount() { didMount() {
console.log(this.props.comSelectListId)
this.setData({
comSelectListId: this.props.comSelectListId || 0
})
},
didUpdate() {
this.setData({ this.setData({
comSelectListId: this.props.comSelectListId || 0 comSelectListId: this.props.comSelectListId || 0
}) })
}, },
didUpdate() { },
didUnmount() { }, didUnmount() { },
methods: { methods: {
comSelectList(event) { comSelectList(event) {
......
...@@ -91,8 +91,8 @@ input { ...@@ -91,8 +91,8 @@ input {
justify-content: space-between; justify-content: space-between;
} }
.meetingWay .close, .place .close,.participator .iconicon_open { .meetingWay .close, .place .close, .participator .iconicon_open {
color:#9599A2; color: #9599A2;
} }
.repeatModal { .repeatModal {
...@@ -106,12 +106,10 @@ input { ...@@ -106,12 +106,10 @@ input {
color: #3070F2 color: #3070F2
} }
.conflict { .conflictStatus {
color: #FF943E; color: #FF943E;
font-size: 28rpx; font-size: 24rpx;
margin-left: 24rpx; margin-left: 24rpx;
transform: scale(0.9);
transform-origin: left center;
} }
.participatorList { .participatorList {
...@@ -160,13 +158,29 @@ input { ...@@ -160,13 +158,29 @@ input {
color: white; color: white;
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
overflow: hidden; position: relative;
}
.conflict {
line-height: 13px;
vertical-align: top;
width: 13px;
height: 13px;
position: absolute;
background: #fff;
bottom: 0rpx;
color: #FF943E;
font-size: 12px;
right: -3rpx;
border-radius: 50%;
text-align: center;
} }
.headUrl>image { .headUrl>image {
vertical-align: top; vertical-align: top;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%;
} }
.name { .name {
......
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
<!-- title remark 标题 描述 --> <!-- title remark 标题 描述 -->
<view class="createTitle"> <view class="createTitle">
<view class="title"> <view class="title">
<input placeholder-class="placeholder" placeholder="冯召玉创建的会议" class="text" focus="{{true}}" onInput="onInput" data-type="title"/> <input placeholder-class="placeholder" placeholder="请输入主题" class="text" focus="{{true}}" onInput="onInput"
data-type="title" value="{{title}}" />
<view class="icon iconfont iconicon_description" onTap="addRemark"> <view class="icon iconfont iconicon_description" onTap="addRemark">
</view> </view>
</view> </view>
<view class="remark" a:if="{{isShowRemark}}"> <view class="remark" a:if="{{isShowRemark}}">
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark"/> <input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput"
data-type="remark" />
</view> </view>
</view> </view>
<!-- roomId locationName 地点 --> <!-- roomId locationName 地点 -->
...@@ -23,7 +25,8 @@ ...@@ -23,7 +25,8 @@
<view class="hasplace" onTap="nextPage" data-nextPage="location" a:else> <view class="hasplace" onTap="nextPage" data-nextPage="location" a:else>
{{locationName}} {{locationName}}
</view> </view>
<view class=" icon iconfont iconicon_close close" a:if="{{!!locationName}}" data-close="location" catchTap="close"> <view class=" icon iconfont iconicon_close close" a:if="{{!!locationName}}" data-close="location"
catchTap="close">
</view> </view>
</view> </view>
</view> </view>
...@@ -33,14 +36,23 @@ ...@@ -33,14 +36,23 @@
</view> </view>
<view class="timeContaint"> <view class="timeContaint">
<view> <view>
<view class="timeText" onTap="showPopup" data-type="time"> <view class="timeText" catchTap="showPopup" data-type='time'>
3月1日 周日 14:00-16:00 <text a:if="{{isAcrossDay}}">
</view> {{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${startTime.substring(11, 16)}`}}
<view class="repeatModal" a:if="{{comListData.comSelectListId !== 0}}" catchTap="showPopup" data-type='repeat'> - {{`${endTime.substring(5, 7)}月${endTime.substring(8, 10)}日 ${endTime.substring(11, 16)}`}}
</text>
<text a:else>
{{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${week} ${startTime.substring(11, 16)}- ${endTime.substring(11, 16)}`}}
</text>
<!-- 3月1日 周日 14:00-16:00 -->
</view>
<view class="repeatModal" a:if="{{comListData.comSelectListId !== 0}}" catchTap="showPopup"
data-type='repeat'>
{{comListData.repeatList[comListData.comSelectListId].text}}重复 {{comListData.repeatList[comListData.comSelectListId].text}}重复
</view> </view>
</view> </view>
<view class="icon iconfont iconicon_cycle " catchTap="showPopup" data-type='repeat' a:if="{{comListData.comSelectListId == 0}}"> <view class="icon iconfont iconicon_cycle " catchTap="showPopup" data-type='repeat'
a:if="{{comListData.comSelectListId == 0}}">
</view> </view>
</view> </view>
</view> </view>
...@@ -49,7 +61,8 @@ ...@@ -49,7 +61,8 @@
<view class="iconicon_attender1 iconfont icon"> <view class="iconicon_attender1 iconfont icon">
</view> </view>
<view class="participatorContaint"> <view class="participatorContaint">
<view class="participatorText" a:if="{{participatorList.length < 2}}" catchTap="showPopup" data-type='participator'> <view class="participatorText" a:if="{{participatorList.length < 2}}" catchTap="showPopup"
data-type='participator'>
添加参会人 添加参会人
</view> </view>
<view class="participatorList" a:else> <view class="participatorList" a:else>
...@@ -58,25 +71,26 @@ ...@@ -58,25 +71,26 @@
<view> <view>
{{participatorList.length}}位参会人 {{participatorList.length}}位参会人
</view> </view>
<view class="conflict"> <view class="conflictStatus">
3人会议安排冲突 3人会议安排冲突
</view> </view>
</view> </view>
<view class="iconicon_open iconfont icon" style=" vertical-align: middle"> <view class="iconicon_open iconfont icon" style=" vertical-align: middle"></view>
</view>
</view> </view>
<view class="participatorListBottom"> <view class="participatorListBottom">
<view class="people" a:for="{{participatorList.length > 10 ? [...participatorList].splice(0, 11) : participatorList}}"> <view class="people"
a:for="{{participatorList.length > 10 ? [...participatorList].splice(0, 11) : participatorList}}">
<view class="headUrl"> <view class="headUrl">
<image a:if="{{item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}"/ > <image a:if="{{item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}" />
<text a:else>{{item.platform==="outlook" ? item.username.substring(0, 2) : item.username.substring(item.username.length-2, item.username.length)}}</text> <text
a:else>{{item.platform==="outlook" ? item.username.substring(0, 2) : item.username.substring(item.username.length-2, item.username.length)}}
</text>
<view class="conflict iconicon_conflict iconfont">
</view> </view>
<view class="name">
{{item.name}}
</view> </view>
<view class="name">{{item.name}}</view>
</view> </view>
<view class="addPeople" catchTap="showPopup" data-type='participator'> <view class="addPeople" catchTap="showPopup" data-type='participator'></view>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -86,27 +100,33 @@ ...@@ -86,27 +100,33 @@
<view class="iconicon_meet1 iconfont icon"> <view class="iconicon_meet1 iconfont icon">
</view> </view>
<view class="meetingWayContent"> <view class="meetingWayContent">
<view class="noWay" a:if="{{comListData.meetingWayModelId == null}}" catchTap="showPopup" data-type='meetingWayModel'> <view class="noWay" a:if="{{comListData.meetingWayModelId == null}}" catchTap="showPopup"
data-type='meetingWayModel'>
会议方式 会议方式
</view> </view>
<view class="hasWay" a:else catchTap="showPopup" data-type='meetingWayModel' > <view class="hasWay" a:else catchTap="showPopup" data-type='meetingWayModel'>
{{comListData.meetingWayList[comListData.meetingWayModelId].text}} {{comListData.meetingWayList[comListData.meetingWayModelId].text}}
</view> </view>
<view class=" icon iconfont iconicon_close close" a:if="{{comListData.meetingWayModelId !== null}}" data-close="meetingWayModel" catchTap="close"> <view class=" icon iconfont iconicon_close close" a:if="{{comListData.meetingWayModelId !== null}}"
data-close="meetingWayModel" catchTap="close">
</view> </view>
</view> </view>
</view> </view>
<!-- 保存 --> <!-- 保存 -->
<view class="save"> <view class="save" onTap="addSchedule">
<view class="button"> <view class="button">
立即创建 立即创建
</view> </view>
</view> </view>
<popup title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup"> <popup title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup">
<meeting-time-picker a:if="{{'time' === comType}}" onClose="closePop" onComplete="Complete" visibleItemCount="3"></meeting-time-picker> <meeting-time-picker a:if="{{'time' === comType}}" onComplete="onComplete"></meeting-time-picker>
<hlist a:if="{{'participator' === comType}}" dataComList="{{comHListData.contactData}}" onSelectComHList="selectComHList"> <hlist a:if="{{'participator' === comType}}" dataComList="{{comHListData.contactData}}"
</hlist> onSelectComHList="selectComHList"></hlist>
<list a:if="{{comType=='repeat'}}" dataComList="{{comType=='repeat' ? comListData.repeatList : comListData.meetingWayList}}" onComSelectList="selectComList" comSelectListId="{{comListType=='repeat' ? comListData.comSelectListId : comListData.meetingWayModelId}}" iconType="{{comListData.iconType}}"> <list a:if="{{comType=='repeat' || comType=='meetingWayModel'}}"
dataComList="{{comType=='repeat' ? comListData.repeatList : comListData.meetingWayList}}"
onComSelectList="selectComList"
comSelectListId="{{comType=='repeat' ? comListData.comSelectListId : comListData.meetingWayModelId}}"
iconType="{{comListData.iconType}}">
</list> </list>
</popup> </popup>
</view> </view>
\ No newline at end of file \ No newline at end of file
import { getHomeUserSchedule } from '../../api/request.js' import { addSchedule } from '../../api/request.js'
import { throttle } from './../../utils/utils.js' import { throttle } from './../../utils/utils.js'
import create from 'dd-store' import create from 'dd-store'
import exampleStore from '/stores/exampleStore' import exampleStore from '/stores/exampleStore'
...@@ -10,16 +10,15 @@ create.Page({ ...@@ -10,16 +10,15 @@ create.Page({
comListData: { comListData: {
repeatList: [ repeatList: [
{ id: 0, text: '不重复', icon: 'iconicon_cycle', repeatable: 0, recurrenceModel: { model: 'no_repeat' } }, { id: 0, text: '不重复', icon: 'iconicon_cycle', repeatable: 0, recurrenceModel: { model: 'no_repeat' } },
{ id: 1, text: '每天', icon: '', repeatable: 1, recurrenceModel: { model: 'daily', interval: 1, initialTime: null, terminateTime: null, weekDayList: null } }, { id: 1, text: '每天', icon: '', repeatable: 1, recurrenceModel: { model: 'daily', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: null } },
{ id: 2, text: '每周', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: null, terminateTime: null, weekDayList: null } }, { id: 2, text: '每周', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: ['MO'] } },
{ id: 3, text: '每周的工作日', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: null, terminateTime: null, weekDayList: ['MO', 'TU', 'WE', 'TH', 'FR', 'SA'] } }, { id: 3, text: '每周的工作日', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: ['MO', 'TU', 'WE', 'TH', 'FR'] } },
{ id: 4, text: '每月', icon: '', repeatable: 1, recurrenceModel: { model: 'absoluteMonthly', interval: 1, initialTime: null, terminateTime: null, weekDayList: null } }, { id: 4, text: '每月', icon: '', repeatable: 1, recurrenceModel: { model: 'absoluteMonthly', daysOfMonth: ['23'], interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: null } }
{ id: 5, text: '每年', icon: '', repeatable: 1, recurrenceModel: { model: 'absoluteYearly', interval: 1, initialTime: null, terminateTime: null, weekDayList: null } }
], ],
meetingWayList: [ meetingWayList: [
{ id: 0, text: 'Webex meeting', imageUrl: '../../assests/Webex.png' }, { id: 0, text: 'Webex meeting', imageUrl: '../../assests/Webex.png', meetingWayModel: { model: 'webex' } },
{ id: 1, text: 'Zoom Meeting', imageUrl: '../../assests/Zoom.png' }, { id: 1, text: 'Zoom Meeting', imageUrl: '../../assests/Zoom.png', meetingWayModel: { model: 'zoom' } },
{ id: 2, text: '钉钉', imageUrl: '../../assests/dingding.png' } { id: 2, text: '钉钉', imageUrl: '../../assests/dingding.png', meetingWayModel: { model: 'dingtalk' } }
], ],
comSelectListId: 0, comSelectListId: 0,
meetingWayModelId: null, meetingWayModelId: null,
...@@ -32,18 +31,23 @@ create.Page({ ...@@ -32,18 +31,23 @@ create.Page({
{ id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' } { id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' }
] ]
}, },
show: true, // show: true,
title: '', title: ``,
repeatable: '', repeatable: 0,
recurrenceModel: '', recurrenceModel: { model: 'no_repeat' },
isShowRemark: false, isShowRemark: false,
repeatWeek: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'], repeatWeek: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'],
popupTitle: '会议重复', popupTitle: '会议重复',
popupShow: false, popupShow: false,
comType: '', comType: '',
remark: '', remark: '',
comTimeType: '' comTimeType: '',
meetingWayModel: null,
weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
week: '',
isAcrossDay: false
}, },
showPop() { showPop() {
this.setData({ this.setData({
show: true show: true
...@@ -60,7 +64,10 @@ create.Page({ ...@@ -60,7 +64,10 @@ create.Page({
}, },
onLoad() { onLoad() {
dd.setNavigationBar({ dd.setNavigationBar({
title: '创建会议' title: `创建会议`
})
this.setData({
title: `${getApp().globalData.name}创建的会议`
}) })
this.reset() this.reset()
}, },
...@@ -96,16 +103,19 @@ create.Page({ ...@@ -96,16 +103,19 @@ create.Page({
// 初始化 // 初始化
reset() { reset() {
this.store.data.roomId = '' this.store.data.roomId = ''
this.store.data.participatorList = []
this.store.data.participatorUserId = []
this.store.data.locationName = '' this.store.data.locationName = ''
this.store.data.startTime = this.getTimes()
this.store.data.endTime = this.getTimes(new Date(this.getTimes()).setMinutes(new Date(this.store.data.startTime).getMinutes() + 120))
this.update() this.update()
this.resetRepeatList()
this.acrossDay(this.store.data.startTime, this.store.data.endTime)
}, },
// 跳转下一页 // 跳转下一页
nextPage(event) { nextPage(event) {
switch (event.target.dataset.nextPage) { switch (event.target.dataset.nextPage) {
case 'location': case 'location':
this.store.data.startTime = '2020/03/18 16:00:00'
this.store.data.endTime = '2020/03/18 16:00:00'
this.update()
dd.navigateTo({ url: './../place/place' }) dd.navigateTo({ url: './../place/place' })
break break
} }
...@@ -120,7 +130,8 @@ create.Page({ ...@@ -120,7 +130,8 @@ create.Page({
break break
case 'meetingWayModel': case 'meetingWayModel':
this.setData({ this.setData({
'comListData.meetingWayModelId': null 'comListData.meetingWayModelId': null,
meetingWayModel: null
}) })
} }
}, },
...@@ -130,7 +141,7 @@ create.Page({ ...@@ -130,7 +141,7 @@ create.Page({
popupShow: false popupShow: false
}) })
}, },
// 选择循环机制 选择会议方式 出现popup弹窗 // 选择循环机制 选择会议方式 选择时间 出现popup弹窗
showPopup(event) { showPopup(event) {
let iconType = '' let iconType = ''
switch (event.currentTarget.dataset.type) { switch (event.currentTarget.dataset.type) {
...@@ -143,9 +154,6 @@ create.Page({ ...@@ -143,9 +154,6 @@ create.Page({
case 'participator': case 'participator':
break break
case 'time': case 'time':
// this.setData({
// comTimeType: true
// })
break break
} }
this.setData({ this.setData({
...@@ -154,36 +162,46 @@ create.Page({ ...@@ -154,36 +162,46 @@ create.Page({
'comListData.iconType': iconType 'comListData.iconType': iconType
}) })
}, },
resetRepeatList() {
let index = 0
let repeatList = []
for (let value of this.data.comListData.repeatList) {
if (index) {
value.recurrenceModel.initialTime = this.store.data.startTime.replace(/\//g, "-").substring(0, 10)
value.recurrenceModel.terminateTime = this.getTwoYearToday(this.store.data.startTime)
if (index === 2) {
value.recurrenceModel.weekDayList = [this.data.repeatWeek[new Date().getDay()]]
} else if (index === 4) {
value.recurrenceModel.daysOfMonth = this.store.data.startTime.replace(/\//g, "-").substring(8, 10)
}
}
repeatList.push(value)
index++
}
this.setData({
'comListData.repeatList': repeatList,
week: this.data.weekList[new Date().getDay()]
})
},
// 选择完comList后的回调 // 选择完comList后的回调
selectComList(event) { selectComList(event) {
switch (this.data.comType) { switch (this.data.comType) {
case 'meetingWayModel': case 'meetingWayModel':
this.setData({ this.setData({
'comListData.meetingWayModelId': event.currentTarget.dataset.item.id, 'comListData.meetingWayModelId': event.currentTarget.dataset.item.id,
popupShow: false popupShow: false,
meetingWayModel: this.data.comListData.meetingWayList[event.currentTarget.dataset.item.id].meetingWayModel
}) })
break; break;
case 'repeat': case 'repeat':
let initialTime = '2020/03/18 16:00:00' this.resetRepeatList()
let terminateTime = this.getTwoYearToday(initialTime)
for (let value of this.data.comListData.repeatList) {
if (value.recurrenceModel.model !== 'no_repeat') {
value.recurrenceModel.initialTime = initialTime.replace(/\//g, "-").substring(0, 10)
value.recurrenceModel.terminateTime = terminateTime
}
}
let repeatList = this.data.comListData.repeatList
repeatList[2].recurrenceModel.weekDayList = ['MO']
this.setData({
repeatList: repeatList
}, () => {
this.setData({ this.setData({
popupShow: false, popupShow: false,
'comListData.comSelectListId': event.currentTarget.dataset.item.id, 'comListData.comSelectListId': event.currentTarget.dataset.item.id,
repeatable: event.currentTarget.dataset.item.repeatable, repeatable: event.currentTarget.dataset.item.repeatable,
recurrenceModel: event.currentTarget.dataset.item.recurrenceModel recurrenceModel: event.currentTarget.dataset.item.recurrenceModel
}) })
})
break; break;
} }
}, },
...@@ -268,4 +286,82 @@ create.Page({ ...@@ -268,4 +286,82 @@ create.Page({
} }
return Object.values(containt) return Object.values(containt)
}, },
// 点击完成
onComplete(event) {
this.store.data.startTime = `${event.startTime}:00`
this.store.data.endTime = `${event.endTime}:00`
this.update()
this.acrossDay(this.store.data.startTime, this.store.data.endTime)
this.setData({
popupShow: false
})
},
addSchedule() {
let data = {
title: this.data.title || `${getApp().globalData.name}创建的会议`,
location: {
longitude: '10',
latitude: '10',
locationName: this.store.data.locationName
},
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-"),
meetingRoomId: this.store.data.roomId,
scheduleType: this.store.data.roomId ? 'meeting' : 'common',
participatorList: !!this.store.data.participatorList.length ? this.store.data.participatorList : [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar }],
repeatable: this.data.repeatable,
remark: this.data.remark,
recurrenceModel: this.data.recurrenceModel,
meetingRoomId: this.store.data.roomId,
meetingWayModel: this.data.meetingWayModel
}
addSchedule(data).then(res => {
console.log(res)
if (res.data.code === 0) {
dd.navigateBack({
delta: 1
})
}
})
},
// 获取时间参数
getTimes(time = new Date()) {
let date = new Date(time)
let year = date.getFullYear()
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
let hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
let miunutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return `${year}/${month}/${day} ${hour}:${miunutes}:00`
},
// 是否跨天
acrossDay(time1, time2) {
let isAcrossDay = ''
if (JSON.stringify(this.getTimes(time1).substring(0, 10)) === JSON.stringify(this.getTimes(time2).substring(0, 10))) {
isAcrossDay = false
} else {
isAcrossDay = true
}
this.setData({
isAcrossDay: isAcrossDay
})
},
conflictPeople() {
let userIds = []
for (let value of this.store.data.participatorList) {
userIds.push(value.userId)
}
let data = {
startTime: this.store.data.startTime,
endTime: this.store.data.endTime,
userIds: userIds
}
getUserScheduleInTime(data).then(res => {
})
// for (let value of this.store.data.participatorList) {
// if()
// }
}
}); });
@import "../../assests/font/iconfont.acss";
page {
background: #fff;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #030303;
}
.hideDetail {
padding: 28rpx 32rpx 24rpx;
border-bottom: 1rpx solid rgba(25, 31, 37, 0.12);
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.08);
}
.hideTitle {
font-family: PingFangSC-Medium;
font-size: 40rpx;
line-height: 56rpx;
color: #1B263D;
}
.hideTime {
margin-top: 16rpx;
opacity: 0.72;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #030303;
line-height: 28rpx;
}
.hideIcon {
color: #A7ABB3;
margin-top: 28rpx;
text-align: center;
}
.icon {
vertical-align: middle;
color: #1B263D;
font-size: 34rpx;
}
input {
caret-color: #3070F2;
padding-left: 0;
}
.createTitle {
padding: 14rpx 36rpx 16rpx;
}
.title {
display: flex;
line-height: 1.5;
justify-content: space-between;
text-align: left;
}
.title>input {
padding-left: 0;
font-size: 40rpx;
font-family: PingFangSC-Medium;
width: 100%;
}
.title>.icon {
color: #3070F2;
/* vertical-align: middle; */
line-height: 58rpx;
}
.remark>input {
padding-left: 0;
width: 100%;
opacity: 0.72;
font-size: 14px;
}
.placeholder {
opacity: 0.4;
font-family: PingFangSC-Medium;
font-size: 40rpx;
color: #1B263D;
}
.remark .placeholder {
font-size: 28rpx
}
.place, .time, .participator, .meetingWay {
display: flex;
padding: 0 36rpx;
font-family: PingFangSC-Regular;
color: #191F25;
overflow: hidden;
margin-top: 54rpx;
}
.place>.icon, .time>.icon, .participator>.icon, .meetingWay>.icon {
margin-right: 26rpx;
}
.noPlace, .hasplace, .timeText, .participatorText, .noWay, .hasWay {
height: 38rpx;
font-size: 34rpx;
width: 100%;
line-height: 38rpx;
}
.hasplace, .timeText {
word-break: break-all;
max-width: 540rpx;
overflow: hidden;
}
.placeContaint, .timeContaint, .participatorContaint, .meetingWayContent {
width: 678rpx;
display: flex;
justify-content: space-between;
}
.meetingWay .close, .place .close, .participator .iconicon_open {
color: #9599A2;
}
.repeatModal {
color: #191F25;
margin-top: 24rpx;
font-size: 28Îpx;
opacity: 0.56;
}
.time .iconicon_cycle {
color: #3070F2
}
.conflictStatus {
color: #FF943E;
font-size: 24rpx;
margin-left: 24rpx;
}
.participatorList {
width: 100%;
}
.participatorList>.icon {
color: #1b263d;
}
.participatorListTop {
width: 100%;
display: flex;
justify-content: space-between;
}
.participatorText {
display: flex;
align-items: center;
height: 38rpx;
}
.participatorListBottom {
margin-top: 11rpx;
display: flex;
flex-wrap: wrap;
}
.people, .addPeople {
margin-right: 27rpx;
text-align: center;
width: 80rpx;
height: auto;
margin-top: 22rpx;
}
.people:nth-child(6n) {
margin-right: 0;
}
.headUrl {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
background: #3070F2;
color: white;
line-height: 80rpx;
text-align: center;
position: relative;
}
.conflict {
line-height: 13px;
vertical-align: top;
width: 13px;
height: 13px;
position: absolute;
background: #fff;
bottom: 0rpx;
color: #FF943E;
font-size: 12px;
right: -3rpx;
border-radius: 50%;
text-align: center;
}
.headUrl>image {
vertical-align: top;
width: 100%;
height: 100%;
border-radius: 50%;
}
.name {
font-size: 24rpx;
margin-top: 8rpx;
opacity: 0.56;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.addPeople {
margin-right: 0;
width: 78rpx;
text-align: center;
line-height: 78rpx;
font-size: 50rpx;
height: 80rpx;
border: 1rpx solid #F6F6F6;
border-radius: 50%;
color: #BBBEC5;
}
.save {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 16rpx 32rpx;
background: #fff;
box-shadow: 0 -2px 4px 0 rgba(0, 0, 0, 0.04);
position: fixed;
bottom: 0;
}
.button {
font-family: PingFangSC-Regular;
width: 686rpx;
height: 96rpx;
background: #4D88FF;
border-radius: 48rpx;
font-size: 34rpx;
color: #FFFFFF;
text-align: center;
line-height: 96rpx;
}
/* .iconicon_add {
margin-left: -2rpx;
text-align: left;
vertical-align: middle;
font-size: 92rpx;
} */
\ No newline at end of file
<view class="createMeeting">
<!-- title remark 标题 描述 -->
<view class="createTitle">
<view class="title">
<input placeholder-class="placeholder" placeholder="请输入主题" class="text" focus="{{true}}" onInput="onInput"
data-type="title" value="{{title}}" />
<view class="icon iconfont iconicon_description" onTap="addRemark">
</view>
</view>
<view class="remark" a:if="{{isShowRemark}}">
<input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput"
data-type="remark" />
</view>
</view>
<!-- roomId locationName 地点 -->
<view class="place">
<view class="iconicon_room iconfont icon" a:if="{{roomId}}">
</view>
<view class="iconicon_location iconfont icon" a:else>
</view>
<view class="placeContaint">
<view class="noPlace" a:if="{{!locationName}}" onTap="nextPage" data-nextPage="location">
添加地点
</view>
<view class="hasplace" onTap="nextPage" data-nextPage="location" a:else>
{{locationName}}
</view>
<view class=" icon iconfont iconicon_close close" a:if="{{!!locationName}}" data-close="location"
catchTap="close">
</view>
</view>
</view>
<!-- startTime endTime repeatable recurrenceModel 时间 重复 -->
<view class="time">
<view class="iconicon_time iconfont icon">
</view>
<view class="timeContaint">
<view>
<view class="timeText" catchTap="showPopup" data-type='time'>
<text a:if="{{isAcrossDay}}">
{{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${startTime.substring(11, 16)}`}}
- {{`${endTime.substring(5, 7)}月${endTime.substring(8, 10)}日 ${endTime.substring(11, 16)}`}}
</text>
<text a:else>
{{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${week} ${startTime.substring(11, 16)}- ${endTime.substring(11, 16)}`}}
</text>
<!-- 3月1日 周日 14:00-16:00 -->
</view>
<view class="repeatModal" a:if="{{comListData.comSelectListId !== 0}}" catchTap="showPopup"
data-type='repeat'>
{{comListData.repeatList[comListData.comSelectListId].text}}重复
</view>
</view>
<view class="icon iconfont iconicon_cycle " catchTap="showPopup" data-type='repeat'
a:if="{{comListData.comSelectListId == 0}}">
</view>
</view>
</view>
<!-- participatorList participatorUserId 参会人 -->
<view class="participator">
<view class="iconicon_attender1 iconfont icon">
</view>
<view class="participatorContaint">
<view class="participatorText" a:if="{{participatorList.length < 2}}" catchTap="showPopup"
data-type='participator'>
添加参会人
</view>
<view class="participatorList" a:else>
<view class="participatorListTop">
<view class="participatorText">
<view>
{{participatorList.length}}位参会人
</view>
<view class="conflictStatus">
3人会议安排冲突
</view>
</view>
<view class="iconicon_open iconfont icon" style=" vertical-align: middle"></view>
</view>
<view class="participatorListBottom">
<view class="people"
a:for="{{participatorList.length > 10 ? [...participatorList].splice(0, 11) : participatorList}}">
<view class="headUrl">
<image a:if="{{item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}" />
<text
a:else>{{item.platform==="outlook" ? item.username.substring(0, 2) : item.username.substring(item.username.length-2, item.username.length)}}
</text>
<view class="conflict iconicon_conflict iconfont">
</view>
</view>
<view class="name">{{item.name}}</view>
</view>
<view class="addPeople" catchTap="showPopup" data-type='participator'></view>
</view>
</view>
</view>
</view>
<!-- meetingWay 会议方式 -->
<view class="meetingWay">
<view class="iconicon_meet1 iconfont icon">
</view>
<view class="meetingWayContent">
<view class="noWay" a:if="{{comListData.meetingWayModelId == null}}" catchTap="showPopup"
data-type='meetingWayModel'>
会议方式
</view>
<view class="hasWay" a:else catchTap="showPopup" data-type='meetingWayModel'>
{{comListData.meetingWayList[comListData.meetingWayModelId].text}}
</view>
<view class=" icon iconfont iconicon_close close" a:if="{{comListData.meetingWayModelId !== null}}"
data-close="meetingWayModel" catchTap="close">
</view>
</view>
</view>
<!-- 保存 -->
<view class="save" onTap="addSchedule">
<view class="button">
立即创建
</view>
</view>
<popup title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup">
<meeting-time-picker a:if="{{'time' === comType}}" onComplete="onComplete"></meeting-time-picker>
<hlist a:if="{{'participator' === comType}}" dataComList="{{comHListData.contactData}}"
onSelectComHList="selectComHList"></hlist>
<list a:if="{{comType=='repeat' || comType=='meetingWayModel'}}"
dataComList="{{comType=='repeat' ? comListData.repeatList : comListData.meetingWayList}}"
onComSelectList="selectComList"
comSelectListId="{{comType=='repeat' ? comListData.comSelectListId : comListData.meetingWayModelId}}"
iconType="{{comListData.iconType}}">
</list>
</popup>
</view>
\ No newline at end of file
import { addSchedule } from '../../api/request.js'
import { throttle } from './../../utils/utils.js'
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
create.Page({
store: exampleStore,
useAll: true,
data: {
// 传给组件list 的所有数据 comListData
comListData: {
repeatList: [
{ id: 0, text: '不重复', icon: 'iconicon_cycle', repeatable: 0, recurrenceModel: { model: 'no_repeat' } },
{ id: 1, text: '每天', icon: '', repeatable: 1, recurrenceModel: { model: 'daily', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: null } },
{ id: 2, text: '每周', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: ['MO'] } },
{ id: 3, text: '每周的工作日', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: ['MO', 'TU', 'WE', 'TH', 'FR'] } },
{ id: 4, text: '每月', icon: '', repeatable: 1, recurrenceModel: { model: 'absoluteMonthly', daysOfMonth: ['23'], interval: 1, initialTime: `2020-03-23`, terminateTime: `2022-03-23`, weekDayList: null } }
],
meetingWayList: [
{ id: 0, text: 'Webex meeting', imageUrl: '../../assests/Webex.png', meetingWayModel: { model: 'webex' } },
{ id: 1, text: 'Zoom Meeting', imageUrl: '../../assests/Zoom.png', meetingWayModel: { model: 'zoom' } },
{ id: 2, text: '钉钉', imageUrl: '../../assests/dingding.png', meetingWayModel: { model: 'dingtalk' } }
],
comSelectListId: 0,
meetingWayModelId: null,
iconType: 'icon'
},
// 传给组件 hList 水平排列 所有数据 comHListData
comHListData: {
contactData: [
{ id: 0, text: '钉钉联系人', imageUrl: '../../assests/dingContact.png' },
{ id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' }
]
},
// show: true,
title: ``,
repeatable: 0,
recurrenceModel: { model: 'no_repeat' },
isShowRemark: false,
repeatWeek: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'],
popupTitle: '会议重复',
popupShow: false,
comType: '',
remark: '',
comTimeType: '',
meetingWayModel: null,
weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
week: '',
isAcrossDay: false
},
showPop() {
this.setData({
show: true
})
},
closePop() {
this.setData({
show: false
})
},
Complete(data) {
console.log(data)
this.closePop();
},
onLoad() {
dd.setNavigationBar({
title: `会议详情`
})
this.setData({
title: `${getApp().globalData.name}创建的会议`
})
this.reset()
},
// 添加描述
addRemark() {
let isShowRemark = !this.data.isShowRemark
if (!isShowRemark) {
this.setData({
remark: ''
})
}
this.setData({
isShowRemark: isShowRemark
})
this.update()
},
// 输入框输入事件
onInput(event) {
switch (event.target.dataset.type) {
case 'title':
this.setData({
title: event.detail.value
})
break
case 'remark':
this.setData({
remark: event.detail.value
})
break
}
},
// 初始化
reset() {
this.store.data.roomId = ''
this.store.data.participatorList = []
this.store.data.participatorUserId = []
this.store.data.locationName = ''
this.store.data.startTime = this.getTimes()
this.store.data.endTime = this.getTimes(new Date(this.getTimes()).setMinutes(new Date(this.store.data.startTime).getMinutes() + 120))
this.update()
this.resetRepeatList()
this.acrossDay(this.store.data.startTime, this.store.data.endTime)
},
// 跳转下一页
nextPage(event) {
switch (event.target.dataset.nextPage) {
case 'location':
dd.navigateTo({ url: './../place/place' })
break
}
},
// 所有的关闭操作
close(event) {
switch (event.target.dataset.close) {
case 'location':
this.store.data.locationName = ''
this.store.data.roomId = ''
this.update()
break
case 'meetingWayModel':
this.setData({
'comListData.meetingWayModelId': null,
meetingWayModel: null
})
}
},
// 关闭popup 点击mark
closePopup() {
this.setData({
popupShow: false
})
},
// 选择循环机制 选择会议方式 选择时间 出现popup弹窗
showPopup(event) {
let iconType = ''
switch (event.currentTarget.dataset.type) {
case 'meetingWayModel':
iconType = 'image'
break
case 'repeat':
iconType = 'icon'
break
case 'participator':
break
case 'time':
break
}
this.setData({
popupShow: true,
comType: event.currentTarget.dataset.type,
'comListData.iconType': iconType
})
},
resetRepeatList() {
let index = 0
let repeatList = []
for (let value of this.data.comListData.repeatList) {
if (index) {
value.recurrenceModel.initialTime = this.store.data.startTime.replace(/\//g, "-").substring(0, 10)
value.recurrenceModel.terminateTime = this.getTwoYearToday(this.store.data.startTime)
if (index === 2) {
value.recurrenceModel.weekDayList = [this.data.repeatWeek[new Date().getDay()]]
} else if (index === 4) {
value.recurrenceModel.daysOfMonth = this.store.data.startTime.replace(/\//g, "-").substring(8, 10)
}
}
repeatList.push(value)
index++
}
this.setData({
'comListData.repeatList': repeatList,
week: this.data.weekList[new Date().getDay()]
})
},
// 选择完comList后的回调
selectComList(event) {
switch (this.data.comType) {
case 'meetingWayModel':
this.setData({
'comListData.meetingWayModelId': event.currentTarget.dataset.item.id,
popupShow: false,
meetingWayModel: this.data.comListData.meetingWayList[event.currentTarget.dataset.item.id].meetingWayModel
})
break;
case 'repeat':
this.resetRepeatList()
this.setData({
popupShow: false,
'comListData.comSelectListId': event.currentTarget.dataset.item.id,
repeatable: event.currentTarget.dataset.item.repeatable,
recurrenceModel: event.currentTarget.dataset.item.recurrenceModel
})
break;
}
},
// 选择完水平 HList 的回调
selectComHList(event) {
console.log(event)
switch (event.currentTarget.dataset.item.id) {
case 0:
this.addParticipator()
this.setData({
popupShow: false
})
break;
case 1:
this.setData({
popupShow: false
})
dd.navigateTo({ url: './../outLookContact/outLookContact' })
break;
}
},
// 获取两年后的今天
getTwoYearToday(startTime) {
let date = new Date(startTime)
date.setYear(date.getFullYear() + 2)
let year = date.getFullYear();
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return year + '-' + month + '-' + day
},
// 添加参会人
addParticipator() {
const _that = this
let require = []
let select = []
select = this.store.data.participatorUserId
require = [getApp().globalData.userid]
select = _that.selectedelRequired(require, select).pickedUsers
dd.complexChoose({
title: "选择参会人", //标题
multiple: true, //是否多选
pickedUsers: select, //已选用户
requiredUsers: require, //必选用户(不可取消选中状态)
responseUserOnly: true, //返回人,或者返回人和部门
success: function (res) {
_that.store.data.participatorList = []
_that.store.data.participatorUserId = []
_that.store.data.participatorList.push({ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk' })
_that.store.data.participatorUserId.push(getApp().globalData.userid)
res.users.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar, platform: 'dingtalk' })
_that.store.data.participatorUserId.push(item.userId)
})
_that.store.data.participatorList = _that.setArrary(_that.store.data.participatorList)
_that.store.data.participatorUserId = [...new Set(_that.store.data.participatorUserId)]
_that.update()
},
fail: function (err) {
}
})
},
// 已选用户去中去掉必选用户
selectedelRequired(req, pic) {
for (let i = 0; i < req.length; i++) {
for (let m = 0; m < pic.length; m++) {
if (req[i] == pic[m]) {
pic.splice(m, 1)
m--;
}
}
}
return {
requiredUsers: req,
pickedUsers: pic
}
},
// 数组 去重
setArrary(arr) {
let containt = {}
for (let x of arr) {
containt['id' + x.userId] = x
}
return Object.values(containt)
},
// 点击完成
onComplete(event) {
this.store.data.startTime = `${event.startTime}:00`
this.store.data.endTime = `${event.endTime}:00`
this.update()
this.acrossDay(this.store.data.startTime, this.store.data.endTime)
this.setData({
popupShow: false
})
},
addSchedule() {
let data = {
title: this.data.title || `${getApp().globalData.name}创建的会议`,
location: {
longitude: '10',
latitude: '10',
locationName: this.store.data.locationName
},
startTime: this.store.data.startTime.replace(/\//g, "-"),
endTime: this.store.data.endTime.replace(/\//g, "-"),
meetingRoomId: this.store.data.roomId,
scheduleType: this.store.data.roomId ? 'meeting' : 'common',
participatorList: !!this.store.data.participatorList.length ? this.store.data.participatorList : [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar }],
repeatable: this.data.repeatable,
remark: this.data.remark,
recurrenceModel: this.data.recurrenceModel,
meetingRoomId: this.store.data.roomId,
meetingWayModel: this.data.meetingWayModel
}
addSchedule(data).then(res => {
console.log(res)
if (res.data.code === 0) {
dd.navigateBack({
delta: 1
})
}
})
},
// 获取时间参数
getTimes(time = new Date()) {
let date = new Date(time)
let year = date.getFullYear()
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
let hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
let miunutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return `${year}/${month}/${day} ${hour}:${miunutes}:00`
},
// 是否跨天
acrossDay(time1, time2) {
let isAcrossDay = ''
if (JSON.stringify(this.getTimes(time1).substring(0, 10)) === JSON.stringify(this.getTimes(time2).substring(0, 10))) {
isAcrossDay = false
} else {
isAcrossDay = true
}
this.setData({
isAcrossDay: isAcrossDay
})
},
conflictPeople() {
let userIds = []
for (let value of this.store.data.participatorList) {
userIds.push(value.userId)
}
let data = {
startTime: this.store.data.startTime,
endTime: this.store.data.endTime,
userIds: userIds
}
getUserScheduleInTime(data).then(res => {
})
// for (let value of this.store.data.participatorList) {
// if()
// }
}
});
{
"usingComponents": {
"popup": "../../components/popup/index",
"list": "../../components/list/list",
"hlist": "../../components/hList/hList",
"meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker"
}
}
\ No newline at end of file
<view>
New Page
</view>
\ No newline at end of file
Page({
data: {},
onLoad() {},
});
{}
\ No newline at end of file
...@@ -8,9 +8,9 @@ class Store { ...@@ -8,9 +8,9 @@ class Store {
editList: [{ icon: 'icondingwei', text: '地点' }, { icon: 'iconhuiqiantixing', text: '提醒' }, { icon: 'iconchongfu', text: '重复' }, { icon: 'icondidianmiaoshu', text: '描述' }, { icon: 'iconshanchu', text: '删除' }], editList: [{ icon: 'icondingwei', text: '地点' }, { icon: 'iconhuiqiantixing', text: '提醒' }, { icon: 'iconchongfu', text: '重复' }, { icon: 'icondidianmiaoshu', text: '描述' }, { icon: 'iconshanchu', text: '删除' }],
aheadTimes: [], aheadTimes: [],
requireUserList: [], requireUserList: [],
roomId: '',
startTime: '', startTime: '',
endTime: '', endTime: ''
roomId: ''
} }
} }
export default new Store() 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