Commit 01060816 by fengzhaoyu

11

parent 05dda8b2
...@@ -2,7 +2,6 @@ import { login } from './login' ...@@ -2,7 +2,6 @@ import { login } from './login'
export default function http (data) { export default function http (data) {
if (getApp().globalData.token !== '') { if (getApp().globalData.token !== '') {
return new Promise((resolve, rejects) => { return new Promise((resolve, rejects) => {
console.log(data)
dd.httpRequest({ dd.httpRequest({
headers: { headers: {
// "Content-Type": `${ data.method === 'POST' ? 'application/x-www-form-urlencoded' : 'application/json' }`, // "Content-Type": `${ data.method === 'POST' ? 'application/x-www-form-urlencoded' : 'application/json' }`,
...@@ -17,6 +16,7 @@ export default function http (data) { ...@@ -17,6 +16,7 @@ export default function http (data) {
resolve(res) resolve(res)
}, },
fail: function(res) { fail: function(res) {
rejects(res)
console.log(res) console.log(res)
} }
}) })
...@@ -25,10 +25,10 @@ export default function http (data) { ...@@ -25,10 +25,10 @@ export default function http (data) {
return new Promise((resolve, rejects) => { return new Promise((resolve, rejects) => {
login().then(res => { login().then(res => {
// getApp().globalData.token = res.data.data.accessToken.access_token //'3a025eee-15ae-4805-9214-fe0599d47f17' // // 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.token = '0a081219-f3ea-481c-a17d-19ea5b75da8d' //'3a025eee-15ae-4805-9214-fe0599d47f17' //
// getApp().globalData.name = res.data.data.oapiUser.name getApp().globalData.name = res.data.data.oapiUser.name
// getApp().globalData.userid = res.data.data.oapiUser.userid getApp().globalData.userid = res.data.data.oapiUser.userid
// getApp().globalData.avatar = res.data.data.oapiUser.avatar getApp().globalData.avatar = res.data.data.oapiUser.avatar
dd.httpRequest({ dd.httpRequest({
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
......
...@@ -159,7 +159,7 @@ export function addSchedule (data) { ...@@ -159,7 +159,7 @@ export function addSchedule (data) {
return $http({ return $http({
method: 'post', method: 'post',
data: JSON.stringify(data), data: JSON.stringify(data),
url: `/meet/schedule/addSchedule ` url: `/meet/schedule/addSchedule`
}) })
} }
// 获取参会会人员的日程 // 获取参会会人员的日程
...@@ -167,6 +167,6 @@ export function getUserScheduleInTime (data) { ...@@ -167,6 +167,6 @@ export function getUserScheduleInTime (data) {
return $http({ return $http({
method: 'post', method: 'post',
data: JSON.stringify(data), data: JSON.stringify(data),
url: `/meet/schedule/getUserScheduleInTime ` url: `/meet/schedule/getUserScheduleInTime`
}) })
} }
\ No newline at end of file
...@@ -16,6 +16,7 @@ App({ ...@@ -16,6 +16,7 @@ App({
name: '', name: '',
// globalUrl:'https://gateway.mingwork.com', // 线上地址 // globalUrl:'https://gateway.mingwork.com', // 线上地址
globalUrl:'https://gateway-beta.mingwork.com' //beta地址 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.101:9999', //beta地址
// globalUrl:'http://192.168.1.102:9999' //beta地址 // globalUrl:'http://192.168.1.102:9999' //beta地址
// 106,112,102 // 106,112,102
......
...@@ -262,3 +262,6 @@ page { ...@@ -262,3 +262,6 @@ page {
color: rgba(25, 31, 37, 0.28); color: rgba(25, 31, 37, 0.28);
} }
.conflict {
margin-right: 10rpx;
}
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<image a:if="{{!!item.headUrl}}" mode="scaleToFill" src="{{item.headUrl}}"/> <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 a:else class="name">{{item.username.substring(item.username.length - 2, item.username.length)}}</text>
</text> </text>
<text a:if={{conflictPeople.indexOf(item.userId)>-1}} class="conflictTip"></text> <text a:if="{{conflictPeople.includes(item.userId)}}" class="conflictTip"></text>
</text> </text>
</view> </view>
<view class="addPeople iconfont icontianjia" onTap="addParticipants"> <view class="addPeople iconfont icontianjia" onTap="addParticipants">
...@@ -71,10 +71,10 @@ ...@@ -71,10 +71,10 @@
</view> </view>
</view> </view>
<view class="tip"> <view class="tip">
<text class="noConflict" a:if="conflictPeope === []"> <text class="noConflict" a:if="{{conflictPeope === []}}">
所有参与者都有空</text> 所有参与者都有空</text>
<text class="conflict" a:else> <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> </text>
</view> </view>
</view> </view>
...@@ -86,7 +86,8 @@ ...@@ -86,7 +86,8 @@
<view class="icon iconfont iconfont iconhuiqiantixing"> <view class="icon iconfont iconfont iconhuiqiantixing">
</view> </view>
<view class="text"> <view class="text">
<text>提前15分钟提醒</text> <text>提前15分钟提醒 {{conflictPeople.length}}
</text>
<text class="close iconshanchu iconfont"></text> <text class="close iconshanchu iconfont"></text>
</view> </view>
</view> </view>
...@@ -100,4 +101,5 @@ ...@@ -100,4 +101,5 @@
<mw-modal isShowModal="{{isShowModal}}" time="{{propsTime}}" onChange="changeSelectTime"> <mw-modal isShowModal="{{isShowModal}}" time="{{propsTime}}" onChange="changeSelectTime">
</mw-modal> </mw-modal>
<!-- <mw-message visible="{true}" onDmMessageHide="onDmMessageHide" type="{{type}}" content="{{content}}" duration="800"></mw-message> --> <!-- <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 create from 'dd-store'
import exampleStore from '/stores/exampleStore' import exampleStore from '/stores/exampleStore'
import { saveMettingRoom, getUserScheduleInTime } from '../../api/request' // import { addSchedule, getUserScheduleInTime, getHomeUserSchedule } from '../../api/request.js'
import { getHomeUserSchedule } from '../../api/request.js'
import { stringify } from 'querystring';
create.Page({ create.Page({
store: exampleStore, store: exampleStore,
useAll: true, useAll: true,
...@@ -13,12 +16,26 @@ create.Page({ ...@@ -13,12 +16,26 @@ create.Page({
time2: '', time2: '',
week2: '', week2: '',
propsTime: '', propsTime: '',
conflictPeople: []
}, },
onLoad() { onLoad() {
let data = {
"startTime":"2020-01-01 00:00:00",
"endTime":"2025-12-30 23:59:59"
}
try {
getHomeUserSchedule(data).then(res => {
console.log(res)
}).catch(err => {
console.log(111)
})
}catch(e){
dd.alert({content: e})
}
this.store.data.conflictPeople = []
this.store.data.participatorList = [] this.store.data.participatorList = []
this.store.data.locationName = '' this.store.data.locationName = ''
this.store.data.participatorUserId = [] this.store.data.participatorUserId = [getApp().globalData.userid]
this.update() this.update()
dd.setNavigationBar({ dd.setNavigationBar({
title: '创建会议' title: '创建会议'
...@@ -39,6 +56,13 @@ create.Page({ ...@@ -39,6 +56,13 @@ create.Page({
week2: w, week2: w,
}) })
}, },
onShow() {
const _that = this
setTimeout(function () {
_that.update()
}, 100)
},
// 选择时间 // 选择时间
selectTime(event) { selectTime(event) {
this.setData({ this.setData({
...@@ -71,6 +95,7 @@ create.Page({ ...@@ -71,6 +95,7 @@ create.Page({
week1: w1, week1: w1,
week2: w2 week2: w2
}) })
} else { } else {
this.setData({ this.setData({
time1: e.time, time1: e.time,
...@@ -124,7 +149,6 @@ create.Page({ ...@@ -124,7 +149,6 @@ create.Page({
res.users.forEach((item, index) => { res.users.forEach((item, index) => {
_that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.headUrl }) _that.store.data.participatorList.push({ userId: item.userId, username: item.name, headUrl: item.headUrl })
_that.store.data.participatorUserId.push(item.userId) _that.store.data.participatorUserId.push(item.userId)
}) })
_that.store.data.participatorList = _that.setArrary(_that.store.data.participatorList) _that.store.data.participatorList = _that.setArrary(_that.store.data.participatorList)
_that.store.data.participatorUserId = [...new Set(_that.store.data.participatorUserId)] _that.store.data.participatorUserId = [...new Set(_that.store.data.participatorUserId)]
...@@ -163,11 +187,11 @@ create.Page({ ...@@ -163,11 +187,11 @@ create.Page({
latitude: '10', latitude: '10',
locationName: this.store.data.locationName || '' locationName: this.store.data.locationName || ''
}, },
startTime: `${this.data.time1.replace(/\//g,"-")}:00`, startTime: `${this.data.time1.replace(/\//g, "-")}:00`,
endTime: `${this.data.time2.replace(/\//g,'-')} :00`, endTime: `${this.data.time2.replace(/\//g, '-')}:00`,
scheduleType: 'common', scheduleType: 'common',
noticeType: 'dd_notice', noticeType: 'dd_notice',
participatorList: this.store.participatorList, participatorList: this.store.data.participatorList,
repeatable: 0, repeatable: 0,
aheadTimes: [], aheadTimes: [],
recurrenceModel: { recurrenceModel: {
...@@ -175,7 +199,7 @@ create.Page({ ...@@ -175,7 +199,7 @@ create.Page({
}, },
meetingRoomId: 222 || null meetingRoomId: 222 || null
} }
saveMettingRoom(data).then(res => { getHomeUserSchedule(data).then(res => {
dd.navigateBack({ dd.navigateBack({
delta: 1 delta: 1
}) })
...@@ -191,18 +215,19 @@ create.Page({ ...@@ -191,18 +215,19 @@ create.Page({
// 会议冲突 // 会议冲突
conflict() { conflict() {
let data = { let data = {
startTime: `${this.data.time1.replace(/\//g,"-")}:00`, startTime: `${this.data.time1.replace(/\//g, "-")}:00`,
endTime: `${this.data.time2.replace(/\//g,"-")}:00`, endTime: `${this.data.time2.replace(/\//g, "-")}:00`,
userIds: this.store.data.participatorUserId userIds: this.store.data.participatorUserId
} }
getUserScheduleInTime(data).then(res => { getUserScheduleInTime(data).then(res => {
for(let value in res.data.data) { for (let value in res.data.data) {
if(res.data.data[value] === []) { if (!!res.data.data[value].length) {
conflictPeople.push(value) this.store.data.conflictPeople.push(value)
} }
} }
this.update()
}).catch(err => {
dd.alert({content:'1'})
}) })
} }
}); });
...@@ -2,6 +2,7 @@ class Store { ...@@ -2,6 +2,7 @@ class Store {
data = { data = {
participatorList: [], // 参会人列表 participatorList: [], // 参会人列表
locationName: '', locationName: '',
conflictPeople: [],
participatorUserId: [], // 参会人的userId 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