diff --git a/app.json b/app.json index 8548206..8cf42fe 100644 --- a/app.json +++ b/app.json @@ -1,6 +1,8 @@ { "pages": [ "pages/index/index", + "pages/editMeeting/editMeeting", + "pages/participantsDetail/participantsDetail", "pages/createMeeting/createMeeting", "pages/outLookContact/outLookContact", "pages/uploadFile/uploadFile", @@ -14,7 +16,6 @@ "pages/attendingSituation/attendingSituation", "pages/remind/remind", "pages/scheduleDetail/scheduleDetail", - "pages/participantsDetail/participantsDetail", "pages/createOrEditSchedule/createOrEditSchedule", "pages/attendeeList/attendeeList", "pages/meetingDetail/meetingDetail" diff --git a/components/list/list.js b/components/list/list.js index 852aa33..dcb8407 100644 --- a/components/list/list.js +++ b/components/list/list.js @@ -9,12 +9,12 @@ Component({ didMount() { console.log(this.props.comSelectListId) this.setData({ - comSelectListId: this.props.comSelectListId || 0 + comSelectListId: this.props.comSelectListId }) }, didUpdate() { this.setData({ - comSelectListId: this.props.comSelectListId || 0 + comSelectListId: this.props.comSelectListId }) }, didUnmount() { }, diff --git a/components/selectPopup/selectPopup.acss b/components/selectPopup/selectPopup.acss new file mode 100755 index 0000000..cb5ab3d --- /dev/null +++ b/components/selectPopup/selectPopup.acss @@ -0,0 +1,43 @@ +.selectPopup { + background: rgba(0, 0, 0, 0.12); + position: fixed; + top: 0; + height: 100vh; + width: 100%; +} + +.selectContent { + position: fixed; + bottom: 16rpx; + border-radius: 16rpx; + left: 16rpx; + right: 16rpx; + overflow: hidden; +} + +.selectPopupItem { + background: #fff; + height: 114rpx; + line-height: 112rpx; + text-align: center; + font-family: PingFangSC-Regular; + font-size: 34rpx; + color: #1B263D; + border-bottom: 1px solid rgba(25, 31, 37, 0.12); +} +.selectPopupItem:last-child { + border-bottom: none; + +} + +.selectPopupCancel { + border-radius: 16rpx; + height: 112rpx; + background: #fff; + line-height: 112rpx; + text-align: center; + font-family: PingFangSC-Regular; + font-size: 34rpx; + color: #1B263D; + margin-top: 16rpx; +} \ No newline at end of file diff --git a/components/selectPopup/selectPopup.axml b/components/selectPopup/selectPopup.axml new file mode 100644 index 0000000..9956379 --- /dev/null +++ b/components/selectPopup/selectPopup.axml @@ -0,0 +1,12 @@ +<view class="selectPopup" a:if="{{showSelectPopup}}" > + <view class="selectContent"> + <view class="selectPopupList"> + <view class="selectPopupItem" a:for="{{selectPopupList}}" data-item="{{item}}" catchTap="selectItem"> + {{item.text}} + </view> + </view> + <view class="selectPopupCancel" catchTap="selectPopupCancel"> + 取消 + </view> + </view> +</view> \ No newline at end of file diff --git a/components/selectPopup/selectPopup.js b/components/selectPopup/selectPopup.js new file mode 100644 index 0000000..2091e3c --- /dev/null +++ b/components/selectPopup/selectPopup.js @@ -0,0 +1,16 @@ +Component({ + mixins: [], + data: {}, + props: {}, + didMount() {}, + didUpdate() {}, + didUnmount() {}, + methods: { + selectPopupCancel() { + this.props.onSelectPopupCancel() + }, + selectItem(event) { + this.props.onSelectPopup(event) + } + }, +}); diff --git a/components/selectPopup/selectPopup.json b/components/selectPopup/selectPopup.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/components/selectPopup/selectPopup.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/components/toast/toast.axml b/components/toast/toast.axml index fca0679..7e0b60d 100644 --- a/components/toast/toast.axml +++ b/components/toast/toast.axml @@ -1,6 +1,6 @@ <view> <view class="toast" a:if="{{showToast}}"> - <text class="toastIcon iconfont iconcanjia3 "></text> - <text class="toasContent">回复成功</text> + <text class="toastIcon iconfont {{toastIcon}} "></text> + <text class="toasContent">{{title}}</text> </view> </view> \ No newline at end of file diff --git a/components/toast/toast.js b/components/toast/toast.js index d9544c9..0e8da30 100644 --- a/components/toast/toast.js +++ b/components/toast/toast.js @@ -3,10 +3,16 @@ Component({ data: { }, props: { - showToast: '', - duration: '' + showToast: false, + duration: 1000, + title: '保存成功', + toastIcon: 'iconcanjia3' + }, didMount() { + setTimeout(res => { + + }, this.props.duration) }, didUpdate(preProps, prevData) { }, diff --git a/pages/createMeeting/createMeeting.axml b/pages/createMeeting/createMeeting.axml index 2380c4a..d554cbd 100644 --- a/pages/createMeeting/createMeeting.axml +++ b/pages/createMeeting/createMeeting.axml @@ -35,8 +35,7 @@ <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)}`}} + {{`${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)}`}} @@ -65,11 +64,11 @@ <view> {{participatorList.length}}位参会人 </view> - <view class="conflictStatus"> - 3人会议安排冲突 + <view class="conflictStatus" a:if="{{conflictPeople.length}}"> + {{conflictPeople.length}}人会议安排冲突 </view> </view> - <view class="iconicon_open iconfont icon" style=" vertical-align: middle"></view> + <view class="iconicon_open iconfont icon" style=" vertical-align: middle" catchTap="nextPage" data-nextPage="participantsDetail"></view> </view> <view class="participatorListBottom"> <view class="people" a:for="{{participatorList.length > 10 ? [...participatorList].splice(0, 11) : participatorList}}"> @@ -78,7 +77,7 @@ <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 class="conflict iconicon_conflict iconfont" a:if="{{conflictPeople.includes(item.userId)}}"> </view> </view> <view class="name">{{item.name}}</view> diff --git a/pages/createMeeting/createMeeting.js b/pages/createMeeting/createMeeting.js index 69ce18d..781d34b 100644 --- a/pages/createMeeting/createMeeting.js +++ b/pages/createMeeting/createMeeting.js @@ -1,4 +1,4 @@ -import { addSchedule } from '../../api/request.js' +import { addSchedule, getUserScheduleInTime } from '../../api/request.js' import { throttle } from './../../utils/utils.js' import create from 'dd-store' import exampleStore from '/stores/exampleStore' @@ -31,7 +31,6 @@ create.Page({ { id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' } ] }, - // show: true, title: ``, repeatable: 0, recurrenceModel: { model: 'no_repeat' }, @@ -45,7 +44,8 @@ create.Page({ meetingWayModel: null, weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], week: '', - isAcrossDay: false + isAcrossDay: false, + conflictPeople: [] }, showPop() { @@ -71,6 +71,11 @@ create.Page({ }) this.reset() }, + onShow() { + if (this.store.data.participatorList.length > 1) { + this.conflictPeople() + } + }, // 添加描述 addRemark() { let isShowRemark = !this.data.isShowRemark @@ -107,7 +112,7 @@ create.Page({ 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.store.data.endTime = this.getTimes(new Date(this.getTimes()).setMinutes(new Date(this.store.data.startTime).getMinutes() + 30)) this.update() this.resetRepeatList() this.acrossDay(this.store.data.startTime, this.store.data.endTime) @@ -118,6 +123,9 @@ create.Page({ case 'location': dd.navigateTo({ url: './../place/place' }) break + case 'participantsDetail': + dd.navigateTo({ url: './../participantsDetail/participantsDetail' }) + break } }, // 所有的关闭操作 @@ -172,7 +180,7 @@ create.Page({ 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) + value.recurrenceModel.daysOfMonth = [this.store.data.startTime.replace(/\//g, "-").substring(8, 10)] } } repeatList.push(value) @@ -258,6 +266,8 @@ create.Page({ _that.store.data.participatorList = _that.setArrary(_that.store.data.participatorList) _that.store.data.participatorUserId = [...new Set(_that.store.data.participatorUserId)] _that.update() + _that.conflictPeople() + }, fail: function (err) { } @@ -295,6 +305,7 @@ create.Page({ this.setData({ popupShow: false }) + this.conflictPeople() }, addSchedule() { let data = { @@ -352,16 +363,20 @@ create.Page({ userIds.push(value.userId) } let data = { - startTime: this.store.data.startTime, - endTime: this.store.data.endTime, + startTime: this.store.data.startTime.replace(/\//g, "-"), + endTime: this.store.data.endTime.replace(/\//g, "-"), userIds: userIds } getUserScheduleInTime(data).then(res => { - + let conflictPeople = [] + for (let value in res.data.data) { + if (res.data.data[value].length > 0) { + conflictPeople.push(value) + } + } + this.setData({ + conflictPeople: conflictPeople + }) }) - - // for (let value of this.store.data.participatorList) { - // if() - // } } }); diff --git a/pages/editMeeting/editMeeting.acss b/pages/editMeeting/editMeeting.acss index 939d39e..f6c27fe 100644 --- a/pages/editMeeting/editMeeting.acss +++ b/pages/editMeeting/editMeeting.acss @@ -232,33 +232,104 @@ input { color: #BBBEC5; } -.save { +.delMetting { + 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; +} + +.delMetting>.iconfont { + margin-right: 18rpx; +} + +.footNav { 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; + border-top: 1rpx solid rgba(25, 31, 37, 0.12); + box-shadow: 1rpx 1rpx 4rpx 0 rgba(0, 0, 0, 0.08); +} + +.originStaus, .participateStatus, .noParticipateStatus { + display: flex; + line-height: 92rpx; + font-family: PingFangSC-Medium; + font-size: 28rpx; +} + +.originStaus>view, .participateStatus>view { + height: 92rpx; + line-height: 92rpx; + width: 49%; + text-align: center; +} + +.originStaus>view>.iconfont { + margin-right: 12rpx; + color: #A9ACB4; + vertical-align: middle; +} + +.line { + color: #E3E4E4; +} + +.participateStatus .remind { + width: 580rpx; +} + +.participateStatus .participate { + width: 168rpx; } -.button { +.remind { font-family: PingFangSC-Regular; - width: 686rpx; + font-size: 28rpx; + color: #1B263D; +} + +.remindTime { + margin: 0 20rpx; +} + +.participate>text { + margin-right: 10rpx; + color: #15BC83; +} + +.noParticipateStatus { + font-family: PingFangSC-Medium; + font-size: 14px; + color: #F25643; +} + +.noParticipateStatus { + justify-content: center; +} + +.noParticipateStatus>text { + margin-right: 10rpx; +} + +.footNavBottom { + border-top: 1rpx solid rgba(25, 31, 37, 0.12); + display: flex; + flex-direction: row-reverse; height: 96rpx; - background: #4D88FF; - border-radius: 48rpx; - font-size: 34rpx; - color: #FFFFFF; - text-align: center; line-height: 96rpx; + background: #fff; + color: #1B263D; } -/* .iconicon_add { - margin-left: -2rpx; - text-align: left; - vertical-align: middle; - font-size: 92rpx; -} */ \ No newline at end of file +.footNavBottom>.iconfont { + margin-right: 70rpx; + font-size: 40rpx; +} \ No newline at end of file diff --git a/pages/editMeeting/editMeeting.axml b/pages/editMeeting/editMeeting.axml index 2380c4a..9f08f20 100644 --- a/pages/editMeeting/editMeeting.axml +++ b/pages/editMeeting/editMeeting.axml @@ -1,4 +1,14 @@ -<view class="createMeeting"> +<view class="hideDetail" a:if="{{false}}"> + <view class="hideTitle"> + 设计分享会 + </view> + <view class="hideTime"> + 设计分享会 + </view> + <view class="hideIcon iconfont iconicon_expand"> + </view> +</view> +<view class="editeMeeting" a:else="{{true}}"> <!-- title remark 标题 描述 --> <view class="createTitle"> <view class="title"> @@ -7,7 +17,7 @@ </view> </view> <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" value="{{remark}}" /> </view> </view> <!-- roomId locationName 地点 --> @@ -65,11 +75,11 @@ <view> {{participatorList.length}}位参会人 </view> - <view class="conflictStatus"> - 3人会议安排冲突 + <view class="conflictStatus" a:if="{{conflictPeople.length}}"> + {{conflictPeople.length}}人会议安排冲突 </view> </view> - <view class="iconicon_open iconfont icon" style=" vertical-align: middle"></view> + <view class="iconicon_open iconfont icon" style=" vertical-align: middle" catchTap="nextPage" data-nextPage="participantsDetail"></view> </view> <view class="participatorListBottom"> <view class="people" a:for="{{participatorList.length > 10 ? [...participatorList].splice(0, 11) : participatorList}}"> @@ -78,7 +88,7 @@ <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 class="conflict iconicon_conflict iconfont" a:if="{{conflictPeople.includes(item.userId)}}"> </view> </view> <view class="name">{{item.name}}</view> @@ -103,10 +113,12 @@ </view> </view> </view> - <!-- 保存 --> - <view class="save" onTap="addSchedule"> - <view class="button"> - 立即创建 + <!-- 删除该会议 --> + <view class="delMetting"> + <view class=" iconfont iconicon_close"> + </view> + <view> + 删除该会议 </view> </view> <popup title="{{popupTitle}}" show="{{popupShow}}" mask="true" onClose="closePopup"> @@ -115,4 +127,23 @@ <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 +</view> +<!-- 底部导航栏 --> +<view class="footNav"> + <view class="footNavTop"> + <view class="originStaus"><view><text class="iconfont iconicon_share"></text><text>参加</text></view><text class="line">|</text><view><text class="iconfont iconicon_share"></text><text>不参加</text></view></view> + <!-- <view class="participateStatus"><view class="remind"><text class="iconfont iconicon_share"></text><text class="remindTime">提前15分钟提醒</text><text class="iconfont iconicon_share"></text></view><text class="line">|</text><view class="participate"><text class="iconfont iconicon_share"></text><text>参加</text></view></view> --> + <!-- <view class="noParticipateStatus"> + <text class="iconfont iconicon_share"></text> + <text>不参加</text> + </view> --> + </view> + <view class="footNavBottom"> + <view class="iconfont iconicon_share" onTap="uploadFile"> + </view> + <view class="iconfont iconicon_task"> + </view> + </view> +</view> +<toast showToast="{{showToast}}" onToastHidden=" onToastHidden"></toast> +<selectpopup showSelectPopup="{{conSelectPopupData.showSelectPopup}}" selectPopupList="{{conSelectPopupData.editSaveList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup> diff --git a/pages/editMeeting/editMeeting.js b/pages/editMeeting/editMeeting.js index d724dfa..ae34f4d 100644 --- a/pages/editMeeting/editMeeting.js +++ b/pages/editMeeting/editMeeting.js @@ -1,4 +1,4 @@ -import { addSchedule } from '../../api/request.js' +import { getScheduleDetail, getUserScheduleInTime, uploadPermissions } from '../../api/request.js' import { throttle } from './../../utils/utils.js' import create from 'dd-store' import exampleStore from '/stores/exampleStore' @@ -31,7 +31,15 @@ create.Page({ { id: 1, text: '手动添加邮箱', imageUrl: '../../assests/emailContact.png' } ] }, - // show: true, + // 传递给组件toast的所有数据 + conToastData: { + showToast: false + }, + // 传递给组件selectPopup 的数据 + conSelectPopupData: { + showSelectPopup: true, + editSaveList: [{text: '仅接受此会议', id: 'only'},{text: '接受所有会议', id: 'all'}] + }, title: ``, repeatable: 0, recurrenceModel: { model: 'no_repeat' }, @@ -45,7 +53,10 @@ create.Page({ meetingWayModel: null, weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], week: '', - isAcrossDay: false + conflictPeople: [], + isAcrossDay: false, + scheduleItem: '', + originalData: new Map() }, showPop() { @@ -62,14 +73,57 @@ create.Page({ console.log(data) this.closePop(); }, - onLoad() { + onLoad(event) { dd.setNavigationBar({ title: `会议详情` }) this.setData({ - title: `${getApp().globalData.name}创建的会议` + scheduleItem: JSON.parse(event.scheduleItem) + }) + this.getDetail() + }, + // 获取详情 + getDetail() { + let data = { + id: this.data.scheduleItem.id, + scheduleTemplateId: this.data.scheduleItem.scheduleTemplateId, + planDate: this.data.scheduleItem.planDate + } + getScheduleDetail(data).then(res => { + if (res.data.code === 0) { + let participatorList = [] + let repeatListMap = new Map() + for (let value of res.data.data.userList) { + participatorList.push(value.participator) + } + for (let item of this.data.comListData.repeatList) { + if (item.recurrenceModel.recurrenceModel !== 'weekly') { + repeatListMap.set(item.recurrenceModel.model, item.id) + } + } + // console.log(repeatListMap, 111) + this.setData({ + 'scheduleItem.id': res.data.data.id, + 'comListData.comSelectListId': res.data.data.recurrenceModel.model === 'weekly' ? (res.data.data.recurrenceModel.weekDayList.length > 1 ? 3 : 2) : repeatListMap.get(res.data.data.recurrenceModel.model), + 'comListData.meetingWayModelId': res.data.data.meetingWayModel === 'dingtalk' ? 2 : (res.data.data.meetingWayModel === 'zoom' ? 1 : 0), + repeatable: res.data.repeatable, + recurrenceModel: res.data.repeatable ? { model: res.data.data.recurrenceModel.model, daysOfMonth: res.data.data.recurrenceModel.daysOfMonth, interval: 1, initialTime: res.data.data.initialTime, terminateTime: res.data.data.terminateTime, weekDayList: res.data.data.weekDayList } : { model: 'no_repeat' }, + originalData: res.data.data, + title: res.data.data.title, + remark: res.data.data.remark, + isShowRemark: res.data.data.remark ? true : false, + week: this.data.weekList[new Date(res.data.data.startTime.replace(/'-'/g, "\/")).getDay()] + }) + this.store.data.locationName = res.data.data.location.locationName + this.store.data.roomId = res.data.data.meetingRoomId < 0 ? '' : res.data.data.meetingRoomId + this.store.data.startTime = res.data.data.startTime.replace(/'-'/g, "\/") + this.store.data.endTime = res.data.data.endTime.replace(/'-'/g, "\/") + this.store.data.participatorList = participatorList + this.update() + this.conflictPeople() + console.log(res.data.data) + } }) - this.reset() }, // 添加描述 addRemark() { @@ -118,6 +172,9 @@ create.Page({ case 'location': dd.navigateTo({ url: './../place/place' }) break + case 'participantsDetail': + dd.navigateTo({ url: `./../participantsDetail/participantsDetail?scheduleItem=${JSON.stringify(this.data.scheduleItem)}` }) + break } }, // 所有的关闭操作 @@ -258,6 +315,7 @@ create.Page({ _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) { } @@ -346,22 +404,80 @@ create.Page({ 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, + startTime: this.store.data.startTime.replace(/\//g, "-"), + endTime: this.store.data.endTime.replace(/\//g, "-"), userIds: userIds } getUserScheduleInTime(data).then(res => { + let conflictPeople = [] + for (let value in res.data.data) { + if (res.data.data[value].length > 1) { + conflictPeople.push(value) + } + } + this.setData({ + conflictPeople: conflictPeople + }) + }) + }, + // 文件上传 + uploadFile() { + let data = { + ddUserId: getApp().globalData.userid, + type: 'add', + projectName: 'MING_MEETING' + } + uploadPermissions(data).then(res => { + if (res.data.code === 0) { + const _that = this + dd.uploadAttachmentToDingTalk({ + image: { multiple: true, compress: true, max: 9, spaceId: res.data.data }, + space: { spaceId: res.data.data, compress: true, isCopy: 1, max: 9 }, + types: ["photo", "camera", "space"], + success: (res) => { + dd.navigateTo({ url: `./../uploadFile/uploadFile?scheduleItem=${JSON.stringify(_that.data.scheduleItem)}&upLoadInfo=${encodeURIComponent(JSON.stringify(res))}` }) + }, + fail: (err) => { + } + }) + } + }) + + }, + // toast 消失之后的回调 + onToastHidden () { + + }, + // onSelectPopup 选择完的回调 + onSelectPopup(event) { + console.log(event.currentTarget.dataset.item) + this.setData({ + 'conSelectPopupData.showSelectPopup': false + }) + }, + // onSelectPopupCancel 点击取消 + onSelectPopupCancel() { + this.setData({ + 'conSelectPopupData.showSelectPopup': false }) + }, + // 判断数据发生改变 发生改变 + isChange(value) { + switch (value) { + case 'title': + // if() + break + } - // for (let value of this.store.data.participatorList) { - // if() - // } } + + }); diff --git a/pages/editMeeting/editMeeting.json b/pages/editMeeting/editMeeting.json index 88652d0..97459c2 100644 --- a/pages/editMeeting/editMeeting.json +++ b/pages/editMeeting/editMeeting.json @@ -3,6 +3,8 @@ "popup": "../../components/popup/index", "list": "../../components/list/list", "hlist": "../../components/hList/hList", + "toast": "../../components/toast/toast", + "selectpopup": "../../components/selectPopup/selectPopup", "meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker" } } \ No newline at end of file diff --git a/pages/index/index.axml b/pages/index/index.axml index dcb823d..5640ec3 100644 --- a/pages/index/index.axml +++ b/pages/index/index.axml @@ -1,5 +1,5 @@ <!--<mw-select></mw-select> --> -版本号:151 版本 +版本号:151 版本 <view class="index"> <view a:if="{{startPageOnLoad&&startPageOnShow}}"> <scroll-view a:if="{{todayStr !== ''}}" scroll-y="{{true}}" upper-threshold="50" lower-threshold="50" onScrollToLower="lower" onScroll="onScroll" style="height: 100vh;" scroll-into-view="{{todayStr}}"> @@ -54,7 +54,7 @@ <text style="color: rgb(50, 150, 250)">{{item.value.day}}</text> </view> <view class="dataSchedule"> - <!-- <view class="thisDayLine thisDayHavaMeeting" style="margin-bottom: 7.5rpx"></view> --> + <!--<view class="thisDayLine thisDayHavaMeeting" style="margin-bottom: 7.5rpx"></view> --> <view a:for="{{item.value.value}}" a:for-item="item2" data-item="{{item2}}" class="{{ item2.isBeOverdue ? 'overdue' : item2.confirmAttendance === 0 ? 'cancel' : '' }}" onTap="nextDetail"> <view class="dataScheduleName"> <text>{{item2.title}}{{item2.isfirstDayOrEndDay ? `(第${item2.isFewDays}天,共${item2.duration}天)` : '' }}</text> @@ -82,7 +82,7 @@ <text>暂无日程安排,</text> <text onTap="nextPage">创建日程</text> </view> - <!-- <view class="thisDayLine"></view> --> + <!--<view class="thisDayLine"></view> --> </view> </view> </block> @@ -99,4 +99,4 @@ <text>快乐工作</text> </view> </view> -</view> \ No newline at end of file +</view> diff --git a/pages/index/index.js b/pages/index/index.js index e691ddb..aa164c4 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -287,9 +287,8 @@ Page({ dd.navigateTo({ url: './../createMeeting/createMeeting' }) }, nextDetail: throttle(function (e) { - console.log(11111111) let item = e.target.dataset.item - dd.navigateTo({ url: `./../scheduleDetail/scheduleDetail?scheduleItem=${JSON.stringify(item)}` }) + dd.navigateTo({ url: `./../editMeeting/editMeeting?scheduleItem=${JSON.stringify(item)}` }) }, 1000), // nextPage: throttle(function (e) { // console.log(11111111) diff --git a/pages/index/index.json b/pages/index/index.json index e120028..3620f12 100644 --- a/pages/index/index.json +++ b/pages/index/index.json @@ -1,3 +1,11 @@ { - "defaultTitle": "首页" -} + "defaultTitle": "首页", + "usingComponents": { + "popup": "../../components/popup/index", + "list": "../../components/list/list", + "hlist": "../../components/hList/hList", + "toast": "../../components/toast/toast", + "selectpopup": "../../components/selectPopup/selectPopup", + "meeting-time-picker": "../../components/meetingTimePicker/meetingTimePicker" + } +} \ No newline at end of file diff --git a/pages/participantsDetail/participantsDetail.acss b/pages/participantsDetail/participantsDetail.acss index e595155..416eb7c 100644 --- a/pages/participantsDetail/participantsDetail.acss +++ b/pages/participantsDetail/participantsDetail.acss @@ -1,8 +1,8 @@ -@import "../../font/iconfont.acss"; +@import "../../assests/font/iconfont.acss"; page { background: #f6f6f6; font-family: PingFangSC-Regular; - font-size: 30rpx; + font-size: 34rpx; color: #191F25; padding-bottom: 128rpx; } @@ -17,30 +17,30 @@ page { .headImg { margin-right: 24rpx; - margin-top: 24rpx; - width: 64rpx; - height: 64rpx; + margin-top: 16rpx; + width: 80rpx; + height: 80rpx; background: #3296FA; border-radius: 50%; color: white; - line-height: 64rpx; + line-height: 80rpx; text-align: center; position: relative; } .conflict { + line-height: 13px; + vertical-align: top; + width: 13px; + height: 13px; position: absolute; - width: 11px; - height: 11px; - line-height: 11px; - text-align: center; - color: #fff; - border: 1rpx solid #fff; - background: #f25643; - bottom: 3rpx; - right: -2rpx; + background: #fff; + bottom: 0rpx; + color: #FF943E; + font-size: 12px; + right: -3rpx; border-radius: 50%; - background: url(../../assests/chongtu.png) center / 100% 100% + text-align: center; } .headImg image { @@ -54,40 +54,36 @@ page { width: 630rpx; line-height: 112rpx; height: 112rpx; - border-bottom: 1rpx solid rgba(25, 31, 37, 0.12); + border-bottom: 1rpx solid #E3E4E4; +} + +.list:last-child .info { + border: none; } .close { position: absolute; right: 32rpx; - color: #D8D8D8; + color: #8E939D; + font-size: 0.3rem; } -.button { - padding: 24rpx 32rpx; - position: fixed; - bottom: 0; - display: flex; - background: white; -} - -.button view { - width: 335rpx; - height: 90rpx; - border: 1px solid #3296FA; - border-radius: 48px; +.addParticipants { + height: 100rpx; + line-height: 100rpx; + border-top: 1rpx solid #E3E4E4; + border-bottom: 1rpx solid #E3E4E4; + opacity: 0.56; + line-height: 100rpx; + font-family: PingFangSC-Regular; + font-size: 28rpx; + color: #0A0A0A; text-align: center; - line-height: 90rpx; - font-size: 36rpx; -} - -.add { - color: #0080FF; - margin-right: 16rpx; + background: #fff; } -.button .save { - color: white; - background: #3296FA; - border: 1px solid rgba(25, 31, 37, 0.12); +.iconicon_add { + color: #8E939D; + vertical-align: middle; + margin-right: 10rpx; } \ No newline at end of file diff --git a/pages/participantsDetail/participantsDetail.axml b/pages/participantsDetail/participantsDetail.axml index e2bbdd3..21f0e3d 100644 --- a/pages/participantsDetail/participantsDetail.axml +++ b/pages/participantsDetail/participantsDetail.axml @@ -3,19 +3,15 @@ <view class="headImg"> <image a:if="{{!!item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}"/> <text a:else>{{item.username.substring(0, 1)}}</text> - <text a:if="{{conflictPeople.includes(item.userId)}}" class="conflict"></text> + <text a:if="{{conflictPeople.includes(item.userId)}}" class="conflict iconicon_conflict iconfont"></text> </view> <view class="info"> <text class="name">{{item.username}}</text> - <text class="close iconshanchu-1 iconfont" a:if="{{!!scheduleItem?(organizer == permissions?(permissions!=item.userId):(permissions!=item.userId&&!requireUsers.includes(item.userId))):(permissions!=item.userId)}}" data-userId="{{item.userId}}" onTap="delParticipants"></text> + <text class="close iconicon_close iconfont" data-userId="{{item.userId}}" onTap="delParticipants"></text> </view> </view> - <view class="button"> - <view class="add" onTap="addParticipants"> - 添加参会人 - </view> - <view class="save" onTap="saveInfo"> - 完成 - </view> + <view class="addParticipants" onTap="addParticipants"> + <text class="iconfont iconicon_add " ></text> + <text>添加参会人</text> </view> </view> \ No newline at end of file diff --git a/pages/participantsDetail/participantsDetail.js b/pages/participantsDetail/participantsDetail.js index 57c0676..8fb0ca4 100644 --- a/pages/participantsDetail/participantsDetail.js +++ b/pages/participantsDetail/participantsDetail.js @@ -4,34 +4,15 @@ import { addSchedule, getUserScheduleInTime, getHomeUserSchedule } from '../../a create.Page({ store: exampleStore, useAll: true, - time1: '', - time2: '', data: { scheduleItem: '', - requireUsers: [], - organizer: '', - permissions: '', - requireUsersInfo: [] + conflictPeople: [] }, onLoad(event) { - let permissions = getApp().globalData.userid - let scheduleItem = JSON.parse(event.scheduleItem) - let organizer = event.organizer - let requireUsers = JSON.parse(event.requireUsers) - let requireUsersInfo = JSON.parse(event.requireUsersInfo) - this.setData({ - requireUsers: requireUsers, - organizer: organizer, - scheduleItem: scheduleItem, - time1: scheduleItem.startTime, - time2: scheduleItem.endTime, - permissions: permissions, - requireUsersInfo: requireUsersInfo - }) dd.setNavigationBar({ title: `参会人(${this.store.data.participatorList.length}人)` }) - this.conflict() + this.conflictPeople() }, // 保存信息 saveInfo() { @@ -44,18 +25,8 @@ create.Page({ const _that = this let require = [] let select = [] - if (!this.data.scheduleItem || this.data.organizer === getApp().globalData.userid) { - select = this.store.data.participatorUserId - require = [getApp().globalData.userid] - select.forEach((item, index) => { - if (item.userId == getApp().globalData.userid) { - select.splice(index, 1) - } - }) - } else { - select = [...this.store.data.participatorUserId] - require = [...this.data.requireUsers] - } + select = this.store.data.participatorUserId + require = [getApp().globalData.userid] select = _that.selectedelRequired(require, select).pickedUsers dd.complexChoose({ title: "选择参会人", //标题 @@ -64,31 +35,19 @@ create.Page({ requiredUsers: require, //必选用户(不可取消选中状态) responseUserOnly: true, //返回人,或者返回人和部门 success: function (res) { - if (!_that.data.scheduleItem || _that.data.organizer === getApp().globalData.userid) { - _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 }) - _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 }) - _that.store.data.participatorUserId.push(item.userId) - }) - } else { - _that.store.data.participatorList = [] - _that.store.data.participatorUserId = [] - _that.data.requireUsersInfo.forEach((item, index) => { - _that.store.data.participatorList.push({ userId: item.userId, username: item.username, headUrl: item.headUrl }) - _that.store.data.participatorUserId.push(item.userId) - }) - res.users.forEach((item, index) => { - _that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.avatar }) - _that.store.data.participatorUserId.push(item.userId) - }) - } + _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.conflict() _that.update() + _that.conflictPeople() + }, fail: function (err) { } @@ -114,7 +73,7 @@ create.Page({ dd.setNavigationBar({ title: `参会人(${this.store.data.participatorList.length}人)` }) - this.conflict() + this.conflictPeople() }, // 数组去重 setArrary(arr, userId) { @@ -126,27 +85,26 @@ create.Page({ return Object.values(containt) }, // 会议冲突 - conflict() { - this.store.data.conflictPeople = [] + conflictPeople() { + let userIds = [] + for (let value of this.store.data.participatorList) { + userIds.push(value.userId) + } let data = { - startTime: `${this.data.time1}`, - endTime: `${this.data.time2}`, - userIds: this.store.data.participatorUserId + startTime: this.store.data.startTime.replace(/\//g, "-"), + endTime: this.store.data.endTime.replace(/\//g, "-"), + userIds: userIds } getUserScheduleInTime(data).then(res => { + let conflictPeople = [] for (let value in res.data.data) { - if (!!this.data.scheduleItem) { - if (res.data.data[value].length > 1) { - this.store.data.conflictPeople.push(value) - } - } else { - if (res.data.data[value].length > 0) { - this.store.data.conflictPeople.push(value) - } + if (res.data.data[value].length > 0) { + conflictPeople.push(value) } - } - this.update() + this.setData({ + conflictPeople: conflictPeople + }) }) }, // 已选用户去中去掉必选用户 diff --git a/pages/uploadFile/uploadFile.axml b/pages/uploadFile/uploadFile.axml index ee206a7..1f62bc6 100644 --- a/pages/uploadFile/uploadFile.axml +++ b/pages/uploadFile/uploadFile.axml @@ -2,7 +2,7 @@ <view class="describe"> <textarea class="textarea" onInput="inputDes" placeholder="添加文件描述..." maxlength="-1" /> </view> - <view class="fileList" a:for="{{upLoadInfo.data}}"> + <view class="fileList" a:for="{{upLoadInfo.data}}" onTap="preview" data-file="{{item}}"> <view class="file"> <view class="fileimage {{item.fileType==('png' || 'PNG'|| 'jpg' || 'svg' || 'jpeg' || 'JPG') ?'image': item.fileType}}"> </view> @@ -18,7 +18,7 @@ <text class="addText">继续添加</text> </view> <view class="save"> - <view class="saveButton" onTap="save"> + <view class="saveButton" onTap="saveUpload"> 保存 </view> </view> diff --git a/pages/uploadFile/uploadFile.js b/pages/uploadFile/uploadFile.js index 1edb3f5..7978f96 100644 --- a/pages/uploadFile/uploadFile.js +++ b/pages/uploadFile/uploadFile.js @@ -8,8 +8,7 @@ create.Page({ data: { scheduleItem: '', upLoadInfo: '', - descript: '', - uploadSpaceId: '' + descript: '' }, onLoad(event) { let scheduleItem = JSON.parse(event.scheduleItem) @@ -44,51 +43,55 @@ create.Page({ }) }, add() { - let data1 = { + let data = { ddUserId: getApp().globalData.userid, type: 'add', projectName: 'MING_MEETING' } - uploadPermissions(data1).then(res => { - this.setData({ - uploadSpaceId: res.data.data - }) - const _that = this - dd.uploadAttachmentToDingTalk({ - image: { multiple: true, compress: false, max: 9, spaceId: this.data.uploadSpaceId }, - space: { spaceId: this.data.uploadSpaceId, max: 9 }, - file: { spaceId: this.data.uploadSpaceId, max: 9 }, - types: ["photo", "camera", "space"],//PC端仅支持["photo","file","space"] - success: (res) => { - _that.data.upLoadInfo.data.push(...res.data) - _that.setData({ - upLoadInfo: _that.data.upLoadInfo - }) - }, - fail: (err) => { - } - }) + uploadPermissions(data).then(res => { + if (res.data.code === 0) { + const _that = this + dd.uploadAttachmentToDingTalk({ + image: { multiple: true, compress: true, max: 9, spaceId: res.data.data }, + space: { spaceId: res.data.data, compress: true, isCopy: 1, max: 9 }, + types: ["photo", "camera", "space"], + success: (res) => { + _that.data.upLoadInfo.data.push(...res.data) + _that.setData({ + upLoadInfo: _that.data.upLoadInfo + }) + }, + fail: (err) => { + } + }) + } }) }, - // 点击保存 - save() { - if (!!this.data.scheduleItem.id) { - this.saveUpload(this.data.scheduleItem.id) - } else { - let getId = { - scheduleTemplateId: this.data.scheduleItem.scheduleTemplateId, - planDate: this.data.scheduleItem.planDate, - createModel: 'auto' - } - addSchedule(getId).then(success => { - this.saveUpload(success.data.data.id) - }) + // 文件预览 + preview(event) { + const _that = this + let file = event.target.dataset.file + let data = { + ddUserId: getApp().globalData.userid, + type: 'download', + fileIds: file.fileId, + projectName: 'MING_MEETING' } + previewPermissions(data).then(res => { + dd.previewFileInDingTalk({ + corpId: dd.corpId, + spaceId: res.data.data, + fileId: file.fileId, + fileName: file.fileName, + fileSize: file.fileSize, + fileType: file.fileType + }) + }) }, // 保存的接口 - saveUpload: throttle(function (id) { + saveUpload: throttle(function () { let data = { - scheduleId: id, + scheduleId: this.data.scheduleItem.id, uploader: getApp().globalData.userid, uploaderInfo: JSON.stringify({ userId: getApp().globalData.userid, @@ -100,6 +103,9 @@ create.Page({ descript: this.data.descript } saveFileInfo(data).then(res => { + dd.alert({ + content: JSON.stringify(data) + }) dd.navigateBack({ delta: 1 }) diff --git a/stores/exampleStore.js b/stores/exampleStore.js index 0ee2383..1c5a41c 100644 --- a/stores/exampleStore.js +++ b/stores/exampleStore.js @@ -12,10 +12,8 @@ class Store { } ], // 参会人列表 locationName: '', - conflictPeople: [], participatorUserId: [], // 参会人的userId userList: [], - editList: [{ icon: 'icondingwei', text: '地点' }, { icon: 'iconhuiqiantixing', text: '提醒' }, { icon: 'iconchongfu', text: '重复' }, { icon: 'icondidianmiaoshu', text: '描述' }, { icon: 'iconshanchu', text: '删除' }], aheadTimes: [], requireUserList: [], roomId: '',