Commit d5dc1853 by fengzhaoyu

11

parents d20f6c80 7658ce5a
......@@ -41,11 +41,10 @@ create.Component({
this.update();
this.getDate();
}
},
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"
......@@ -58,30 +57,24 @@ create.Component({
},
() => {
let now = new Date();
console.log(now.getTime());
let year = now.getFullYear();
let scheduleList = [];
for (let i = 0; i <= year - 2019; i++) {
scheduleList.push(that.returnScheduleList(2019 + i));
}
// 第一次加载
const today = new Date();
that.setData(
{
scheduleList: scheduleList,
todayStr: today.toLocaleDateString(),
thisYear: year,
maxYear: year
},
() => {
console.log(new Date().getTime());
}
);
const finalDate = new Date();
that.setData({
scheduleList: scheduleList,
todayStr: finalDate.toLocaleDateString(),
thisYear: year,
maxYear: year
});
}
);
});
}, 1000),
nextDetail: throttle(function (e) {
nextDetail: throttle(function(e) {
let item = e.target.dataset.item;
dd.navigateTo({
url: `./../meetingDetail/meetingDetail?scheduleItem=${JSON.stringify(
......@@ -206,8 +199,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
......@@ -242,7 +235,7 @@ create.Component({
);
}
});
scheduleMap.forEach(function (value, key, map) {
scheduleMap.forEach(function(value, key, map) {
scheduleList.push(value);
});
return scheduleList;
......@@ -324,9 +317,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
});
......@@ -361,9 +354,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
});
......@@ -380,7 +373,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(
......@@ -406,7 +399,7 @@ create.Component({
type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`,
}${rangeDay2}日`,
dayStr: key
});
}
......@@ -422,7 +415,7 @@ create.Component({
type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`,
}${rangeDay2}日`,
dayStr: key
});
}
......@@ -444,7 +437,7 @@ create.Component({
type: "week",
value: `第${listWeek}周,${rangeMonth1 + 1}${rangeDay1}日 - ${
rangeMonth2 == rangeMonth1 ? "" : rangeMonth2 + 1 + "月"
}${rangeDay2}日`,
}${rangeDay2}日`,
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