Commit 8408b1db by fengzhaoyu

feat: canhuiren

parent 6623a631
...@@ -41,7 +41,7 @@ export default function http(data) { ...@@ -41,7 +41,7 @@ export default function http(data) {
resolve(res) resolve(res)
}, },
fail: function (res) { fail: function (res) {
console.log(res) rejects(res)
} }
}) })
}) })
......
<view class="popupWindow" a:if="{{centerPopup}}"> <view class="popupWindow" a:if="{{centerPopup}}">
<view class="popupWindowCenter"> <view class="popupWindowCenter">
<view class="list" a:for="{{popupWindowList}}" onTap="selectSend" data-item="{{item}}"> <view class="list" a:for="{{centerPopupList}}" onTap="selectSend" data-item="{{item}}">
{{item.text}} {{item.text}}
</view> </view>
</view> </view>
......
...@@ -2,8 +2,14 @@ Component({ ...@@ -2,8 +2,14 @@ Component({
mixins: [], mixins: [],
data: {}, data: {},
props: {}, props: {},
didMount() {}, didMount() {
didUpdate() {}, console.log(this.props.centerPopupList)
didUnmount() {}, },
methods: {}, didUpdate() { },
didUnmount() { },
methods: {
selectSend(event) {
this.props.onSelectSend(event)
}
},
}); });
{{comSelectList}}
<view class="com-list"> <view class="com-list">
<view class="picker-complete" onTap='complete' a:if="{{complete}}" onTap='complete'>完成</view> <view class="picker-complete" onTap='complete' a:if="{{complete}}" onTap='complete'>完成</view>
<view class=" com-list-item" catchTap="comSelectList" data-item="{{item}}" a:for="{{dataComList}}"> <view class=" com-list-item" catchTap="comSelectList" data-item="{{item}}" a:for="{{dataComList}}">
......
...@@ -44,6 +44,7 @@ Component({ ...@@ -44,6 +44,7 @@ Component({
this.setData({ this.setData({
comSelectList: [] comSelectList: []
}) })
this.props.onCompelete([])
} }
else if (!this.props.multiple) { else if (!this.props.multiple) {
this.setData({ this.setData({
...@@ -51,7 +52,6 @@ Component({ ...@@ -51,7 +52,6 @@ Component({
}) })
this.props.onComSelectList(event) this.props.onComSelectList(event)
} }
console.log(this.data.comSelectList)
}, },
complete(event) { complete(event) {
let comSelectList = this.data.comSelectList.sort((a, b) => { let comSelectList = this.data.comSelectList.sort((a, b) => {
......
...@@ -229,4 +229,8 @@ input { ...@@ -229,4 +229,8 @@ input {
.noValueIcon { .noValueIcon {
color: rgba(216, 216, 216, 1)!important; color: rgba(216, 216, 216, 1)!important;
}
.footNavTop .devider {
margin: 0!important;
} }
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</view> </view>
<!-- roomId locationName 地点 --> <!-- roomId locationName 地点 -->
<view class="place"> <view class="place">
<view class="iconicon_room1 iconfont icon " a:if="{{roomId}}"> <view class="iconicon_Agreed1 iconfont icon " a:if="{{roomId}}">
</view> </view>
<view class="iconicon_location1 iconfont icon {{locationName ? '' : 'noValueIcon'}}" a:else> <view class="iconicon_location1 iconfont icon {{locationName ? '' : 'noValueIcon'}}" a:else>
</view> </view>
......
...@@ -41,7 +41,7 @@ create.Page({ ...@@ -41,7 +41,7 @@ create.Page({
comType: '', comType: '',
remark: '', remark: '',
comTimeType: '', comTimeType: '',
meetingWayModel: null, meetingWayModel: { model: null },
weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
week: '', week: '',
isAcrossDay: false, isAcrossDay: false,
...@@ -74,6 +74,10 @@ create.Page({ ...@@ -74,6 +74,10 @@ create.Page({
if (this.store.data.participatorList.length > 1) { if (this.store.data.participatorList.length > 1) {
this.conflictPeople() this.conflictPeople()
} }
setTimeout(() => {
this.update()
}, 100)
}, },
// 添加描述 // 添加描述
addRemark() { addRemark() {
...@@ -210,6 +214,7 @@ create.Page({ ...@@ -210,6 +214,7 @@ create.Page({
repeatable: event.currentTarget.dataset.item.repeatable, repeatable: event.currentTarget.dataset.item.repeatable,
recurrenceModel: event.currentTarget.dataset.item.recurrenceModel recurrenceModel: event.currentTarget.dataset.item.recurrenceModel
}) })
this.conflictPeople()
break; break;
} }
}, },
...@@ -274,7 +279,6 @@ create.Page({ ...@@ -274,7 +279,6 @@ create.Page({
_that.store.data.participatorUserId = participatorUserId _that.store.data.participatorUserId = participatorUserId
_that.update() _that.update()
_that.conflictPeople() _that.conflictPeople()
}, },
fail: function (err) { fail: function (err) {
} }
...@@ -364,6 +368,7 @@ create.Page({ ...@@ -364,6 +368,7 @@ create.Page({
isAcrossDay: isAcrossDay isAcrossDay: isAcrossDay
}) })
}, },
// 会议冲突
conflictPeople() { conflictPeople() {
let userIds = [] let userIds = []
for (let value of this.store.data.participatorList) { for (let value of this.store.data.participatorList) {
...@@ -377,7 +382,10 @@ create.Page({ ...@@ -377,7 +382,10 @@ create.Page({
getUserScheduleInTime(data).then(res => { getUserScheduleInTime(data).then(res => {
let conflictPeople = [] let conflictPeople = []
for (let value in res.data.data) { for (let value in res.data.data) {
if (res.data.data[value].length > 0) { const arr = res.data.data[value].filter(function (item) {
return item.confirmAttendance === 1
})
if (arr.length > 0) {
conflictPeople.push(value) conflictPeople.push(value)
} }
} }
......
@import "../../assests/font/iconfont.acss"; @import "../../assests/font/iconfont.acss";
@import "../../template/deleteBtn/index.acss";
page { page {
background: #fff; background: #fff;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
...@@ -43,6 +44,8 @@ page { ...@@ -43,6 +44,8 @@ page {
input { input {
caret-color: #3070F2; caret-color: #3070F2;
padding-left: 0; padding-left: 0;
height: 52rpx;
line-height: 52rpx;
} }
.createTitle { .createTitle {
...@@ -72,7 +75,8 @@ input { ...@@ -72,7 +75,8 @@ input {
padding-left: 0; padding-left: 0;
width: 100%; width: 100%;
opacity: 0.72; opacity: 0.72;
font-size: 14px; font-size: 28rpx;
color: rgba(3, 3, 3, 1)
} }
.placeholder { .placeholder {
...@@ -231,21 +235,12 @@ input { ...@@ -231,21 +235,12 @@ input {
color: #BBBEC5; color: #BBBEC5;
} }
.delMetting { .editeMeeting .delete-task-wrap {
display: flex;
background: #FFFFFF;
border: 1rpx solid #DEDEDE;
border-radius: 48px;
height: 64rpx;
line-height: 64rpx;
color: #F25643;
justify-content: center;
width: 256rpx;
margin: 74rpx auto 32rpx; margin: 74rpx auto 32rpx;
} }
.delMetting>.iconfont { .delete-task {
margin-right: 18rpx; color: #EA0C28!important;
} }
.footNav { .footNav {
...@@ -259,14 +254,15 @@ input { ...@@ -259,14 +254,15 @@ input {
.originStaus, .participateStatus, .noParticipateStatus { .originStaus, .participateStatus, .noParticipateStatus {
display: flex; display: flex;
line-height: 92rpx; line-height: 96rpx;
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-size: 28rpx; font-size: 28rpx;
align-items: center;
} }
.originStaus>view, .participateStatus>view { .originStaus>view, .participateStatus>view {
height: 92rpx; height: 96rpx;
line-height: 92rpx; line-height: 96rpx;
width: 49%; width: 49%;
text-align: center; text-align: center;
} }
...@@ -277,10 +273,6 @@ input { ...@@ -277,10 +273,6 @@ input {
vertical-align: middle; vertical-align: middle;
} }
.line {
color: #E3E4E4;
}
.participateStatus .remind { .participateStatus .remind {
width: 580rpx; width: 580rpx;
} }
...@@ -340,21 +332,42 @@ input { ...@@ -340,21 +332,42 @@ input {
margin-right: 10rpx; margin-right: 10rpx;
} }
.footNavBottom { .footerBottom {
border-top: 1rpx solid rgba(25, 31, 37, 0.12);
display: flex;
flex-direction: row-reverse;
height: 96rpx;
line-height: 96rpx;
background: #fff; background: #fff;
color: #1B263D; border-top: 2rpx solid rgba(25, 31, 37, 0.12);
height: 94rpx;
display: flex;
align-items: center;
justify-content: flex-end;
width: 100%;
} }
.footNavBottom>.iconfont { .footerBottom>view {
margin-right: 70rpx; width: 35rpx;
font-size: 40rpx; margin: 0 38rpx;
font-size: 16rpx;
text-align: center;
}
.footerBottom>view>.iconfont {
font-size: 36rpx;
}
.footerBottom>view:last-child {
margin: 0 24rpx 0 0;
}
.devider {
background: rgba(227, 228, 228, 1);
height: 48rpx;
width: 1rpx;
margin: 0 28rpx;
} }
.noValueIcon { .noValueIcon {
color: rgba(216, 216, 216, 1)!important; color: rgba(216, 216, 216, 1)!important;
}
.footNavTop .devider {
margin: 0;
} }
\ No newline at end of file
<import src="../../template/deleteBtn/index.axml"/>
<view class="hideDetail" a:if="{{false}}"> <view class="hideDetail" a:if="{{false}}">
<view class="hideTitle"> <view class="hideTitle">
设计分享会 设计分享会
...@@ -12,12 +13,12 @@ ...@@ -12,12 +13,12 @@
<!-- title remark 标题 描述 --> <!-- title remark 标题 描述 -->
<view class="createTitle"> <view class="createTitle">
<view class="title"> <view class="title">
<input placeholder-class="placeholder" placeholder="请输入主题" class="text" onInput="onInput" data-type="title" data-selectType="common" value="{{title}}" onConfirm="onBlur" /> <input placeholder-class="placeholder" placeholder="请输入主题" class="text" onInput="onInput" data-type="title" data-selectType="common" value="{{title}}" onConfirm="onConfirm"/>
<view class="icon iconfont iconicon_description1 {{remark ? '' : 'noValueIcon'}}" onTap="addRemark"> <view class="icon iconfont iconicon_description1 {{remark ? '' : 'noValueIcon'}}" 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" value="{{remark}}" onConfirm="onBlur" /> <input placeholder-class="placeholder" placeholder="请添加描述" class="text" onInput="onInput" data-type="remark" value="{{remark}}" onConfirm="onConfirm"/>
</view> </view>
</view> </view>
<!-- roomId locationName 地点 --> <!-- roomId locationName 地点 -->
...@@ -45,11 +46,10 @@ ...@@ -45,11 +46,10 @@
<view> <view>
<view class="timeText" catchTap="showPopup" data-type='time'> <view class="timeText" catchTap="showPopup" data-type='time'>
<text a:if="{{isAcrossDay}}"> <text a:if="{{isAcrossDay}}">
{{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${startTime.substring(11, 16)}`}} {{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${startTime.substring(11, 16)}`}}-{{`${endTime.substring(5, 7)}月${endTime.substring(8, 10)}日 ${endTime.substring(11, 16)}`}}
- {{`${endTime.substring(5, 7)}月${endTime.substring(8, 10)}日 ${endTime.substring(11, 16)}`}}
</text> </text>
<text a:else> <text a:else>
{{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${week} ${startTime.substring(11, 16)}- ${endTime.substring(11, 16)}`}} {{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${week} ${startTime.substring(11, 16)}-${endTime.substring(11, 16)}`}}
</text> </text>
<!-- 3月1日 周日 14:00-16:00 --> <!-- 3月1日 周日 14:00-16:00 -->
</view> </view>
...@@ -114,13 +114,9 @@ ...@@ -114,13 +114,9 @@
</view> </view>
</view> </view>
<!-- 删除该会议 --> <!-- 删除该会议 -->
<view class="delMetting" onTap="delSheudle"> <template is="deleteBtn" onhandleDelete="" data="{{title: '删除该会议' }}"/>
<view class=" iconfont iconicon_close"> <!--<view class="delMetting" onTap="delSheudle"><view class=" iconfont iconicon_close"></view><view>
</view> 删除该会议</view></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}}" onComplete="onComplete"></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> <hlist a:if="{{'participator' === comType}}" dataComList="{{comHListData.contactData}}" onSelectComHList="selectComHList"></hlist>
...@@ -133,39 +129,44 @@ ...@@ -133,39 +129,44 @@
<view class="footNavTop"> <view class="footNavTop">
<view class="originStaus" a:if="{{confirmAttendance === null}}"> <view class="originStaus" a:if="{{confirmAttendance === null}}">
<view catchTap="participate"> <view catchTap="participate">
<text class="iconfont iconicon_share"></text> <text class="iconfont iconicon_Agreed1"></text>
<text>参加</text></view> <text>参加</text></view>
<text class="line">|</text> <text class="devider"></text>
<view catchTap="noParticipate"> <view catchTap="noParticipate">
<text class="iconfont iconicon_share"></text> <text class="iconfont iconicon_noAgreed1"></text>
<text>不参加</text> <text>不参加</text>
</view> </view>
</view> </view>
<view class="participateStatus" a:if="{{confirmAttendance === 1}}"> <view class="participateStatus" a:if="{{confirmAttendance === 1}}">
<view class="remind" catchTap="showPopup" data-type="aheadTime"> <view class="remind" catchTap="showPopup" data-type="aheadTime">
<text class="iconfont iconicon_share"></text> <text class="iconfont iconicon_time1"></text>
<text class="remindTimeContaint" a:if="{{aheadTimes.length}}"> <text class="remindTimeContaint" a:if="{{aheadTimes.length}}">
<text class="remindTime" a:for="{{comListData.aheadTimesList}}" a:if="{{aheadTimes.includes(item.id)}}"> <text class="remindTime" a:for="{{comListData.aheadTimesList}}" a:if="{{aheadTimes.includes(item.id)}}">
{{item.text}} {{item.text}}
</text> </text>
</text> </text>
<text class="noRemind" a:if="{{!aheadTimes.length}}">不提醒</text> <text class="noRemind" a:if="{{!aheadTimes.length}}">不提醒</text>
<text class="iconfont iconicon_share"></text></view>
<text class="line">|</text>
<view class="participate" catchTap="noParticipate">
<text class="iconfont iconicon_share"></text> <text class="iconfont iconicon_share"></text>
</view>
<text class="devider"></text>
<view class="participate" catchTap="noParticipate">
<text class="iconfont iconicon_Agreed1"></text>
<text>参加</text></view></view> <text>参加</text></view></view>
<view class="noParticipateStatus" a:if="{{confirmAttendance === 0}}" catchTap="participate"> <view class="noParticipateStatus" a:if="{{confirmAttendance === 0}}" catchTap="participate">
<text class="iconfont iconicon_share"></text> <text class="iconfont iconicon_noAgreed1"></text>
<text>不参加</text> <text>不参加</text>
</view> </view>
</view> </view>
<view class="footNavBottom"> <view class="footerBottom">
<view class="iconfont iconicon_data" onTap="uploadFile"> <view onTap="showPop" data-pop="{{title: '创建任务', type: 'createTask'}}">
</view> <text class="iconfont iconicon_task1"></text>任务</view>
<view class="iconfont iconicon_task1"> <view>
</view> <text class="iconfont iconicon_data" onTap="uploadFile"></text>文件</view>
<text class="devider"></text>
<view>
<text class="iconfont iconicon_share1"></text></view>
</view> </view>
</view> </view>
<toast showToast="{{conToastData.showToast}}" onToastHidden="onToastHidden"></toast> <centerpopup centerPopup="{{centerPopup.showCenterPopup}}" centerPopupList="{{centerPopup.centerPopupList}}" onSelectSend="onSelectSend"></centerpopup>
<toast showToast="{{conToastData.showToast}}" title="{{conToastData.title}}" onToastHidden="onToastHidden"></toast>
<selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.selectType==='noParticipateStatus' ? conSelectPopupData.noParticipateStatusList : conSelectPopupData.selectType==='delSheudle' ? conSelectPopupData.delSheudleList : (conSelectPopupData.selectType === 'participateStatus' ? conSelectPopupData.participateStatusList : conSelectPopupData.editSaveList)}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup> <selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.selectType==='noParticipateStatus' ? conSelectPopupData.noParticipateStatusList : conSelectPopupData.selectType==='delSheudle' ? conSelectPopupData.delSheudleList : (conSelectPopupData.selectType === 'participateStatus' ? conSelectPopupData.participateStatusList : conSelectPopupData.editSaveList)}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"hlist": "../../components/hList/hList", "hlist": "../../components/hList/hList",
"toast": "../../components/toast/toast", "toast": "../../components/toast/toast",
"selectpopup": "../../components/selectPopup/selectPopup", "selectpopup": "../../components/selectPopup/selectPopup",
"centerpopup": "../../components/centerPopup/centerPopup",
"meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker" "meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker"
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ page { ...@@ -7,7 +7,7 @@ page {
padding-bottom: 128rpx; padding-bottom: 128rpx;
} }
.list { .peopleList {
background: #fff; background: #fff;
height: 112rpx; height: 112rpx;
line-height: 112rpx; line-height: 112rpx;
......
<view> <view>
<view class="list" a:for="{{participatorList}}" a:for-item="item"> <view class="peopleList" a:for="{{participatorList}}" a:for-item="item">
<view class="headImg"> <view class="headImg">
<image a:if="{{!!item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}"/> <image a:if="{{!!item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}"/>
<text a:else>{{item.username.substring(0, 1)}}</text> <text a:else>{{item.username.substring(0, 1)}}</text>
...@@ -17,4 +17,7 @@ ...@@ -17,4 +17,7 @@
<popup title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup"> <popup title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup">
<hlist dataComList="{{comHListData.contactData}}" onSelectComHList="selectComHList"></hlist> <hlist dataComList="{{comHListData.contactData}}" onSelectComHList="selectComHList"></hlist>
</popup> </popup>
<toast showToast="{{conToastData.showToast}}" title="{{conToastData.title}}" onToastHidden="onToastHidden"></toast>
<centerpopup centerPopup="{{centerPopup.showCenterPopup}}" centerPopupList="{{centerPopup.centerPopupList}}" onSelectSend="onSelectSend"></centerpopup>
<selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.editSaveList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
</view> </view>
\ No newline at end of file
import create from 'dd-store' import create from 'dd-store'
import exampleStore from '/stores/exampleStore' import exampleStore from '/stores/exampleStore'
import { addSchedule, getUserScheduleInTime, getHomeUserSchedule } from '../../api/request.js' import { modifySchedule, addSchedule, getUserScheduleInTime, getHomeUserSchedule } from '../../api/request.js'
create.Page({ create.Page({
store: exampleStore, store: exampleStore,
useAll: true, useAll: true,
...@@ -14,7 +14,29 @@ create.Page({ ...@@ -14,7 +14,29 @@ create.Page({
{ id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' } { id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' }
] ]
}, },
popupShow: false popupShow: false,
// 传递给组件selectPopup 的数据
conSelectPopupData: {
selectPopupId: '',
showSelectPopup: false,
selectType: 'common',
editSaveList: [{ text: '仅保存此会议', id: 'only' }, { text: '保存此次及以后会议', id: 'future' }]
},
// 传递给组件centerPopup 的数据
centerPopup: {
showCenterPopup: false,
centerPopupList: [
{ id: 0, text: '不发送通知' },
{ id: 1, text: '发送通知' },
{ id: -1, text: '取消编辑' }
],
centerPopupId: ''
},
// 传递给组件toast的所有数据
conToastData: {
showToast: false,
title: '保存成功'
},
}, },
onLoad(event) { onLoad(event) {
if (event.scheduleItem) { if (event.scheduleItem) {
...@@ -64,6 +86,12 @@ create.Page({ ...@@ -64,6 +86,12 @@ create.Page({
delta: 1 delta: 1
}) })
}, },
// toast 消失之后的回调
onToastHidden() {
this.setData({
'conToastData.showToast': false
})
},
// 添加参会人 // 添加参会人
addParticipator() { addParticipator() {
const _that = this const _that = this
...@@ -116,21 +144,106 @@ create.Page({ ...@@ -116,21 +144,106 @@ create.Page({
_that.store.data.participatorList = participatorList _that.store.data.participatorList = participatorList
_that.store.data.participatorUserId = participatorUserId _that.store.data.participatorUserId = participatorUserId
_that.update() _that.update()
_that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList)
_that.conflictPeople() _that.conflictPeople()
if (true) { if (!!_that.data.scheduleItem) {
_that.store.data.originUsers = _that.store.data.participatorList if (_that.store.data.originalData.repeatable) {
_that.store.data.originUsersId = _that.store.data.participatorUserId _that.setData({
_that.update() 'conSelectPopupData.showSelectPopup': true
} else { })
_that.store.data.participatorList = _that.store.data.originUsers } else {
_that.store.data.participatorUserId = _that.store.data.originUsersId let addUserList = _that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList).addUserList
let deleteUserList = _that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList).deleteUserList
let dataUser = {
addUserList: addUserList,
deleteUserList: deleteUserList,
modifyModel: 'only',
modifyContent: 'operate_user'
}
_that.modifySchedule(dataUser)
}
} }
}, },
fail: function (err) { fail: function (err) {
} }
}) })
}, },
// 选择弹窗
onSelectPopup(event) {
this.setData({
'conSelectPopupData.showSelectPopup': false,
'conSelectPopupData.selectPopupId': event.currentTarget.dataset.item.id,
'centerPopup.showCenterPopup': true
})
},
// 选择发不发通知
onSelectSend(event) {
this.setData({
'centerPopup.showCenterPopup': false
})
if (event.currentTarget.dataset.item.id > -1) {
let addUserList = _that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList).addUserList
let deleteUserList = _that.arrayPoor(_that.store.data.originUsers, _that.store.data.participatorList).deleteUserList
let dataUser = {
addUserList: addUserList,
deleteUserList: deleteUserList,
modifyModel: 'only',
modifyContent: 'operate_user'
}
this.modifySchedule(dataUser, event.currentTarget.dataset.item.id)
} else {
this.operateUserE(false)
}
},
// 参会人修改成功
operateUserS() {
this.store.data.originUsers = this.store.data.participator
this.store.data.originUsersId = this.store.data.participatorUserId
this.update()
},
// 参会人修改失败
operateUserE() {
this.store.data.participatorList = this.store.data.originUsers
this.store.data.participatorUserId = this.store.data.originUsersId
this.update()
},
// onSelectPopupCancel 点击取消
onSelectPopupCancel() {
this.setData({
'conSelectPopupData.showSelectPopup': false,
'centerPopup.showCenterPopup': false
})
this.operateUserE(false)
},
// 保存编辑
modifySchedule(data, needNotice = 0) {
let obj = {
needNotice: needNotice,
scheduleId: this.data.scheduleItem.id,
templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate
}
return new Promise((resolve, rejects) => {
modifySchedule(Object.assign(data, obj)).then(res => {
if (res.data.code === 0) {
this.setData({
'conToastData.showToast': true,
'conToastData.title': '保存成功'
})
this.operateUserS()
if (this.store.data.originalData.repeatable === 1) {
observer.notice(res.data.data)
}
return resolve(res)
} else {
this.operateUserE()
return rejects(res)
}
}).catch(err => {
this.operateUserE()
return rejects(err)
})
})
},
// 数组取差值 原先的数组与现在的比较 增加与减少 // 数组取差值 原先的数组与现在的比较 增加与减少
arrayPoor(origin, now) { arrayPoor(origin, now) {
let originMap = new Map() let originMap = new Map()
...@@ -153,10 +266,10 @@ create.Page({ ...@@ -153,10 +266,10 @@ create.Page({
del.push(x) del.push(x)
} }
} }
this.setData({ return {
addUserList: add, addUserList: add,
deleteUserList: del deleteUserList: del
}) }
}, },
// 删除参会人 // 删除参会人
delParticipants(event) { delParticipants(event) {
...@@ -204,11 +317,17 @@ create.Page({ ...@@ -204,11 +317,17 @@ create.Page({
let conflictPeople = [] let conflictPeople = []
for (let value in res.data.data) { for (let value in res.data.data) {
if (!!this.data.scheduleItem) { if (!!this.data.scheduleItem) {
if (res.data.data[value].length > 1) { const arr = res.data.data[value].filter(function (item) {
return item.confirmAttendance === 1
})
if (arr.length > 1) {
conflictPeople.push(value) conflictPeople.push(value)
} }
} else { } else {
if (res.data.data[value].length > 0) { const arr = res.data.data[value].filter(function (item) {
return item.confirmAttendance === 1
})
if (arr.length > 0) {
conflictPeople.push(value) conflictPeople.push(value)
} }
} }
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
"popup": "../../components/popup/index", "popup": "../../components/popup/index",
"list": "../../components/list/list", "list": "../../components/list/list",
"hlist": "../../components/hList/hList", "hlist": "../../components/hList/hList",
"toast": "../../components/toast/toast",
"selectpopup": "../../components/selectPopup/selectPopup",
"centerpopup": "../../components/centerPopup/centerPopup",
"meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker" "meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker"
} }
} }
\ No newline at end of file
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
<view class="allMettingRoom" a:if="{{true}}" onTap="toRoomList"> <view class="allMettingRoom" a:if="{{true}}" onTap="toRoomList">
查看所有会议室 查看所有会议室
</view> </view>
<toast showToast="{{conToastData.showToast}}" title="{{conToastData.title}}" onToastHidden="onToastHidden"></toast>
<centerpopup centerPopup="{{centerPopup.showCenterPopup}}" centerPopupList="{{centerPopup.centerPopupList}}" onSelectSend="onSelectSend"></centerpopup>
<selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.editSaveList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup> <selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.editSaveList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -2,6 +2,7 @@ import create from 'dd-store' ...@@ -2,6 +2,7 @@ import create from 'dd-store'
import exampleStore from '/stores/exampleStore' import exampleStore from '/stores/exampleStore'
import { queryAvailableMeetingRoomByTime, modifySchedule } from './../../api/request' import { queryAvailableMeetingRoomByTime, modifySchedule } from './../../api/request'
import { throttle } from './../../utils/utils.js' import { throttle } from './../../utils/utils.js'
import { observer } from '/utils/observer.js'
create.Page({ create.Page({
store: exampleStore, store: exampleStore,
useAll: true, useAll: true,
...@@ -12,13 +13,38 @@ create.Page({ ...@@ -12,13 +13,38 @@ create.Page({
repeatable: 0, repeatable: 0,
// 传递给组件selectPopup 的数据 // 传递给组件selectPopup 的数据
conSelectPopupData: { conSelectPopupData: {
selectPopupId: '',
showSelectPopup: false, showSelectPopup: false,
selectType: 'common', selectType: 'common',
editSaveList: [{ text: '仅保存此会议', id: 'only' }, { text: '保存此次及以后会议', id: 'future' }] editSaveList: [{ text: '仅保存此会议', id: 'only' }, { text: '保存此次及以后会议', id: 'future' }]
}, },
// 传递给组件centerPopup 的数据
centerPopup: {
showCenterPopup: false,
centerPopupList: [
{ id: 0, text: '不发送通知' },
{ id: 1, text: '发送通知' },
{ id: -1, text: '取消编辑' }
],
centerPopupId: ''
},
// 传递给组件toast的所有数据
conToastData: {
showToast: false,
title: '保存成功'
},
}, },
onLoad(e) { onLoad(e) {
if (e.scheduleItem) { if (e.scheduleItem) {
const _that = this
observer.register({
notice(scheduleItem) {
_that.setData({
'scheduleItem.scheduleTemplateId': scheduleItem
})
console.log(scheduleItem);
}
})
this.setData({ this.setData({
repeatable: e.repeatable, repeatable: e.repeatable,
scheduleItem: JSON.parse(e.scheduleItem) scheduleItem: JSON.parse(e.scheduleItem)
...@@ -43,7 +69,7 @@ create.Page({ ...@@ -43,7 +69,7 @@ create.Page({
this.store.data.roomId = '' this.store.data.roomId = ''
this.update() this.update()
if (!!this.data.scheduleItem) { if (!!this.data.scheduleItem) {
if (this.data.repeatable) { if (this.data.repeatable != 0) {
this.setData({ this.setData({
'conSelectPopupData.showSelectPopup': true 'conSelectPopupData.showSelectPopup': true
}) })
...@@ -58,6 +84,11 @@ create.Page({ ...@@ -58,6 +84,11 @@ create.Page({
modifyModel: 'only', modifyModel: 'only',
modifyContent: 'modify_location' modifyContent: 'modify_location'
} }
this.modifySchedule(data, 0).then(res => {
this.editLocationS()
}).catch(err => {
this.editLocationE()
})
} }
} else { } else {
dd.navigateBack({ dd.navigateBack({
...@@ -65,42 +96,128 @@ create.Page({ ...@@ -65,42 +96,128 @@ create.Page({
}) })
} }
}, },
onSelectPopup(event) { onSelectPopup(event) {
let data = { this.setData({
location: { 'conSelectPopupData.showSelectPopup': false,
longitude: -999, 'conSelectPopupData.selectPopupId': event.currentTarget.dataset.item.id,
latitude: -999, 'centerPopup.showCenterPopup': true
locationName: this.store.data.locationName })
}, },
meetingRoomId: this.store.data.roomId, // 选择发不发通知
modifyModel: event.currentTarget.dataset.item.id, onSelectSend(event) {
modifyContent: 'modify_location' this.setData({
'centerPopup.showCenterPopup': false
})
if (event.currentTarget.dataset.item.id > -1) {
let data = {
location: {
longitude: -999,
latitude: -999,
locationName: this.store.data.locationName
},
meetingRoomId: this.store.data.roomId,
modifyModel: this.data.conSelectPopupData.selectPopupId,
modifyContent: 'modify_location'
}
this.modifySchedule(data, event.currentTarget.dataset.item.id).then(res => {
this.editLocationS()
}).catch(err => {
this.editLocationE()
})
} else {
this.editLocationE(false)
}
},
// 修改地点成功
editLocationS() {
this.store.data.originalData.location.locationName = this.store.data.locationName
this.store.data.originalData.meetingRoomId = this.store.data.roomId
this.update()
dd.navigateBack({
delta: 1
})
},
// 修改地点失败
editLocationE(lock = true) {
this.store.data.locationName = this.store.data.originalData.location.locationName
this.store.data.roomId = this.store.data.originalData.meetingRoomId
this.update()
if (lock) {
this.setData({
'conToastData.showToast': true,
'conToastData.title': '网络异常'
})
} }
this.modifySchedule(data)
}, },
// 保存编辑 // 保存编辑
modifySchedule(data) { modifySchedule(data, needNotice = 0) {
let obj = { let obj = {
needNotice: needNotice,
scheduleId: this.data.scheduleItem.id, scheduleId: this.data.scheduleItem.id,
templateId: this.data.scheduleItem.scheduleTemplateId, templateId: this.data.scheduleItem.scheduleTemplateId,
planDate: this.data.scheduleItem.planDate planDate: this.data.scheduleItem.planDate
} }
modifySchedule(Object.assign(data, obj)).then(res => { return new Promise((resolve, rejects) => {
if (res.data.code === 0) { modifySchedule(Object.assign(data, obj)).then(res => {
dd.navigateBack({ if (res.data.code === 0) {
delta: 1 this.setData({
}) 'conToastData.showToast': true,
} 'conToastData.title': '保存成功'
})
if (this.store.data.originalData.repeatable === 1) {
observer.notice(res.data.data)
}
return resolve(res)
} else {
return rejects(res)
}
}).catch(err => {
return rejects(err)
})
})
},
// onSelectPopupCancel 点击取消
onSelectPopupCancel() {
this.setData({
'conSelectPopupData.showSelectPopup': false,
'centerPopup.showCenterPopup': false
}) })
this.editLocationE(false)
}, },
selectMeetingRoom(e) { selectMeetingRoom(e) {
this.store.data.locationName = e.target.dataset.locationName this.store.data.locationName = e.target.dataset.locationName
this.store.data.roomId = e.target.dataset.locationid this.store.data.roomId = e.target.dataset.locationid
this.update() this.update()
dd.navigateBack({ if (!!this.data.scheduleItem) {
delta: 1 if (this.data.repeatable != 0) {
}) this.setData({
'conSelectPopupData.showSelectPopup': true
})
} else {
let data = {
location: {
longitude: -999,
latitude: -999,
locationName: this.store.data.locationName
},
meetingRoomId: this.store.data.roomId,
modifyModel: 'only',
modifyContent: 'modify_location'
}
this.modifySchedule(data, 0).then(res => {
this.editLocationS()
}).catch(err => {
this.editLocationE()
})
}
} else {
dd.navigateBack({
delta: 1
})
}
}, },
inputPlace(event) { inputPlace(event) {
this.setData({ this.setData({
......
{ {
"usingComponents": { "usingComponents": {
"popup": "../../components/popup/index", "popup": "../../components/popup/index",
"centerpopup": "../../components/centerPopup/centerPopup",
"list": "../../components/list/list", "list": "../../components/list/list",
"hlist": "../../components/hList/hList", "hlist": "../../components/hList/hList",
"toast": "../../components/toast/toast", "toast": "../../components/toast/toast",
......
...@@ -4,12 +4,12 @@ class Store { ...@@ -4,12 +4,12 @@ class Store {
locationName: '', locationName: '',
participatorUserId: [], // 参会人的userId participatorUserId: [], // 参会人的userId
userList: [], userList: [],
aheadTimes: [],
roomId: '', roomId: '',
startTime: '', startTime: '',
endTime: '', endTime: '',
originUsers: [], originUsers: [],
originUsersId: [] originUsersId: [],
originalData: null,
} }
} }
export default new Store() export default new Store()
\ No newline at end of file
<template name="deleteBtn"> <template name="deleteBtn">
<view class="delete-task-wrap"> <view class="delete-task-wrap">
<view class="delete-task" onTap="handleDelete"> <view class="delete-task" onTap="delSheudle">
<text class="iconfont iconicon_noAgreed1"></text> <text class="iconfont iconicon_noAgreed1"></text>
{{title}} {{title}}
</view> </view>
</view> </view>
</template> </template>
\ No newline at end of file
class Observer {
register(a) {
if (this.array == null) {
this.array = [];
}
this.array.push(a);
}
unregister() {
this.array = []
}
notice(b) {
for (let x of this.array) {
x.notice(b);
}
}
}
let observer = new Observer()
export default { observer }
\ 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