Commit 37291db4 by fengzhaoyu

暂存

parent f7df661b
......@@ -14,7 +14,7 @@ App({
avatar: '',
userid: '',
name: '',
// globalUrl:'https://gateway.mingwork.com', // 线上地址
// globalUrl:'https://gateway2.mingwork.com', // 线上地址
globalUrl:'https://gateway-beta.mingwork.com' //beta地址
// globalUrl:'http://139.196.213.18:9999' //beta地址
// globalUrl:'http://192.168.1.101:9999', //beta地址
......
{
"pages": [
"pages/index/index",
"pages/hhh/hhh",
"pages/createMeeting/createMeeting",
"pages/outLookContact/outLookContact",
"pages/uploadFile/uploadFile",
"pages/editFile/editFile",
"pages/place/place",
......
.comHList {
padding: 32rpx 32rpx 76rpx;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}
.comHList-item-image {
height: 84rpx;
line-height: 84rpx;
text-align: center
}
.comHList-item {
margin-top: 44rpx;
}
.comHList-item-image>image {
width: 84rpx;
height: 100%;
vertical-align: top;
}
.comHList-item-text {
font-family: PingFangSC-Medium;
font-size: 22rpx;
color: rgba(27, 38, 61, 0.56);
text-align: center;
margin-top: 22rpx;
}
\ No newline at end of file
<view class="comHList">
<view class="comHList-item" a:for="{{dataComList}}" catchTap="onSelectComHList" data-item="{{item}}">
<view class="comHList-item-image" >
<image mode="scaleToFill" src="{{item.imageUrl}}"/>
</view>
<view class="comHList-item-text">
{{item.text}}
</view>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {},
props: {},
didMount() { },
didUpdate() { },
didUnmount() { },
methods: {
onSelectComHList(event) {
this.props.onSelectComHList(event)
}
},
});
{
"component": true
}
\ No newline at end of file
.com-list {
padding: 62rpx 32rpx 84rpx;
}
.com-list-item:nth-child(1) {
margin-top: 0;
}
.com-list-item {
display: flex;
margin-top: 52rpx;
line-height: 46rpx;
}
.com-list-item>.iconfont {
width: 46rpx;
color: #1B263D;
font-size: 40rpx;
vertical-align: middle;
margin-right: 26rpx;
}
.com-list-item-text {
line-height: 46rpx;
font-size: 34rpx;
}
.com-list .com-list-item-selectStaus {
margin-left: auto;
color: #ffffff;
font-size: 40rpx;
}
.com-list .com-list-item-select {
color: #3070F2;
}
.com-list-item-image>image {
width: 46rpx;
height: 46rpx;
vertical-align: top;
margin-right: 34rpx;
}
\ No newline at end of file
{{isShow}}
<view class="com-list">
<view class=" com-list-item" catchTap="comSelectList" data-item="{{item}}" a:for="{{dataComList}}">
<view class="iconfont {{item.icon}}" a:if="{{iconType === 'icon'}}">
</view>
<view class="com-list-item-image" a:if="{{iconType === 'image'}}">
<image mode="scaleToFill" src="{{item.imageUrl}}"/>
</view>
<view class="com-list-item-text">
{{item.text}}
</view>
<view class="iconfont iconicon_ok com-list-item-selectStaus {{comSelectListId == item.id ? 'com-list-item-select' : ''}}">
</view>
</view>
</view>
\ No newline at end of file
Component({
mixins: [],
data: {
comSelectListId: ''
},
props: {
iconType: 'icon'
},
didMount() {
this.setData({
comSelectListId: this.props.comSelectListId || 0
})
},
didUpdate() { },
didUnmount() { },
methods: {
comSelectList(event) {
this.setData({
comSelectListId: event.currentTarget.dataset.item.id
})
this.props.onComSelectList(event)
}
},
});
{
"component": true
}
\ No newline at end of file
......@@ -71,7 +71,7 @@
}
.close-icon > .iconfont {
color: #291B263D;
color: #9599A2;
font-size: 64rpx;
}
......
{
"dependencies": {
"dd-store": "^1.8.3"
}
}
@import "../../assests/font/iconfont.acss";
page {
background: #fff;
font-family: PingFangSC-Regular;
font-size: 28rpx;
color: #030303;
}
.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
}
.conflict {
color: #FF943E;
font-size: 28rpx;
margin-left: 24rpx;
transform: scale(0.9);
transform-origin: left center;
}
.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;
overflow: hidden;
}
.headUrl>image {
vertical-align: top;
width: 100%;
height: 100%;
}
.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"/>
<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" onTap="showPopup" data-type="time">
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="conflict">
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>
<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">
<view class="button">
立即创建
</view>
</view>
<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>
<hlist a:if="{{'participator' === comType}}" dataComList="{{comHListData.contactData}}" 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>
</popup>
</view>
\ No newline at end of file
import { getHomeUserSchedule } 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: null, terminateTime: null, weekDayList: null } },
{ id: 2, text: '每周', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: null, terminateTime: null, weekDayList: null } },
{ id: 3, text: '每周的工作日', icon: '', repeatable: 1, recurrenceModel: { model: 'weekly', interval: 1, initialTime: null, terminateTime: null, weekDayList: ['MO', 'TU', 'WE', 'TH', 'FR', 'SA'] } },
{ id: 4, text: '每月', icon: '', repeatable: 1, recurrenceModel: { model: 'absoluteMonthly', interval: 1, initialTime: null, terminateTime: null, weekDayList: null } },
{ id: 5, text: '每年', icon: '', repeatable: 1, recurrenceModel: { model: 'absoluteYearly', interval: 1, initialTime: null, terminateTime: null, weekDayList: null } }
],
meetingWayList: [
{ id: 0, text: 'Webex meeting', imageUrl: '../../assests/Webex.png' },
{ id: 1, text: 'Zoom Meeting', imageUrl: '../../assests/Zoom.png' },
{ id: 2, text: '钉钉', imageUrl: '../../assests/dingding.png' }
],
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: '',
recurrenceModel: '',
isShowRemark: false,
repeatWeek: ['SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'],
popupTitle: '会议重复',
popupShow: false,
comType: '',
remark: '',
comTimeType: ''
},
showPop() {
this.setData({
show: true
})
},
closePop() {
this.setData({
show: false
})
},
Complete(data) {
console.log(data)
this.closePop();
},
onLoad() {
dd.setNavigationBar({
title: '创建会议'
})
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.locationName = ''
this.update()
},
// 跳转下一页
nextPage(event) {
switch (event.target.dataset.nextPage) {
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' })
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
})
}
},
// 关闭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':
// this.setData({
// comTimeType: true
// })
break
}
this.setData({
popupShow: true,
comType: event.currentTarget.dataset.type,
'comListData.iconType': iconType
})
},
// 选择完comList后的回调
selectComList(event) {
switch (this.data.comType) {
case 'meetingWayModel':
this.setData({
'comListData.meetingWayModelId': event.currentTarget.dataset.item.id,
popupShow: false
})
break;
case 'repeat':
let initialTime = '2020/03/18 16:00:00'
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({
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)
},
});
{
"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
......@@ -226,8 +226,6 @@ Page({
}
// 有日程长度,并且是今天
else if (value.scheduleList.length !== 0 && key === thisDay) {
console.log(key)
console.log(2222)
DateList.push({
type: 'today',
value: {
......@@ -286,7 +284,7 @@ Page({
},
nextPage() {
// isClicked(this)
dd.navigateTo({ url: './../createOrEditSchedule/createOrEditSchedule' })
dd.navigateTo({ url: './../createMeeting/createMeeting' })
},
nextDetail: throttle(function (e) {
console.log(11111111)
......
@import "../../assests/font/iconfont.acss";
page {
background: #fff;
}
.icon {
vertical-align: middle;
color: #1B263D;
font-size: 34rpx;
}
input {
caret-color: #3070F2;
padding-left: 0;
}
.addContact {
padding: 40rpx;
display: flex;
line-height: 1.5;
justify-content: space-between;
}
.addContact>input {
padding-left: 0;
width: 100%;
font-family: PingFangSC-Medium;
font-size: 40rpx;
}
.addContact>.icon {
color: #3070F2;
line-height: 58rpx;
}
.contactListItem {
border-top: 1rpx solid #F1F1F1;
height: 112rpx;
line-height: 112rpx;
padding: 0 40rpx;
display: flex;
align-items: center;
}
.contactListItem:last-child {
border-bottom: 1rpx solid #F1F1F1;
}
.contactImage {
color: #fff;
font-size: 28rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
width: 80rpx;
border-radius: 50%;
background-image: linear-gradient(224deg, #FFC672 0%, #FF943E 100%);
}
.contactText {
font-family: PingFangSC-Regular;
margin-left: 16rpx;
font-size: 34rpx;
color: #191F25;
}
.contactClose {
margin-left: auto;
color: #8E939D;
}
.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;
}
\ No newline at end of file
<view class="outLookContact">
<!-- 输入邮箱联系人 -->
<view class="addContact">
<input placeholder="请输入邮箱" focus="{{true}}" onInput="onInput" value="{{value}}" />
<view class="icon iconfont iconicon_add " onTap="addEmail">
</view>
</view>
<!-- 邮箱联系人列表 -->
<view class="contactList" >
<view class="contactListItem" a:for="{{outlookContact}}">
<view class="contactImage">
{{item.username.substring(0,2)}}
</view>
<view class="contactText">
{{item.username}}
</view>
<view class="contactClose icon iconfont iconicon_close" onTap="close" data-item="{{item}}">
</view>
</view>
</view>
<!-- 保存 -->
<view class="save" onTap="save">
<view class="button">
确认添加
</view>
</view>
</view>
\ No newline at end of file
import { getHomeUserSchedule } 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: {
outlookContact: [],
value: ''
},
onLoad() {
let outlookContact = this.data.outlookContact
for (let value of this.store.data.participatorList) {
if (value.platform === 'outlook') {
outlookContact.push(value)
}
}
this.setData({
outlookContact: outlookContact
})
},
onShow() {
},
// input 的输入 事件
onInput(event) {
this.setData({
value: event.detail.value
})
},
// 添加email
addEmail() {
let reg = /^\w+((.\w+)|(-\w+))@[A-Za-z0-9]+((.|-)[A-Za-z0-9]+).[A-Za-z0-9]+$/
if (reg.test(this.data.value)) {
let outlookContact = this.data.outlookContact
outlookContact.push({
userId: this.data.value,
username: this.data.value,
headUrl: '',
platform: 'outlook'
})
outlookContact = this.setArrary(outlookContact)
this.setData({
value: '',
outlookContact: outlookContact
})
} else {
dd.alert({
content: '请输入正确的邮箱格式',
buttonText: '确定'
})
}
},
// 关闭
close(event) {
let outlookContact = this.data.outlookContact
let index = 0
for (let value of this.data.outlookContact) {
if (value.userId === event.currentTarget.dataset.item.userId) {
outlookContact.splice(index, 1)
this.setData({
outlookContact: outlookContact
})
return
}
index++
}
},
// 数组 去重
setArrary(arr) {
let containt = {}
for (let x of arr) {
containt['id' + x.userId] = x
}
return Object.values(containt)
},
// 保存
save() {
// concat 拼接后生成新的数组 push 返回的是长度
this.store.data.participatorList.push(...this.data.outlookContact)
let participatorList = [{ userId: getApp().globalData.userid, username: getApp().globalData.name, headUrl: getApp().globalData.avatar, platform: 'dingtalk'}].concat(this.store.data.participatorList)
this.store.data.participatorList = this.setArrary(participatorList)
this.update()
dd.navigateBack({
delta: 1
})
}
});
{
"defaultTitle": "添加邮箱联系人"
}
\ No newline at end of file
......@@ -5,13 +5,7 @@ class Store {
conflictPeople: [],
participatorUserId: [], // 参会人的userId
userList: [],
// 重复 重复机制
repeatable:0,
recurrenceModel:{
model:"no_repeat",
},
editList: [{ icon: 'icondingwei', text: '地点' }, { icon: 'iconhuiqiantixing', text: '提醒' }, { icon: 'iconchongfu', text: '重复' }, { icon: 'icondidianmiaoshu', text: '描述' }, { icon: 'iconshanchu', text: '删除' }],
remark: '', // 会议描述
aheadTimes: [],
requireUserList: [],
startTime: '',
......
//防止多次重复点击 (函数节流)
export function throttle(fn, gapTime) {
console.log(222222,123)
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
......
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
dd-store@^1.8.3:
version "1.8.3"
resolved "https://registry.yarnpkg.com/dd-store/-/dd-store-1.8.3.tgz#b47f8b4d8f0c9a8c4429716788dd47b01dd15265"
integrity sha512-++BcwtpK0m57fAvv4bl9lc5Fc23TQCmLVQYgaBG2fKh2eY6WXURr6gg7crhAWiwEfFKa2waRE+ei4HHSSerYSw==
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