Commit 98c23655 by liang ce
parents 7ca31239 5729d18a
......@@ -2,7 +2,6 @@ import { login } from './login'
export default function http (data) {
if (getApp().globalData.token !== '') {
return new Promise((resolve, rejects) => {
console.log(data)
dd.httpRequest({
headers: {
// "Content-Type": `${ data.method === 'POST' ? 'application/x-www-form-urlencoded' : 'application/json' }`,
......@@ -17,6 +16,7 @@ export default function http (data) {
resolve(res)
},
fail: function(res) {
rejects(res)
console.log(res)
}
})
......@@ -25,11 +25,9 @@ export default function http (data) {
return new Promise((resolve, rejects) => {
login().then(res => {
getApp().globalData.token = res.data.data.accessToken.access_token //'3a025eee-15ae-4805-9214-fe0599d47f17' //
// getApp().globalData.token = 'b1b2c5fd-1706-4c35-91ee-683b6397ad37' //'3a025eee-15ae-4805-9214-fe0599d47f17' //
// getApp().globalData.name = res.data.data.oapiUser.name
// getApp().globalData.userid = res.data.data.oapiUser.userid
// getApp().globalData.avatar = res.data.data.oapiUser.avatar
console.log(`${getApp().globalData.globalUrl}${data.url}`)
getApp().globalData.name = res.data.data.oapiUser.name
getApp().globalData.userid = res.data.data.oapiUser.userid
getApp().globalData.avatar = res.data.data.oapiUser.avatar
dd.httpRequest({
headers: {
"Content-Type": "application/json",
......
......@@ -170,3 +170,11 @@ export function getUserScheduleInTime (data) {
url: `/meet/schedule/getUserScheduleInTime`
})
}
// 获取日程详情
export function getScheduleDetail (data) {
return $http({
method: 'post',
data: JSON.stringify(data),
url: `/meet/schedule/getScheduleDetail`
})
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ App({
name: '',
// globalUrl:'https://gateway.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地址
// globalUrl:'http://192.168.1.102:9999' //beta地址
// 106,112,102
......
{
"pages": [
"pages/index/index",
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/scheduleDetail/scheduleDetail",
"pages/attendingSituation/attendingSituation",
"pages/createOrEditSchedule/createOrEditSchedule",
"pages/place/place",
"pages/participantsDetail/participantsDetail"
],
......
@import "../../font/iconfont.acss";
page {
background: #f6f6f6;
font-family: PingFangSC-Regular;
font-size: 30rpx;
color: #191F25;
padding-bottom: 128rpx;
}
.list {
background: #fff;
height: 112rpx;
line-height: 112rpx;
display: flex;
padding-left: 32rpx;
}
.headImg {
position: relative;
margin-right: 24rpx;
margin-top: 24rpx;
width: 64rpx;
height: 64rpx;
background: #3296FA;
border-radius: 50%;
color: white;
line-height: 64rpx;
text-align: center;
}
.headImg image {
vertical-align: middle;
width: 64rpx;
height: 64rpx;
border-radius: 50%;
}
.info {
width: 630rpx;
line-height: 112rpx;
height: 112rpx;
border-bottom: 1rpx solid rgba(25, 31, 37, 0.12);
}
.close {
position: absolute;
right: 32rpx;
color: #D8D8D8;
}
.button {
position: fixed;
bottom: 0;
display: flex;
margin-left: 32rpx;
padding-bottom: 32rpx;
background: white;
}
.button view {
width: 335rpx;
height: 96rpx;
border: 1px solid #3296FA;
border-radius: 48px;
text-align: center;
line-height: 96rpx;
font-size: 36rpx;
}
.add {
color: #0080FF;
margin-right: 16rpx;
}
.button .save {
color: white;
background: #3296FA;
border: 1px solid rgba(25, 31, 37, 0.12);
}
.tip {
text-align: center;
line-height: 20rpx;
width: 20rpx;
height: 20rpx;
border-radius: 50%;
background: #F25643;
position: absolute;
bottom: 4rpx;
right: -2rpx;
}
\ No newline at end of file
<view>
<view class="list">
<view class="headImg">
<image mode="scaleToFill" src=""/>
<text class="tip"></text>
<!-- <text >dddd</text> -->
</view>
<view class="info">
<text class="name">哈哈哈哈1</text>
</view>
</view>
<view class="list">
<view class="headImg">
<image mode="scaleToFill" src=""/>
<!-- <text >dddd</text> -->
</view>
<view class="info">
<text class="name">哈哈哈哈1</text>
</view>
</view>
<view class="list">
<view class="headImg">
<image mode="scaleToFill" src=""/>
<!-- <text >dddd</text> -->
</view>
<view class="info">
<text class="name">哈哈哈哈1</text>
</view>
</view>
</view>
\ No newline at end of file
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
create.Page({
store: exampleStore,
useAll: true,
data: {
},
onLoad() {
dd.setNavigationBar({
title: `参会人(${this.store.data.participatorList.length}人)`
})
},
});
......@@ -262,3 +262,6 @@ page {
color: rgba(25, 31, 37, 0.28);
}
.conflict {
margin-right: 10rpx;
}
......@@ -17,7 +17,7 @@
<view class="weekTime">
{{week1}}
</view>
<!-- <view class="line {{!!timeStaus ? 'selectLine' : ''}}"> -->
<!--<view class="line {{!!timeStaus ? 'selectLine' : ''}}"> -->
</view>
<view class="endTime {{timeStaus === '1' ? 'selectTime' : ''}}" data-timeStaus="1" onTap="selectTime">
<view class="timeContainer">
......@@ -43,8 +43,8 @@
<text>{{locationName}}</text>
<text class="iconshanchu iconfont" catchTap="closePlace"></text>
</view>
<text a:else>添加地点</text>
<text a:else>添加地点
</text>
</view>
</view>
<!-- 参会人 -->
......@@ -60,7 +60,7 @@
<image a:if="{{!!item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}"/>
<text a:else class="name">{{item.username.substring(item.username.length - 2, item.username.length)}}</text>
</text>
<text a:if={{conflictPeople.indexOf(item.userId)>-1}} class="conflictTip"></text>
<text a:if="{{conflictPeople.includes(item.userId)}}" class="conflictTip"></text>
</text>
</view>
<view class="addPeople iconfont icontianjia" onTap="addParticipants">
......@@ -71,10 +71,11 @@
</view>
</view>
<view class="tip">
<text class="noConflict" a:if="conflictPeope === []">
所有参与者都有空</text>
<text class="noConflict" a:if="{{!conflictPeople.length}}">
所有参与者都有空
</text>
<text class="conflict" a:else>
<text a:if="{{conflictPeople.indexOf(list.userId)>-1}}" a:for="{{participatorList}}" a:for-list="item">{{list.username}}</text> 会议冲突
<text class="conflict" a:if="{{conflictPeople.includes(item.userId)}}" a:for="{{participatorList}}" a:for-item="item">{{item.username}}</text> 会议冲突
</text>
</view>
</view>
......@@ -86,7 +87,9 @@
<view class="icon iconfont iconfont iconhuiqiantixing">
</view>
<view class="text">
<text>提前15分钟提醒</text>
<text>
提前15分钟提醒
</text>
<text class="close iconshanchu iconfont"></text>
</view>
</view>
......@@ -98,6 +101,4 @@
</view>
</view>
<mw-modal isShowModal="{{isShowModal}}" time="{{propsTime}}" onChange="changeSelectTime">
</mw-modal>
\ No newline at end of file
<!-- <mw-message visible="{true}" onDmMessageHide="onDmMessageHide" type="{{type}}" content="{{content}}" duration="800"></mw-message> -->
\ No newline at end of file
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
import { saveMettingRoom, getUserScheduleInTime } from '../../api/request'
import { addSchedule, getUserScheduleInTime, getHomeUserSchedule } from '../../api/request.js'
import { stringify } from 'querystring';
create.Page({
store: exampleStore,
useAll: true,
......@@ -13,12 +14,12 @@ create.Page({
time2: '',
week2: '',
propsTime: '',
conflictPeople: []
},
onLoad() {
this.store.data.conflictPeople = []
this.store.data.participatorList = []
this.store.data.locationName = ''
this.store.data.participatorUserId = []
this.store.data.participatorUserId = [getApp().globalData.userid]
this.update()
dd.setNavigationBar({
title: '创建会议'
......@@ -31,7 +32,6 @@ create.Page({
var w = weekList[date.getDay()];
var h = date.getHours()
var min = date.getMinutes();
console.log(h, min)
this.setData({
time1: `${y}/${m}/${d} ${h < 10 ? "0" + date.getHours() : date.getHours()}:${min < 30 ? '00' : '30'}`,
time2: `${y}/${m}/${d} ${min < 30 ? h < 10 ? "0" + date.getHours() : date.getHours() : (h + 1) < 10 ? "0" + (date.getHours() + 1) : date.getHours() + 1}:${min < 30 ? '30' : '00'}`,
......@@ -39,6 +39,13 @@ create.Page({
week2: w,
})
},
onShow() {
const _that = this
setTimeout(function () {
_that.update()
}, 100)
},
// 选择时间
selectTime(event) {
this.setData({
......@@ -49,8 +56,8 @@ create.Page({
},
// 选择时间组件回调
changeSelectTime(e) {
console.log(e)
if (e.status === 1) {
var date1 = new Date(e.time);
var weekList = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
var w1 = weekList[date1.getDay()];
......@@ -71,12 +78,15 @@ create.Page({
week1: w1,
week2: w2
})
this.conflict()
} else {
this.setData({
time1: e.time,
isShowModal: false,
week1: w1
})
this.conflict()
}
} else {
if (new Date(e.time).getTime() < new Date(this.data.time1).getTime()) {
......@@ -93,6 +103,7 @@ create.Page({
isShowModal: false,
week2: w1
})
this.conflict()
}
}
} else {
......@@ -124,7 +135,6 @@ create.Page({
res.users.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.headUrl })
_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)]
......@@ -137,9 +147,13 @@ create.Page({
},
// 跳转下一页
nextPage(event) {
let time = {
time1: this.data.time1,
time2: this.data.time2
}
switch (event.target.dataset.nextPage) {
case 'participantsDetail':
dd.navigateTo({ url: './../participantsDetail/participantsDetail' })
dd.navigateTo({ url: `./../participantsDetail/participantsDetail?time=${JSON.stringify(time)}` })
break;
case 'place':
dd.navigateTo({ url: './../place/place' })
......@@ -163,11 +177,11 @@ create.Page({
latitude: '10',
locationName: this.store.data.locationName || ''
},
startTime: `${this.data.time1.replace(/\//g,"-")}:00`,
endTime: `${this.data.time2.replace(/\//g,'-')} :00`,
startTime: `${this.data.time1.replace(/\//g, "-")}:00`,
endTime: `${this.data.time2.replace(/\//g, '-')}:00`,
scheduleType: 'common',
noticeType: 'dd_notice',
participatorList: this.store.participatorList,
participatorList: this.store.data.participatorList,
repeatable: 0,
aheadTimes: [],
recurrenceModel: {
......@@ -175,7 +189,7 @@ create.Page({
},
meetingRoomId: 222 || null
}
saveMettingRoom(data).then(res => {
addSchedule(data).then(res => {
dd.navigateBack({
delta: 1
})
......@@ -190,19 +204,19 @@ create.Page({
},
// 会议冲突
conflict() {
this.store.data.conflictPeople = []
let data = {
startTime: `${this.data.time1.replace(/\//g,"-")}:00`,
endTime: `${this.data.time2.replace(/\//g,"-")}:00`,
startTime: `${this.data.time1.replace(/\//g, "-")}:00`,
endTime: `${this.data.time2.replace(/\//g, "-")}:00`,
userIds: this.store.data.participatorUserId
}
getUserScheduleInTime(data).then(res => {
for(let value in res.data.data) {
if(res.data.data[value] === []) {
conflictPeople.push(value)
for (let value in res.data.data) {
if (!!res.data.data[value].length) {
this.store.data.conflictPeople.push(value)
}
}
this.update()
})
}
});
import create from 'dd-store'
import exampleStore from '/stores/exampleStore'
import { addSchedule, getUserScheduleInTime, getHomeUserSchedule } from '../../api/request.js'
create.Page({
store: exampleStore,
useAll: true,
time1: '',
time2: '',
data: {
},
onLoad() {
onLoad(event) {
console.log(JSON.parse(event.time))
this.setData({
time1: event.time1,
time2: event.time1
})
dd.setNavigationBar({
title: `参会人(${this.store.data.participatorList.length}人)`
})
......@@ -13,10 +21,7 @@ create.Page({
},
// 保存信息
saveInfo() {
dd.navigateBack({
delta: 1
})
this.conflict()
},
// 添加参会人
addParticipants() {
......@@ -66,7 +71,6 @@ create.Page({
dd.setNavigationBar({
title: `参会人(${this.store.data.participatorList.length}人)`
})
},
// 数组去重
setArrary(arr, userId) {
......@@ -77,4 +81,24 @@ create.Page({
}
return Object.values(containt)
},
// 会议冲突
conflict() {
this.store.data.conflictPeople = []
let data = {
startTime: `${this.data.time1}:00`,
endTime: `${this.data.time2}:00`,
userIds: this.store.data.participatorUserId
}
getUserScheduleInTime(data).then(res => {
for (let value in res.data.data) {
if (!!res.data.data[value].length) {
this.store.data.conflictPeople.push(value)
}
}
this.update()
dd.navigateBack({
delta: 1
})
})
}
});
......@@ -59,7 +59,12 @@ page {
max-width: 400rpx;
}
.scroll>image {
.scroll .imageGroup {
font-size: 24rpx;
color: #fff;
text-align: center;
line-height: 58rpx;
display: inline-block;
vertical-align: top;
border-radius: 50%;
width: 58rpx;
......
......@@ -4,21 +4,27 @@
<view class="icon icondidianmiaoshu iconfont">
</view>
<view class="text">
产品技术评估
{{title}}
</view>
</view>
<view class="place">
<view class="place" a:if="{{!!location.locationName}}">
<view class="icon icondingwei iconfont">
</view>
<view class="text">
西城广场星巴克
{{location.locationName}}
</view>
</view>
<view class="time">
<view class="icon iconshijian iconfont">
</view>
<view class="text">
01月29日 周三 09:00-10:00
<view class="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)}
`}}
</view>
<view class="text" a:else>
{{`${startTime.substring(5, 7)}月${startTime.substring(8, 10)}日 ${week} ${startTime.substring(11, 16)}-${endTime.substring(11, 16)}`}}
</view>
</view>
</view>
......@@ -26,14 +32,12 @@
<view class="icon iconcanhuiren1 iconfont">
</view>
<view class="scroll">
<image mode="scaleToFill" src=""/>
<image mode="scaleToFill" src=""/>
<image mode="scaleToFill" src=""/>
<image mode="scaleToFill" src=""/>
<image mode="scaleToFill" src=""/>
<image mode="scaleToFill" src=""/>
<image mode="scaleToFill" src=""/>
<image mode="scaleToFill" src=""/>
<text class="imageGroup" a:for="{{userList}}" a:for-item="item">
<text>
<image a:if="{{!!item.participator.headUrl}}" mode="scaleToFill" src="{{item.participator.headUrl}}"/>
<text a:else class="name">{{item.participator.username.substring(item.participator.username.length - 2, item.participator.username.length)}}</text>
</text>
</text>
</view>
<view class="right">
<text class="number">3人参与</text>
......@@ -81,6 +85,5 @@
<text class="icondidianmiaoshu iconfont"></text>
<text>编辑</text>
</view>
</view>
</view>
\ No newline at end of file
import { getScheduleDetail } from '../../api/request.js'
Page({
data: {},
data: {
title: '',
location: '',
startTime: '',
endTime: '',
weeks: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
week: '',
userList: [],
isAcrossDay: true
},
onLoad() {
dd.setNavigationBar({
title: '会议详情'
})
let data = {
id: '1172'
}
getScheduleDetail(data).then(res => {
this.setData({
title: res.data.data.title,
location: res.data.data.location,
startTime: res.data.data.startTime,
endTime: res.data.data.endTime,
userList: res.data.data.userList,
week: this.data.weeks[new Date(res.data.data.startTime).getDay()- 1]
})
this.acrossDay(res.data.data.startTime, res.data.data.endTime)
})
},
// 是否跨天
acrossDay(time1, time2) {
console.log(this.dealTime(time1))
console.log(this.dealTime(time2))
let isAcrossDay = ''
if (JSON.stringify(this.dealTime(time1)) === JSON.stringify(this.dealTime(time2))) {
isAcrossDay = false
} else {
isAcrossDay = true
}
this.setData({
isAcrossDay: isAcrossDay
})
},
// 处理时间
dealTime(time) {
let time1 = time.replace(/-/g,"/")
let date = new Date(time1)
let day = date.getDate()
let year = date.getFullYear()
let month = date.getMonth() + 1
return {
year: year,
month: month,
day: day
}
}
});
......@@ -2,6 +2,7 @@ class Store {
data = {
participatorList: [], // 参会人列表
locationName: '',
conflictPeople: [],
participatorUserId: [], // 参会人的userId
}
......
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