Commit 0c7673ff by fengzhaoyu

1

parents 3745b621 6ecd8093
...@@ -11,7 +11,11 @@ ...@@ -11,7 +11,11 @@
.task-list>.task-box { .task-list>.task-box {
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border-radius: 8rpx; border-radius: 8rpx;
<<<<<<< HEAD
box-shadow: 0 0 8rpx 0rpx rgba(0, 0, 0, 0.06); box-shadow: 0 0 8rpx 0rpx rgba(0, 0, 0, 0.06);
=======
box-shadow: 0 0 8rpx 0rpx rgba(0, 0, 0, 0.08);
>>>>>>> 6ecd809354bff4a43d9602986b3da837f23eaa2f
padding: 0 16rpx; padding: 0 16rpx;
height: 80rpx; height: 80rpx;
color: rgba(27, 38, 61, 1); color: rgba(27, 38, 61, 1);
......
...@@ -106,6 +106,7 @@ create.Page({ ...@@ -106,6 +106,7 @@ create.Page({
}, },
// 初始化 // 初始化
reset() { reset() {
this.$store.data.indexNeedUpdate = false;
this.$store.data.roomId = '' this.$store.data.roomId = ''
this.$store.data.participatorList = [] this.$store.data.participatorList = []
this.$store.data.participatorUserId = [] this.$store.data.participatorUserId = []
......
...@@ -328,6 +328,7 @@ create.Page({ ...@@ -328,6 +328,7 @@ create.Page({
}, },
// 初始化 // 初始化
reset() { reset() {
this.$store.data.indexNeedUpdate = false;
this.$store.data.roomId = '' this.$store.data.roomId = ''
this.$store.data.participatorList = [] this.$store.data.participatorList = []
this.$store.data.originUsers = [] this.$store.data.originUsers = []
......
...@@ -59,59 +59,6 @@ ...@@ -59,59 +59,6 @@
line-height: 24rpx; line-height: 24rpx;
} }
.fileIcon {
width: 64rpx;
height: 64rpx;
margin-right: 12rpx;
line-height: 64rpx;
}
.fileMsg {
flex: 1;
}
.fileName {
font-size: 28rpx;
color: #191F25;
letter-spacing: 0;
line-height: 32rpx;
margin-bottom: 8rpx;
}
.fileSize {
opacity: 0.56;
font-size: 24rpx;
color: #191F25;
letter-spacing: 0;
line-height: 24rpx;
}
.task {
border: 1px solid #F5F6F7;
box-shadow: 0 0 8rpx 0 rgba(0, 0, 0, 0.04);
border-radius: 8rpx;
padding: 0 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 76rpx;
}
.taskName text {
font-size: 28rpx;
color: #1B263D;
line-height: 28rpx;
flex: 1;
}
.userLogo {
border-radius: 50%;
width: 48rpx;
height: 48rpx;
background: red;
}
.placedTop { .placedTop {
width: 84rpx; width: 84rpx;
height: 84rpx; height: 84rpx;
...@@ -172,9 +119,6 @@ ...@@ -172,9 +119,6 @@
} }
.scheduleHeader { .scheduleHeader {
/* position: fixed;
top: 0;
left: 0; */
width: 100%; width: 100%;
height: 88rpx; height: 88rpx;
background: #FFFFFF; background: #FFFFFF;
...@@ -182,12 +126,16 @@ ...@@ -182,12 +126,16 @@
padding: 0 32rpx; padding: 0 32rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
box-shadow: 0 1rpx 8rpx 0 rgba(0, 0, 0, 0.04); box-shadow: 0 1rpx 10rpx 2rpx rgba(0, 0, 0, 0.04);
z-index: 9; z-index: 9;
position: relative;
} }
.scheduleHeader view:nth-of-type(1) { .scheduleHeader view:nth-of-type(1) {
flex: 1; flex: 1;
color: rgba(10, 10, 10, 1);
font-size: 40rpx;
font-weight: bold;
} }
.scheduleHeader view:nth-of-type(2) { .scheduleHeader view:nth-of-type(2) {
...@@ -195,16 +143,6 @@ ...@@ -195,16 +143,6 @@
height: 40rpx; height: 40rpx;
} }
.sidebar {
position: fixed;
left: -750rpx;
top: 0;
width: 750rpx;
height: 100%;
/* background: rgba(0, 0, 0, 0.19); */
z-index: 99;
}
.headerIcon { .headerIcon {
position: relative; position: relative;
} }
...@@ -224,6 +162,7 @@ ...@@ -224,6 +162,7 @@
font-size: 44rpx; font-size: 44rpx;
color: rgba(27, 38, 61, 0.4); color: rgba(27, 38, 61, 0.4);
} }
.year, .month, .week, .date { .year, .month, .week, .date {
height: 96rpx; height: 96rpx;
font-size: 48rpx; font-size: 48rpx;
...@@ -444,9 +383,9 @@ ...@@ -444,9 +383,9 @@
.iconicon_days { .iconicon_days {
position: absolute; position: absolute;
left: 5rpx; left: 7rpx;
top: 8rpx; top: 10rpx;
font-size: 30rpx; font-size: 27rpx;
} }
.tabBarView .iconicon_days { .tabBarView .iconicon_days {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<import src="../../template/affairBlank/index.axml"/> <import src="../../template/affairBlank/index.axml"/>
<view class="{{isStopBodyScroll ? 'scroll-lock' : ''}}" onTap="closeSwipe" onTouchStart="closeSwipe" onTouchMove="closeSwipe" onTouchEnd="closeSwipe"> <view class="{{isStopBodyScroll ? 'scroll-lock' : ''}}" onTap="closeSwipe" onTouchStart="closeSwipe" onTouchMove="closeSwipe" onTouchEnd="closeSwipe">
<block a:if="{{!listLoading}}"> <block a:if="{{!listLoading}}">
<scroll-view a:if="{{dynamicList.length > 0}}" scroll-y="{{true}}" lower-threshold="{{600}}" class="dynamicBox" onScrollToLower="onScrollToLower"> <scroll-view a:if="{{dynamicList.length > 0}}" scroll-y="{{true}}" lower-threshold="{{400}}" class="dynamicBox" onScrollToLower="onScrollToLower">
<view class="dynamicList"> <view class="dynamicList">
<swipe onSetBodyDisableScroll="setBodyDisableScroll" rightWidth="{{ 78 }}" leftWidth="{{ 0 }}" a:for="{{dynamicList}}" class="dynamicContent" key="{{item.scheduleId}}"> <swipe onSetBodyDisableScroll="setBodyDisableScroll" rightWidth="{{ 78 }}" leftWidth="{{ 0 }}" a:for="{{dynamicList}}" class="dynamicContent" key="{{item.scheduleId}}">
<view class="dynamicDetails"> <view class="dynamicDetails">
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</view> </view>
</view> </view>
</view> </view>
<scroll-view class="indexScrollView" scroll-y="{{true}}" onScroll="scroll" lower-threshold="400" onScrollToLower="lower" scroll-into-view="{{todayStr}}"> <scroll-view class="indexScrollView" scroll-y="{{true}}" onScroll="scroll" lower-threshold="{{400}}" onScrollToLower="lower" scroll-into-view="{{todayStr}}">
<block a:for="{{scheduleList}}" key="{{item.dateStr}}"> <block a:for="{{scheduleList}}" key="{{item.dateStr}}">
<!-- 年 --> <!-- 年 -->
<block a:if="{{item.type == 'year'}}"> <block a:if="{{item.type == 'year'}}">
...@@ -129,7 +129,11 @@ ...@@ -129,7 +129,11 @@
<view onTap="changeTabBar" data-tabbar='1' data-title='日程'> <view onTap="changeTabBar" data-tabbar='1' data-title='日程'>
<view class="tabBarView tabBarView2 {{$data.tabBarIndex === '1' ? 'ischooseTabBar' : ''}}"> <view class="tabBarView tabBarView2 {{$data.tabBarIndex === '1' ? 'ischooseTabBar' : ''}}">
<view class="iconfont iconicon_Calendarbox1"> <view class="iconfont iconicon_Calendarbox1">
<text class="iconfont iconicon_days iconicon_days{{iconDay}}"> <text a:if="{{offset == 'before'}}" class="iconfont iconicon_days iconicon_Packup">
</text>
<text a:elif="{{offset == 'next'}}" class="iconfont iconicon_days iconicon_open">
</text>
<text a:else class="iconfont iconicon_days iconicon_days{{iconDay}}">
</text> </text>
</view> </view>
<view>日程</view> <view>日程</view>
......
...@@ -18,6 +18,7 @@ let maxYear = currentDate.getFullYear() + 1; ...@@ -18,6 +18,7 @@ let maxYear = currentDate.getFullYear() + 1;
let DateMap = getDateMap(minYear, maxYear); let DateMap = getDateMap(minYear, maxYear);
const weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; const weekList = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
import create from "dd-store"; import create from "dd-store";
create.Page({ create.Page({
data: { data: {
$data: null, $data: null,
...@@ -26,6 +27,7 @@ create.Page({ ...@@ -26,6 +27,7 @@ create.Page({
todayStr: toLocaleDateString(currentDate), todayStr: toLocaleDateString(currentDate),
currentData: toLocaleDateString(currentDate), currentData: toLocaleDateString(currentDate),
currentDataIndex: 0, currentDataIndex: 0,
offset: 'stop',
show: false, show: false,
loading: true, loading: true,
traceTime: '1970-03-01 00:00:00', traceTime: '1970-03-01 00:00:00',
...@@ -41,6 +43,8 @@ create.Page({ ...@@ -41,6 +43,8 @@ create.Page({
currentPage: 1, currentPage: 1,
firstPage: 1, firstPage: 1,
scheduleList: [], scheduleList: [],
timer: null,
isFirstLoad: true,
onShow() { onShow() {
if (this.$store.data.indexNeedUpdate) { if (this.$store.data.indexNeedUpdate) {
//优化:如果是重复会议重新算,单次会议往DateMap中添加 //优化:如果是重复会议重新算,单次会议往DateMap中添加
...@@ -213,8 +217,8 @@ create.Page({ ...@@ -213,8 +217,8 @@ create.Page({
this.totalPages = Math.ceil(scheduleList.length / this.pageSize); this.totalPages = Math.ceil(scheduleList.length / this.pageSize);
for (let i = 0; i < scheduleList.length; i++) { for (let i = 0; i < scheduleList.length; i++) {
if (scheduleList[i].dateStr == toLocaleDateString(currentDate)) { if (scheduleList[i].dateStr == toLocaleDateString(currentDate)) {
this.firstPage = Math.floor(i / this.pageSize); this.firstPage = Math.floor(i / this.pageSize) - 2;
this.currentPage = this.firstPage + 2; this.currentPage = Math.floor(i / this.pageSize) + 2;
break break
} }
} }
...@@ -278,11 +282,21 @@ create.Page({ ...@@ -278,11 +282,21 @@ create.Page({
// 根据接口返回数据生成填充DateMap // 根据接口返回数据生成填充DateMap
setDateMapByResponse(response) { setDateMapByResponse(response) {
if (response) { if (response) {
const repeatIdList = []; //重复会议的ID // 处理单次会议 scheduleList
const scheduleListWithTemplateId = [];
response.scheduleList.forEach(item => {
// 有scheduleTemplateId则是虚拟会议转成实体会议,需要替换rrule生成的模板会议
if (item.scheduleTemplateId) {
scheduleListWithTemplateId.push(item);
} else {
this.setDateMapValue(new Date(item.startTime.replace(/-/g, '/')), new Date(item.endTime.replace(/-/g, '/')), item);
}
});
// 处理重复会议 templateList // 处理重复会议 templateList
console.log('deal templateList')
response.templateList.forEach(item => { response.templateList.forEach(item => {
repeatIdList.push(item.id) //日程会议
const itemScheduleList = scheduleListWithTemplateId.filter(it => it.scheduleTemplateId == item.id);
// 生成rrules规则 // 生成rrules规则
const initialTimeList = item.initialTime.split('-'); const initialTimeList = item.initialTime.split('-');
const startTimeList = item.startTime.split(":"); const startTimeList = item.startTime.split(":");
...@@ -290,6 +304,19 @@ create.Page({ ...@@ -290,6 +304,19 @@ create.Page({
const rule = RRule.fromString( const rule = RRule.fromString(
`${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}` `${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}`
); );
const setDateMapValueAll = (startTime, endTime, item) => {
//如果有日程会议则用日程会议替换
let replaceItem = [];
if (itemScheduleList.length > 0) {
replaceItem = itemScheduleList.filter(it => it.planDate == getFormatDate(startTime, "yyyyMMdd", "-"))
}
if (replaceItem.length > 0) {
this.setDateMapValue(new Date(replaceItem[0].startTime.replace(/-/g, '/')), new Date(replaceItem[0].endTime.replace(/-/g, '/')), replaceItem[0]);
} else {
this.setDateMapValue(startTime, endTime, item, 'repeat');
}
}
// 需要剔除某一天 // 需要剔除某一天
if (item.excludePlanDates) { if (item.excludePlanDates) {
const excludeData = getExcludeDate(item.excludePlanDates.split(",")); const excludeData = getExcludeDate(item.excludePlanDates.split(","));
...@@ -299,10 +326,10 @@ create.Page({ ...@@ -299,10 +326,10 @@ create.Page({
// 生成结束时间 // 生成结束时间
const endTime = new Date(startTime); const endTime = new Date(startTime);
endTime.setMinutes(endTime.getMinutes() + item.recurrenceModel.duration); endTime.setMinutes(endTime.getMinutes() + item.recurrenceModel.duration);
// 剔除规则 // 剔除规则: 时间小于futureTime 时间不在单个排除日期里面
if (startTime.getTime() < excludeData.minFutureTime && if (startTime.getTime() < excludeData.minFutureTime &&
excludeData.excludeDateList.indexOf(getFormatDate(startTime, "yyyyMMdd", "-")) === -1) { !excludeData.excludeDateList.includes(getFormatDate(startTime, "yyyyMMdd", "-"))) {
this.setDateMapValue(startTime, endTime, item, 'repeat'); setDateMapValueAll(startTime, endTime, item);
} }
}); });
} }
...@@ -314,29 +341,12 @@ create.Page({ ...@@ -314,29 +341,12 @@ create.Page({
// 生成结束时间 // 生成结束时间
const endTime = new Date(startTime); const endTime = new Date(startTime);
endTime.setMinutes(endTime.getMinutes() + item.recurrenceModel.duration); endTime.setMinutes(endTime.getMinutes() + item.recurrenceModel.duration);
this.setDateMapValue(startTime, endTime, item, 'repeat'); setDateMapValueAll(startTime, endTime, item);
}); });
} }
}); });
console.log('deal scheduleList')
// 处理单次会议 scheduleList
response.scheduleList.forEach(item => {
// if (!item.scheduleTemplateId) {
// this.setDateMapValue(new Date(item.startTime.replace(/-/g, '/')), new Date(item.endTime.replace(/-/g, '/')), item);
// }
// 有scheduleTemplateId则是虚拟会议转成实体会议,需要替换rrule生成的模板会议
if (repeatIdList.includes(item.scheduleTemplateId)) {
const list = DateMap.get(toLocaleDateString(new Date(item.planDate.replace(/-/g, '/')))) || [];
list.forEach((o, index) => {
if (o.scheduleTemplateId == item.scheduleTemplateId) {
list.splice(index, 1);
}
});
}
this.setDateMapValue(new Date(item.startTime.replace(/-/g, '/')), new Date(item.endTime.replace(/-/g, '/')), item);
});
} }
}, },
//日程数据 //日程数据
...@@ -429,40 +439,43 @@ create.Page({ ...@@ -429,40 +439,43 @@ create.Page({
}, },
onPullDownRefresh() { onPullDownRefresh() {
if (this.$store.data.tabBarIndex == '0') { if (this.$store.data.tabBarIndex == '0') {
this.getPages(1);
dd.stopPullDownRefresh(); dd.stopPullDownRefresh();
return return
} }
//到顶部的时候才下拉加载数据,否则定位距离太长 //日程页面到顶部的时候才下拉加载数据,否则定位距离太长
if (this.scrollTop !== 0) { if (this.$store.data.tabBarIndex == '1' && this.scrollTop !== 0) {
dd.stopPullDownRefresh(); dd.stopPullDownRefresh();
return return
} }
const todayStr = this.data.scheduleList[0].dateStr; // const todayStr = this.data.scheduleList[0].dateStr;
if (this.firstPage > 0) { if (this.firstPage > 0) {
this.firstPage--; this.firstPage--;
this.currentPage--;
this.setData({ this.setData({
todayStr: '', todayStr: '',
scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize) scheduleList: this.scheduleList.slice(this.firstPage * this.pageSize, this.currentPage * this.pageSize)
}, () => { }, () => {
this.setData({ this.setData({
todayStr: todayStr todayStr: this.data.scheduleList[this.pageSize - 1].dateStr
}); });
dd.stopPullDownRefresh(); dd.stopPullDownRefresh();
}); });
} else { } else {
minYear--; minYear--;
const yearData = getBlankList(minYear); const yearData = getBlankList(minYear);
this.scheduleList.unshift(...yearData); this.scheduleList.unshift(...yearData);
this.totalPages = Math.ceil(this.scheduleList.length / this.pageSize);
this.currentPage = Math.floor(yearData.length * 2 / this.pageSize);
this.setData({ this.setData({
todayStr: '', todayStr: '',
scheduleList: this.scheduleList.slice(0, this.currentPage * this.pageSize), scheduleList: this.scheduleList.slice(0, yearData.length * 2),
//加载一年的数据重定位可能会有点问题,重置一下
currentData: todayStr,
currentDataIndex: yearData.length
}, () => { }, () => {
this.setData({ this.setData({
todayStr: todayStr //加载一年的数据重定位可能会有点问题,重置一下
currentData: this.scheduleList[yearData.length - 1].dateStr,
currentDataIndex: yearData.length - 1,
todayStr: this.scheduleList[yearData.length - 1].dateStr
}); });
dd.stopPullDownRefresh() dd.stopPullDownRefresh()
}) })
...@@ -481,18 +494,6 @@ create.Page({ ...@@ -481,18 +494,6 @@ create.Page({
i++ i++
} }
return i return i
// for (let i = 0; i < this.data.scheduleList.length; i++) {
// if (this.data.scheduleList[i].type.indexOf('day') !== '-1') {
// height += this.dateHeight
// } else {
// height += this.otherHeight
// }
// if (height >= scrollTop) {
// index = i;
// break;
// }
// }
// return index
}, },
scroll(e) { scroll(e) {
//计算有偏差 //计算有偏差
...@@ -527,8 +528,26 @@ create.Page({ ...@@ -527,8 +528,26 @@ create.Page({
}) })
} }
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.setData({
offset: 'stop'
})
}, 500)
//每次计算偏移值 //每次计算偏移值
const offset = this.getScrollOffset(e.detail.scrollTop); const offset = this.getScrollOffset(e.detail.scrollTop);
if (this.data.offset !== offset) {
if (!this.resetToview) {
this.setData({
offset
});
}
this.resetToview = false
}
dd.createSelectorQuery().selectAll('.li').boundingClientRect().exec((rect) => { dd.createSelectorQuery().selectAll('.li').boundingClientRect().exec((rect) => {
if (offset == 'next') { if (offset == 'next') {
for (let i = this.data.currentDataIndex; i < rect[0].length; i++) { for (let i = this.data.currentDataIndex; i < rect[0].length; i++) {
...@@ -544,7 +563,8 @@ create.Page({ ...@@ -544,7 +563,8 @@ create.Page({
} }
} }
else if (offset == 'before') { else if (offset == 'before') {
for (let i = this.data.currentDataIndex; i > 0; i--) { let i = Math.min(this.data.currentDataIndex, this.data.scheduleList.length - 1);
for (; i > 0; i--) {
if (rect[0][i].top < 50) { if (rect[0][i].top < 50) {
if (this.data.scheduleList[i].dateStr.split('/')[1] !== this.data.currentData.split('/')[1]) { if (this.data.scheduleList[i].dateStr.split('/')[1] !== this.data.currentData.split('/')[1]) {
this.setData({ this.setData({
...@@ -560,7 +580,7 @@ create.Page({ ...@@ -560,7 +580,7 @@ create.Page({
}, },
//判断滚动方向 //判断滚动方向
getScrollOffset(scrollTop) { getScrollOffset(scrollTop) {
let offset = ''; let offset = 'stop';
if (scrollTop > this.scrollTop) { if (scrollTop > this.scrollTop) {
//向下滚动 //向下滚动
offset = 'next' offset = 'next'
...@@ -568,9 +588,9 @@ create.Page({ ...@@ -568,9 +588,9 @@ create.Page({
//向上滚动 //向上滚动
offset = 'before' offset = 'before'
} }
//给scrollTop重新赋值
this.scrollTop = scrollTop; this.scrollTop = scrollTop;
return offset return offset
}, },
closePop() { closePop() {
this.setData({ this.setData({
...@@ -621,6 +641,7 @@ create.Page({ ...@@ -621,6 +641,7 @@ create.Page({
if (this.isFirstLoad) { if (this.isFirstLoad) {
this.backToToday(); this.backToToday();
this.isFirstLoad = false; this.isFirstLoad = false;
this.resetToview = true;
} }
} }
}); });
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