Commit 1b2b19c9 by fengzhaoyu

会议时间

parent ff4da87c
...@@ -39,9 +39,9 @@ create.Component({ ...@@ -39,9 +39,9 @@ create.Component({
} }
}, },
didUnmount() {}, didUnmount() { },
methods: { methods: {
getDate: throttle(function(e) { getDate: throttle(function (e) {
let data = { let data = {
startTime: "2020-01-01 00:00:00", startTime: "2020-01-01 00:00:00",
endTime: "2025-12-30 23:59:59" endTime: "2025-12-30 23:59:59"
...@@ -77,7 +77,7 @@ create.Component({ ...@@ -77,7 +77,7 @@ create.Component({
); );
}); });
}, 1000), }, 1000),
nextDetail: throttle(function(e) { nextDetail: throttle(function (e) {
let item = e.target.dataset.item; let item = e.target.dataset.item;
dd.navigateTo({ dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify( url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify(
...@@ -128,14 +128,26 @@ create.Component({ ...@@ -128,14 +128,26 @@ create.Component({
this.data.response.templateList.map(item => { this.data.response.templateList.map(item => {
// TO DO 判断所获取的时间区间 // TO DO 判断所获取的时间区间
// 将会议的年,月,日拆分,时分拆分,生成rrules规则 // 将会议的年,月,日拆分,时分拆分,生成rrules规则
let terminateTimeList = item.initialTime.split("-"); // let initialTime = item.initialTime.split("-"); //
let initialTimeDate = new Date(parseInt(initialTime[0]), parseInt(initialTime[1]) - 1, parseInt(initialTime[2]));
initialTimeDate.setDate(initialTimeDate.getDate() - 1)
console.log(initialTimeDate.toLocaleDateString())
let initialTimeDateyear = initialTimeDate.getFullYear()
let initialTimeDatemonth = initialTimeDate.getMonth() + 1 < 10 ? '0' + (initialTimeDate.getMonth() + 1) : initialTimeDate.getMonth() + 1
let initialTimeDateday = initialTimeDate.getDate() < 10 ? '0' + initialTimeDate.getDate() : initialTimeDate.getDate()
let startTimeList = item.startTime.split(":"); let startTimeList = item.startTime.split(":");
let DTSTART = `${terminateTimeList[0]}${terminateTimeList[1]}${terminateTimeList[2]}T${startTimeList[0]}${startTimeList[1]}00Z`; let DTSTART = `${initialTimeDateyear}${initialTimeDatemonth}${initialTimeDateday}T${startTimeList[0]}${startTimeList[1]}00Z`;
console.log(DTSTART)
let rule = RRule.fromString( let rule = RRule.fromString(
`${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}` `${item.recurrenceModel.recurrenceRule};DTSTART=${DTSTART}`
); );
// rule.options.tzid = "Asia/Hong_Kong";
// 改变时区 // 改变时区
rule.options.tzid = "Asia/Hong_Kong"; // let rullAll = rule.all()
// rule.all().map(item => {
// console.log(item.toLocaleDateString())
// })
// 判断是否需要剔除某一天 // 判断是否需要剔除某一天
if (item.excludePlanDates) { if (item.excludePlanDates) {
// 拿到剔除日期的list // 拿到剔除日期的list
...@@ -180,8 +192,8 @@ create.Component({ ...@@ -180,8 +192,8 @@ create.Component({
item.recurrenceModel.startTime; item.recurrenceModel.startTime;
let endTime = new Date( let endTime = new Date(
getFormatDate(item2, "yyyyMMdd") + getFormatDate(item2, "yyyyMMdd") +
" " + " " +
item.recurrenceModel.startTime item.recurrenceModel.startTime
); );
endTime.setMinutes( endTime.setMinutes(
endTime.getMinutes() + item.recurrenceModel.duration endTime.getMinutes() + item.recurrenceModel.duration
...@@ -216,7 +228,7 @@ create.Component({ ...@@ -216,7 +228,7 @@ create.Component({
); );
} }
}); });
scheduleMap.forEach(function(value, key, map) { scheduleMap.forEach(function (value, key, map) {
scheduleList.push(value); scheduleList.push(value);
}); });
return scheduleList; return scheduleList;
...@@ -298,9 +310,9 @@ create.Component({ ...@@ -298,9 +310,9 @@ create.Component({
thisDayEndTime: AllScheduleList[y].endTime.slice(11, 16), thisDayEndTime: AllScheduleList[y].endTime.slice(11, 16),
isBeOverdue: isBeOverdue:
new Date().getTime() > new Date().getTime() >
new Date( new Date(
AllScheduleList[y].endTime.replace(/-/g, "/") AllScheduleList[y].endTime.replace(/-/g, "/")
).getTime() ).getTime()
? true ? true
: false : false
}); });
...@@ -335,9 +347,9 @@ create.Component({ ...@@ -335,9 +347,9 @@ create.Component({
duration: count + 1, duration: count + 1,
isBeOverdue: isBeOverdue:
new Date().getTime() > new Date().getTime() >
new Date( new Date(
AllScheduleList[y].endTime.replace(/-/g, "/") AllScheduleList[y].endTime.replace(/-/g, "/")
).getTime() ).getTime()
? true ? true
: false : false
}); });
...@@ -354,7 +366,7 @@ create.Component({ ...@@ -354,7 +366,7 @@ create.Component({
value: year value: year
}); });
let thisDay = new Date().toLocaleDateString(); let thisDay = new Date().toLocaleDateString();
DateMap.forEach(function(value, key, map) { DateMap.forEach(function (value, key, map) {
if ( if (
new Date(key).getDay() === 0 && new Date(key).getDay() === 0 &&
that.count( that.count(
...@@ -380,7 +392,7 @@ create.Component({ ...@@ -380,7 +392,7 @@ create.Component({
type: "week", type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${ value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月" rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`, }${rangeDay2}日`,
dayStr: key dayStr: key
}); });
} }
...@@ -396,7 +408,7 @@ create.Component({ ...@@ -396,7 +408,7 @@ create.Component({
type: "week", type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${ value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月" rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`, }${rangeDay2}日`,
dayStr: key dayStr: key
}); });
} }
...@@ -418,7 +430,7 @@ create.Component({ ...@@ -418,7 +430,7 @@ create.Component({
type: "week", type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${ value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月" rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`, }${rangeDay2}日`,
dayStr: key dayStr: key
}); });
} }
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
</my-dynamic> </my-dynamic>
</view> </view>
<view a:if="{{tabBarIndex === '1'}}"> <view a:if="{{tabBarIndex === '1'}}">
<my-schedule update="{{indexNeedUpdate}}"> <my-schedule update="{{$data.indexNeedUpdate}}">
</my-schedule> </my-schedule>
</view> </view>
<view class="tabBar"> <view class="tabBar">
<view onTap="changeTabBar" data-tabbar='0'> <view onTap="changeTabBar" data-tabbar='0'>
<view class="tabBarView {{tabBarIndex === '0' ? 'ischooseTabBar' : ''}}"> <view class="tabBarView {{tabBarIndex === '0' ? 'ischooseTabBar' : ''}}">
<text class="iconfont iconicon_dynamic"></text> <text class="iconfont iconicon_dynamic"></text>
<text>动态{{indexNeedUpdate}} <text>动态{{$data.indexNeedUpdate}}
</text> </text>
</view> </view>
</view> </view>
......
...@@ -5,9 +5,11 @@ create.Page({ ...@@ -5,9 +5,11 @@ create.Page({
tabBarIndex: "0", tabBarIndex: "0",
$data: null $data: null
}, },
onLoad() {}, onLoad() { },
onShow() { onShow() {
this.update(); setTimeout(res => {
this.update();
}, 100)
}, },
// 修改tabBar // 修改tabBar
changeTabBar(e) { changeTabBar(e) {
......
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