From ad2c85ad3e63fe3ca0219935d163bc09749310b4 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Fri, 30 Oct 2020 15:36:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E5=8F=98=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/NavTop.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/NavTop.vue b/src/components/NavTop.vue index 731cfcb..eaf775a 100644 --- a/src/components/NavTop.vue +++ b/src/components/NavTop.vue @@ -52,7 +52,7 @@
- {{i.name}} + {{i.name}}
From 6cf34e698bd42268cb560cddea1b62273ad9c104 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Fri, 30 Oct 2020 15:54:55 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=97=A5?= =?UTF-8?q?=E5=8E=86=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/date.ts | 7 ++++--- src/views/regime/date.vue | 6 +++--- src/views/regime/week.vue | 6 ++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/utils/date.ts b/src/utils/date.ts index ea9ad2f..9b73421 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -47,7 +47,8 @@ export function getdate(yue?: number): GetDate{ const zhou = Math.floor((i + w - 1) / 7) const d = { day: i, - list: [] + list: [], + time: now.date(i).toISOString() } if(date[zhou] == undefined){ date[zhou] = [] @@ -63,8 +64,8 @@ export function getdate(yue?: number): GetDate{ } -export function getweek(zhou?: number){ - let now = dayjs() +export function getweek(time: string,zhou?: number){ + let now = dayjs((!time ? undefined : time)) if(zhou != undefined){ now = now.day(now.day() + (zhou * 6)); } diff --git a/src/views/regime/date.vue b/src/views/regime/date.vue index 5d5f742..a699acc 100644 --- a/src/views/regime/date.vue +++ b/src/views/regime/date.vue @@ -28,7 +28,7 @@
-
+
{{i.day}}

{{i}}

@@ -241,8 +241,8 @@ export default defineComponent({ getdates(userid.value) } - function navto(){ - router.push("/regime/week") + function navto(date: string){ + router.push("/regime/week?time=" + (!date? '' : date) ) } getdates(userid.value); return { diff --git a/src/views/regime/week.vue b/src/views/regime/week.vue index 5643380..579ca17 100644 --- a/src/views/regime/week.vue +++ b/src/views/regime/week.vue @@ -250,12 +250,14 @@ import store from '@/store'; import { getdatelist, userinfo } from '@/api'; import router from '@/router'; import dayjs from 'dayjs'; +import { useRoute } from 'vue-router'; export default defineComponent({ props: {}, setup() { const zhou = ref(0); - const week = ref(getweek()); + const time: any = useRoute().query.time; + const week = ref(getweek(time)); const userid = store.state.userinfo.memberid; console.log(week.value); function getdates(userid: number){ @@ -295,7 +297,7 @@ export default defineComponent({ }, 2000) watch(zhou, (value) => { - week.value = getweek(value); + week.value = getweek(time, value); console.log(week.value); getdates(userid) });