Commit d5dc1853 by fengzhaoyu

11

parents d20f6c80 7658ce5a
...@@ -41,11 +41,10 @@ create.Component({ ...@@ -41,11 +41,10 @@ create.Component({
this.update(); this.update();
this.getDate(); this.getDate();
} }
}, },
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"
...@@ -58,30 +57,24 @@ create.Component({ ...@@ -58,30 +57,24 @@ create.Component({
}, },
() => { () => {
let now = new Date(); let now = new Date();
console.log(now.getTime());
let year = now.getFullYear(); let year = now.getFullYear();
let scheduleList = []; let scheduleList = [];
for (let i = 0; i <= year - 2019; i++) { for (let i = 0; i <= year - 2019; i++) {
scheduleList.push(that.returnScheduleList(2019 + i)); scheduleList.push(that.returnScheduleList(2019 + i));
} }
// 第一次加载 // 第一次加载
const today = new Date(); const finalDate = new Date();
that.setData( that.setData({
{ scheduleList: scheduleList,
scheduleList: scheduleList, todayStr: finalDate.toLocaleDateString(),
todayStr: today.toLocaleDateString(), thisYear: year,
thisYear: year, maxYear: year
maxYear: year });
},
() => {
console.log(new Date().getTime());
}
);
} }
); );
}); });
}, 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(
...@@ -206,8 +199,8 @@ create.Component({ ...@@ -206,8 +199,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
...@@ -242,7 +235,7 @@ create.Component({ ...@@ -242,7 +235,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;
...@@ -324,9 +317,9 @@ create.Component({ ...@@ -324,9 +317,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
}); });
...@@ -361,9 +354,9 @@ create.Component({ ...@@ -361,9 +354,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
}); });
...@@ -380,7 +373,7 @@ create.Component({ ...@@ -380,7 +373,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(
...@@ -406,7 +399,7 @@ create.Component({ ...@@ -406,7 +399,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
}); });
} }
...@@ -422,7 +415,7 @@ create.Component({ ...@@ -422,7 +415,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
}); });
} }
...@@ -444,7 +437,7 @@ create.Component({ ...@@ -444,7 +437,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
}); });
} }
......
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