Commit 1b2b19c9 by fengzhaoyu

会议时间

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