From 8d93aa04d3b33c0ffd9c0d18de21378b654df331 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Tue, 20 Oct 2020 15:06:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/date.ts | 10 +- src/views/Home.vue | 25 ---- src/views/regime/week.vue | 256 +++++++++++++++++++------------------- 3 files changed, 136 insertions(+), 155 deletions(-) delete mode 100644 src/views/Home.vue diff --git a/src/utils/date.ts b/src/utils/date.ts index 1dbf9a8..9da443c 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -68,20 +68,23 @@ export function getweek(zhou?: number){ if(zhou != undefined){ now = now.day(now.day() + (zhou * 6)); } - const yue = now.month() + 1; + const yue = (now.month() + 1 < 10 ? '0' + (now.month() + 1) : (now.month() + 1)); const day = now.date() // 当前天 zhou = now.day(); // 当前周几 const year = now.year() + const startd = now.day(1).date(); + const start = `${year}-${yue}-${startd}` interface Date{ day: string; list?: Array; } const date: Array = []; + for(let i = 0; i < 7; i++){ console.log(i); now = now.day(i + 1) date[i] = {day: ""}; - date[i].day = now.year() + "-" + (now.month() < 10 ? '0' + now.month() : now.month()) + "-" + (now.date() < 10 ? '0' + now.date() : now.date()) + date[i].day = now.year() + "-" + (now.month() + 1 < 10 ? '0' + (now.month() + 1) : (now.month() + 1)) + "-" + (now.date() < 10 ? '0' + now.date() : now.date()) date[i].list = [] for(let j = 0;j < 24; j++){ date[i].list?.push({ @@ -90,8 +93,9 @@ export function getweek(zhou?: number){ }) } } + const end = `${now.year()}-${(now.month() + 1 < 10 ? '0' + (now.month() + 1) : (now.month() + 1))}-${now.date()}` console.log(date) - return {date, year, yue, day, zhou} + return {date, year, yue, day, zhou, start, end} } diff --git a/src/views/Home.vue b/src/views/Home.vue deleted file mode 100644 index ea1ae8e..0000000 --- a/src/views/Home.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - diff --git a/src/views/regime/week.vue b/src/views/regime/week.vue index 955c3e5..72a8657 100644 --- a/src/views/regime/week.vue +++ b/src/views/regime/week.vue @@ -2,49 +2,69 @@
- + 上一周
2020年10月 - - 月日历 - + 月日历
下一周 - +
-
-
-
周一{{week.date[0].day}}
-
周二{{week.date[1].day}}
-
周三{{week.date[2].day}}
-
周四{{week.date[3].day}}
-
周五{{week.date[4].day}}
-
周六{{week.date[5].day}}
-
周日{{week.date[6].day}}
+
+
+
+ 周一{{ week.date[0].day }}
-
-
-
{{item > 10 ? item - 1 : '0' + (item - 1)}}:00
-
-
- - -
+
+ 周二{{ week.date[1].day }} +
+
+ 周三{{ week.date[2].day }} +
+
+ 周四{{ week.date[3].day }} +
+
+ 周五{{ week.date[4].day }} +
+
+ 周六{{ week.date[5].day }} +
+
+ 周日{{ week.date[6].day }} +
+
+
+
+
+ {{ item > 10 ? item - 1 : "0" + (item - 1) }}:00-{{ + item > 9 ? item : "0" + item + }}:00 +
+
+
+
+
+ one-line-hideon
+
11:00-11:00
+
+
+
\ No newline at end of file