Commit 9b1d8ba2 by xiexiaoqin

Merge branch 'dev' into release/1.0.0

parents c74d8633 b2658c6e
......@@ -18,6 +18,7 @@ export default async function login() {
method: 'POST',
dataType: 'json',
success: function (res) {
if (res.data.code == 0) {
const { oapiUser } = res.data.data;
getApp().globalData.token = res.data.data.accessToken.access_token;
getApp().globalData.name = res.data.data.oapiUser.name;
......@@ -31,18 +32,20 @@ export default async function login() {
});
lock = false;
resolve(res)
} else {
lock = false;
reject(res.data);
}
},
fail: function (err) {
lock = false;
reject(err);
console.log('err:' + err);
}
})
},
fail: function (err) {
lock = false;
reject(err);
console.log('fail:' + err);
}
})
})
......@@ -51,7 +54,6 @@ export default async function login() {
async function waitLockRelease(retry) {
for (let i = 0; i < retry; i++) {
if (lock == false) {
console.log(i);
return;
}
await sleep(100);
......
......@@ -138,7 +138,13 @@ export function isParticipate(data) {
url: `/meet/schedule/confirm`
});
}
//会议室详情的获取重复会议动态列表
export function getMeetingRoomRepeatAffairs(groupId, page) {
return $http({
method: "get",
url: `/meet/meeting-log/scheduleTemplateMeetingLogPage?groupId=${groupId}&size=10&current=${page}`
});
}
//会议室详情的获取动态列表
export function getMeetingRoomAffairs(id) {
return $http({
......
import login from "./login";
export default function xFetch({ url, method, data, type }) {
if (type == 'binding') {
url = `${getApp().globalData.globalUrl2}${url}`
......@@ -14,23 +16,38 @@ export default function xFetch({ url, method, data, type }) {
method: method,
dataType: "json",
data: data,
// timeout: 280,
timeout: 15000,
success: function (res) {
if (res.data.code == 0) {
resolve(res);
} else {
rejects(res);
dd.alert({
content: res.data.msg || "请求数据异常",
buttonText: "确定"
});
if (res.data.code == 401) {
login();
}
alertOnce(res.data.msg || '请求异常,请重试', rejects);
}
},
fail: function (err) {
rejects({ refresh: true });
if (err && err.status == 401) {
login();
}
alertOnce('网络异常,请重试', rejects);
}
});
});
}
let alert = false;
function alertOnce(content, rejects) {
if (alert == false) {
dd.alert({
content: content,
buttonText: "确定",
success: () => {
rejects({ refresh: true });
alert = false;
}
});
}
alert = true;
}
\ No newline at end of file
......@@ -11,3 +11,13 @@ view {
.addPaddingBottom {
padding-bottom: 68rpx;
}
.btn {
font-size: 32rpx;
height: 72rpx;
line-height: 72rpx;
border-radius: 48rpx;
text-align: center;
color: #fff;
background: rgba(234, 12, 40, 1);
}
\ No newline at end of file
......@@ -2,6 +2,7 @@ import { setGlobalStore } from "dd-store";
import exampleStore from "./stores/exampleStore";
setGlobalStore(exampleStore);
import login from "./api/login";
import { globalUrl, globalUrl2 } from './config';
App({
onLaunch(options) {
......@@ -20,9 +21,7 @@ App({
userid: "",
name: "",
userInfo: "",
// globalUrl: "https://gateway-beta.mingwork.com", //beta地址
// globalUrl2: "https://third-authentication-beta.mingwork.com"
globalUrl: "https://gateway2.mingwork.com", // 线上地址
globalUrl2: "https://third-authentication.mingwork.com" //线上地址
globalUrl: globalUrl,
globalUrl2: globalUrl2
}
});
......@@ -2,7 +2,7 @@
<view class="sidebarContent" catchTap="preventSort">
<view class="sidebarLogo">
<template is="avater" data="{{item: userInfo}}"/>
<view>{{ userInfo.userName }}</view>
<view>{{ userInfo.username }}</view>
</view>
<view class="hasAssociated" a:if="{{relatedAppList.length !== 1}}">
<view class="associated">
......
......@@ -34,6 +34,11 @@
font-size: 34rpx;
}
.iconicon_attender {
position: relative;
top: 6rpx;
}
.participator-title {
color: rgba(25, 31, 37, 1);
font-size: 34rpx;
......
export const globalUrl = "https://gateway-beta.mingwork.com";
export const globalUrl2 = "https://third-authentication-beta.mingwork.com";
\ No newline at end of file
......@@ -63,10 +63,19 @@
justify-content: center;
}
.loadingToast view {
.loadingToast>view {
font-size: 28rpx;
color: #FFFFFF;
padding: 18rpx 26rpx;
border-radius: 40rpx;
background: rgba(0, 0, 0, .59)
background: rgba(0, 0, 0, .59);
display: flex;
justify-content: center;
align-items: center;
}
.loadingToast image {
width: 36rpx;
height: 36rpx;
margin-right: 8rpx;
}
\ No newline at end of file
......@@ -34,8 +34,23 @@
</view>
</view>
<view class="loadingToast" a:if="{{isLoading}}">
<view a:if="{{bindStatus==='loading'}}">
<image class="fix-img-width-fix" mode="scaleToFill" src="./../../assests/bindLoading.gif"/>
<view>
账号关联中···
</view>
</view>
<view a:elif="{{bindStatus==='success'}}">
<image class="fix-img-width-fix" mode="scaleToFill" src="./../../assests/bindSuccess.png"/>
<view>
关联成功
</view>
</view>
<view a:else>
<image class="fix-img-width-fix" mode="scaleToFill" src="./../../assests/bindFail.png"/>
<view>
关联失败
</view>
</view>
</view>
<selectpopup showSelectPopup="{{showSelectPopup}}" selectPopupList="{{selectPopupList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
\ No newline at end of file
......@@ -7,6 +7,7 @@ import {
import "dingtalk-jsapi/entry/mobile";
import openLink from "dingtalk-jsapi/api/biz/util/openLink";
import create from "dd-store";
import { fail } from "assert";
let interval = "";
let requestNum = 0;
create.Page({
......@@ -18,7 +19,8 @@ create.Page({
isBind: false,
isLoading: false,
showSelectPopup: false,
selectPopupList: [{ text: "取消关联" }]
selectPopupList: [{ text: "取消关联" }],
bindStatus: "loading"
},
onLoad(e) {
this.setData({
......@@ -31,12 +33,17 @@ create.Page({
sendRequest() {
let that = this;
interval = setInterval(() => {
if (requestNum >= 300) {
if (requestNum >= 180) {
requestNum = 0;
that.setData({
isBind: false,
bindStatus: "fail"
});
setTimeout(() => {
that.setData({
isLoading: false
});
}, 2000);
clearInterval(interval);
}
requestNum++;
......@@ -47,8 +54,13 @@ create.Page({
this.setData({
name: item.userName,
isBind: true,
bindStatus: "success"
});
setTimeout(() => {
that.setData({
isLoading: false
});
}, 2000);
clearInterval(interval);
this.$store.data.relatedAppNeedUpdate = true;
this.update();
......@@ -62,7 +74,8 @@ create.Page({
return false;
}
this.setData({
isLoading: true
isLoading: true,
bindStatus: "loading"
});
this.sendRequest();
if (this.data.platform === "outlook") {
......
@import "../../template/loading/loading.acss";
@import "../../template/affairBlank/index.acss";
@import "../../template/fullScreen/fullScreen.acss";
@import "../../template/refresh/index.acss";
.dynamicBox {
width: 100%;
overflow: hidden;
......@@ -9,6 +10,10 @@
height: 100vh;
}
.dynamicBox_add_padding {
padding-bottom: 188rpx;
}
.dynamicList {
width: 100%;
}
......@@ -100,6 +105,7 @@
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.scroll-lock {
......
<import src="../../template/loading/loading.axml"/>
<import src="../../template/fullScreen/fullScreen.axml"/>
<view a:if='{{refresh}}' onTap="onLoad">连接超时,请重试,刷新按钮</view>
<import src="../../template/refresh/index.axml"/>
<template is="refresh" a:if='{{refresh}}' ></template>
<block a:else>
<view hidden="{{$data.tabBarIndex === '1'}}">
<import src="../../template/affairBlank/index.axml"/>
<view class="{{isStopBodyScroll ? 'scroll-lock' : ''}}" onTap="closeSwipe" onTouchStart="closeSwipe" onTouchMove="closeSwipe" onTouchEnd="closeSwipe">
<block a:if="{{!listLoading}}">
<scroll-view a:if="{{dynamicList.length > 0}}" scroll-y="{{true}}" lower-threshold="{{400}}" class="dynamicBox" onScrollToLower="onScrollToLower">
<scroll-view a:if="{{dynamicList.length > 0}}" scroll-y="{{true}}" lower-threshold="{{400}}" class="dynamicBox {{isIPX ? 'dynamicBox_add_padding' : ''}}" onScrollToLower="onScrollToLower">
<view class="dynamicList">
<swipe onSetBodyDisableScroll="setBodyDisableScroll" rightWidth="{{ 78 }}" leftWidth="{{ 0 }}" a:for="{{dynamicList}}" class="dynamicContent" key="{{item.scheduleId}}">
<view class="dynamicDetails">
......
......@@ -29,6 +29,7 @@ import create from "dd-store";
let maxClickCount = 5;
create.Page({
data: {
sign: '',
refresh: false,
$data: null,
iconDay: currentDate.getDate(),
......@@ -61,6 +62,7 @@ create.Page({
maxYear: maxYear,
todayIndex: 0,
onShow() {
//如果是重复会议重新算
if (this.$store.data.indexNeedUpdate) {
dd.setNavigationBar({
......@@ -84,13 +86,25 @@ create.Page({
this.$store.data.isIndexAffairListNeedUpdate = false;
this.update();
}
//开启一个定时器
this.timer = setInterval(() => {
this.getData()
}, 30000)
},
onHide() {
clearInterval(this.timer);
this.timer = null;
},
onLoad(event) {
if (JSON.stringify(event) != "{}") {
refresh() {
this.onLoad()
},
onLoad(query) {
console.log(query);
if (query && JSON.stringify(query) !== '{}') {
this.setData({
listLoading: false
});
const scheduleItem = JSON.parse(Object.keys(event)[0].split("=")[1]);
const scheduleItem = JSON.parse(Object.keys(query)[0].split("=")[1]);
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${encodeURIComponent(
JSON.stringify(scheduleItem)
......@@ -184,11 +198,11 @@ create.Page({
callBack();
}
}).catch(err => {
// if (err && err.refresh) {
// this.setData({
// refresh: true
// })
// }
if (err && err.refresh) {
this.setData({
refresh: true
})
}
});
},
//动态置顶
......@@ -289,7 +303,23 @@ create.Page({
startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59"
}).then(res => {
//是否刷新页面
if (this.data.sign && res.data.data.sign !== this.data.sign) {
DateMap = getDateMap(this.minYear, this.maxYear);
}
if (res.data.data.sign !== this.data.sign) {
this.getScheduleList(res.data.data);
}
this.setData({
sign: res.data.data.sign
})
}).catch(err => {
if (err && err.refresh) {
this.setData({
refresh: true
})
}
});
},
//生成DateMap值
......@@ -780,7 +810,7 @@ create.Page({
maxClickCount--;
if (maxClickCount == 0) {
dd.alert({
content: "0.0.10"
content: "0.0.12"
});
maxClickCount = 5;
}
......
......@@ -2,6 +2,7 @@
.affair-list {
background: #fff;
padding: 48rpx 32rpx 220rpx 32rpx;
/* height: calc(100vh - 200rpx); */
}
.affair-list-margin-top {
......@@ -113,6 +114,7 @@ page {
background: #fff;
z-index: 1;
position: relative;
width: 100%;
padding-bottom: 0;
}
......@@ -614,3 +616,13 @@ input {
.lineThrough {
text-decoration: line-through;
}
.loading-more {
color: rgba(234, 12, 40, 1);
font-size: 24rpx;
text-align: center;
width: 400rpx;
border-top: 1px solid rgba(239, 242, 245, 1);
padding-top: 32rpx;
margin: 0 auto 50rpx;
}
\ No newline at end of file
......@@ -205,7 +205,7 @@
<view class="affair-list {{isExpand? '' : 'affair-list-margin-top'}} {{!isExpand&&$data.participatorList.length>1 ? 'addPadding' : ''}}" onTap="hideFileOperate">
<view a:if="{{!isExpand}}" class="affair-list-title">会议动态</view>
<block a:if="{{!affairLoading}}">
<block a:for="{{affairList}}">
<block a:for="{{affairList}}" key="{{item.id}}">
<view a:if="{{item.category == '3' && item.taskViewList && item.taskViewList.length > 0}}" class='compose-column'>
<view class="avater task-avater">
<text class="iconfont iconicon_task1"></text>
......@@ -226,6 +226,7 @@
</view>
<view a:if="{{item.content && ((item.category == 1 || item.taskViewList && item.taskViewList.length > 0) || ( item.fileView && item.fileView.fileInfos && item.fileView.fileInfos.length > 0 ))}}" class='simple-column'>{{item.content}} {{item.createTime}}</view>
</block>
<view class="loading-more" onTap="loadAffairMore" a:if="{{current < pages}}">点击加载更多动态...</view>
<view class="affair-placeholder" a:if="{{affairList.length == 1 && affairList[0].logType == 'create_schedule'}}">
<template is="affair-placeholder" data="{{title: '添加文件', tip: '我们不开无准备的会,快来上传会议文件吧。'}}"/>
</view>
......
......@@ -2,7 +2,7 @@ import create from 'dd-store';
import { checkFullScren } from "../../utils/checkFullScren";
import pageStore from './store';
import { getMeetingRoomAffairs, createMeetingTask, deleteMeetingTask, updateMeetingTask, uploadPermissions } from '../../api/request';
import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule } from '../../api/request.js'
import { isParticipate, deleteSchedule, getScheduleDetail, getUserScheduleInTime, modifySchedule, getMeetingRoomRepeatAffairs } from '../../api/request.js'
import { throttle, getCreateShowTime } from './../../utils/utils.js'
import { observer } from '/utils/observer.js'
import { resolve } from 'path';
......@@ -10,6 +10,8 @@ create.Page({
store: pageStore,
useAll: true,
data: {
current: 1,
pages: 1,
isIPX: false,
$data: null,
affairLoading: true,
......@@ -115,7 +117,7 @@ create.Page({
this.update()
}, 100)
if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.setData({
'conToastData.showToast': true,
'conToastData.title': '保存成功',
......@@ -261,7 +263,7 @@ create.Page({
this.store.data.scheduleId = res.data.data.id;
this.store.data.groupId = res.data.data.groupId;
this.update();
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.resetRepeatList()
} else {
......@@ -322,6 +324,7 @@ create.Page({
reset() {
this.$store.resetEditData()
this.resetRepeatList()
this.store.data.affairList = [];
this.acrossDay(this.$store.data.startTime, this.$store.data.endTime)
},
// 跳转下一页
......@@ -767,6 +770,8 @@ create.Page({
this.$store.data.indexNeedUpdate = true
this.update()
this.setData({
aheadTimes: [15],
'comListData.aheadTimesListId': [15],
confirmAttendance: 1
})
this.conflictPeople()
......@@ -1239,6 +1244,8 @@ create.Page({
this.$store.data.indexNeedUpdate = true
this.update()
this.setData({
aheadTimes: [15],
'comListData.aheadTimesListId': [15],
confirmAttendance: 1
})
this.conflictPeople()
......@@ -1301,11 +1308,114 @@ create.Page({
// 页面被关闭
observer.unregister()
},
//获取动态列表
reload(id) {
loadAffairList(current = 1) {
if (this.data.repeatable == 1) {
this.getRepeatAffairList(this.data.scheduleItem.groupId, current)
} else {
this.getAffairList(this.data.scheduleItem.id)
}
//重置
this.store.data.isNeedReloadList = false;
this.update();
},
//获取单次会议动态列表
getAffairList(id) {
getMeetingRoomAffairs(id).then(res => {
const affairList = res.data.data || [];
const newAffairList = affairList.map(it => {
const newAffairList = this.dealAffairData(res.data.data || []);
this.store.data.affairList = newAffairList;
this.update();
this.setData({
affairLoading: false
});
})
},
//获取重复会议动态列表
getRepeatAffairList(groupId, current) {
getMeetingRoomRepeatAffairs(groupId, current).then(res => {
const newAffairList = this.dealRepeatAffairs(res.data.data.records || []);
//第一页数据会重新请求需要替换
if (current === 1) {
this.store.data.affairList = newAffairList;
this.update();
} else {
const newDynamicList = this.store.data.affairList.concat(newAffairList);
this.store.data.affairList = newDynamicList;
this.update();
}
this.setData({
affairLoading: false,
current: res.data.data.current,
pages: res.data.data.pages
});
})
},
//加载之前的会议动态
loadAffairMore() {
if (this.data.current < this.data.pages) {
this.loadAffairList(this.data.current + 1);
}
},
//处理重复会议动态数据
dealRepeatAffairs(affairList, type) {
// const newAffairData = {};
// const newAffairList = [];
// affairList.forEach(it => {
// if (it.meetingLogResource) {
// newAffairData[it.resourceId] = []
// }
// })
return affairList.map(item => {
let itemData = item.meetingLogResource;
if (itemData) {
if (item.createTime) {
item.sort1 = item.createTime
item.sort = new Date(item.createTime.replace(/-/g, '/')).getTime();
item.createTime = getCreateShowTime(item.createTime);
}
if (itemData.acceptorInfo) {
itemData.acceptorInfo = JSON.parse(itemData.acceptorInfo);
}
if (itemData.creatorInfo) {
itemData.creatorInfo = JSON.parse(itemData.creatorInfo);
}
if (itemData.fileInfos) {
item.fileView = {
fileInfos: JSON.parse(itemData.fileInfos),
creatorInfo: itemData.creatorInfo
};
}
if (itemData.taskInfos) {
item.taskViewList = [
{
acceptorInfo: itemData.acceptorInfo,
acceptorId: itemData.acceptorId,
creatorInfo: itemData.creatorInfo,
creatorId: itemData.creatorId,
taskInfos: JSON.parse(itemData.taskInfos),
taskStatus: itemData.taskStatus,
id: itemData.id
}
]
}
// newAffairData[item.resourceId].push(item);
}
return item
});
// console.log(newAffairData);
// for (let i in newAffairData) {
// newAffairData[i].sort((a, b) => a.sort - b.sort);
// newAffairList.push(newAffairData[i][0])
// }
// console.log(newAffairList)
// return newAffairList.sort((a, b) => a.sort - b.sort);
},
//处理会议动态数据
dealAffairData(affairList) {
return affairList.map(it => {
if (it.createTime) {
it.createTime = getCreateShowTime(it.createTime);
}
......@@ -1335,15 +1445,6 @@ create.Page({
}
return it
})
this.store.data.affairList = newAffairList;
this.setData({
affairLoading: false
});
//重置
this.store.data.isNeedReloadList = false;
this.update();
})
},
showPop(e) {
this.setData({
......@@ -1384,7 +1485,7 @@ create.Page({
//刷新列表,这里为什么不在promie后执行
setTimeout(() => {
if (this.store.data.isNeedReloadList) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.setData({
'conToastData.showToast': true,
'conToastData.title': '编辑成功',
......@@ -1454,7 +1555,7 @@ create.Page({
"resourceType": "accessory",
"id": id
}, () => {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1490,6 +1591,21 @@ create.Page({
"taskInfos": JSON.stringify(this.store.data.currentTask.taskInfos)
})
},
//重复任务状态处理
dealRepeatStatus(task) {
let dataIndex = "";
this.data.affairList.forEach((item, index) => {
if (item.meetingLogResource.id == task.id) {
dataIndex = index;
}
});
const setData = `affairList[${dataIndex}].taskViewList[0].taskStatus`;
const setData2 = `affairList[${dataIndex}].meetingLogResource.taskStatus`;
this.store.data[setData] = task.status;
this.store.data[setData2] = task.status;
this.update();
},
//列表修改任务状态
changeTaskStatusOnList(task) {
this.updateTask({
......@@ -1497,7 +1613,11 @@ create.Page({
"taskStatus": task.status,
'id': task.id
}, () => {
this.reload(this.data.scheduleItem.id);
if (this.data.repeatable == 1) {
this.dealRepeatStatus(task);
} else {
this.loadAffairList();
}
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1507,6 +1627,12 @@ create.Page({
this.updateTask({
"logType": "task_status_modify",
"taskStatus": this.store.data.currentTask.taskStatus
}, () => {
if (this.data.repeatable == 1) {
this.dealRepeatStatus({ status: this.store.data.currentTask.taskStatus, id: this.store.data.currentTask.id });
}
this.store.data.isNeedReloadList = true;
this.update();
})
},
//删除任务
......@@ -1515,7 +1641,7 @@ create.Page({
"logType": "task_remove",
}, () => {
this.closePop();
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.$store.data.isIndexAffairListNeedUpdate = true;
this.update();
})
......@@ -1562,7 +1688,7 @@ create.Page({
}
createMeetingTask(postData).then(res => {
if (res.data.code == 0) {
this.reload(this.data.scheduleItem.id);
this.loadAffairList();
this.closePop();
this.setData({
'conToastData.showToast': true,
......@@ -1576,14 +1702,7 @@ create.Page({
this.update();
}
})
}),
// throttle
// complete() {
// debugger
// },
//
expand() {
this.setData({
isExpand: false
......
.refresh-bg {
position: fixed;
left: 0;
top: 0;
background: #FFFFFF;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.refresh-btn {
padding: 0 48rpx;
margin-top: 32rpx;
}
\ No newline at end of file
<template name="refresh">
<view class="refresh-bg">
<view>您的网络好像不给力,请重试</view>
<button class="btn refresh-btn" onTap="refresh">刷新</button>
</view>
</template>
\ 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