From c73e27774ed9e7469326bfdbf4242f3c0688337d Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Tue, 24 Nov 2020 18:22:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=A8=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/en.ts | 7 ++++++- src/i18n/zh.ts | 5 +++++ src/utils/date.ts | 2 +- src/views/regime/date.vue | 29 +++++++++++++++-------------- src/views/regime/week.vue | 24 +++++++++++++----------- 5 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 58b1528..42453f2 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -319,13 +319,18 @@ export default { paiming: "rank", wo: "my", yizhucexuesheng: "This number is already registered as a student", - zhouri:"baiSunday", + zhouri:"Sunday", zhouyi:"Monday", zhouer:"Tuesday", zhousan:"Wednesday", zhousi:"Thursday", zhouwu:"Friday", zhouliu:"Saturday", + shangyige:"previous", + xiayige:"next", + nian:"year", + yues:"month", + zhourili:"Week", shichangtishi:"", renshutishi: '', tixianzhu: "", diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index bfa7daa..9c8188a 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -326,6 +326,11 @@ export default { zhousi:"周四", zhouwu:"周五", zhouliu:"周六", + shangyige:"上一月", + xiayige:"下一月", + nian:"年", + yues:"月", + zhourili:"周日历", shichangtishi:"", renshutishi: '', tixianzhu:"", diff --git a/src/utils/date.ts b/src/utils/date.ts index 2e43f61..272f8e6 100644 --- a/src/utils/date.ts +++ b/src/utils/date.ts @@ -103,7 +103,7 @@ export function getweek(time: string, id: string,zhou?: number){ for(let i = 0; i < 7; i++){ console.log(i); - now = now.day(i + 1) + now = now.day(i) date[i] = {day: ""}; 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 = [] diff --git a/src/views/regime/date.vue b/src/views/regime/date.vue index 93a0573..f257edf 100644 --- a/src/views/regime/date.vue +++ b/src/views/regime/date.vue @@ -3,26 +3,26 @@
- 上一月 + {{lan.$t("shangyige")}}
- {{month.year}}年{{month.yue}}月 + {{month.year}}{{lan.$t("nian")}}{{month.yue}}{{lan.$t("yues")}} - 周日历 + {{lan.$t("zhourili")}}
- 下一月 + {{lan.$t("xiayige")}}
-
周日
-
周一
-
周二
-
周三
-
周四
-
周五
-
周六
+
{{lan.$t("zhouri")}}
+
{{lan.$t("zhouyi")}}
+
{{lan.$t("zhouer")}}
+
{{lan.$t("zhousan")}}
+
{{lan.$t("zhousi")}}
+
{{lan.$t("zhouwu")}}
+
{{lan.$t("zhouliu")}}
@@ -195,14 +195,14 @@ import { getdate, getDay } from "@/utils/date" import { getdatelist } from '@/api'; import store from '@/store'; import router from '@/router'; +import { useI18n } from '@/utils/i18n'; export default defineComponent({ props:{ }, setup(){ - console.log(1) - + const lan = useI18n(); const month: any = ref({zhou:0,data:[]}); const yue = ref(0); const userid = computed(() => { @@ -287,7 +287,8 @@ export default defineComponent({ shang, yue, navto, - gotolive + gotolive, + lan } } }) diff --git a/src/views/regime/week.vue b/src/views/regime/week.vue index b45d5ce..8d0056b 100644 --- a/src/views/regime/week.vue +++ b/src/views/regime/week.vue @@ -15,26 +15,26 @@
+
+ {{lan.$t("zhouri")}}{{ week.date[0].day }} +
- 周一{{ week.date[0].day }} + {{lan.$t("zhouyi")}}{{ week.date[1].day }}
- 周二{{ week.date[1].day }} + {{lan.$t("zhouer")}}{{ week.date[2].day }}
- 周三{{ week.date[2].day }} + {{lan.$t("zhousan")}}{{ week.date[3].day }}
- 周四{{ week.date[3].day }} + {{lan.$t("zhousi")}}{{ week.date[4].day }}
- 周五{{ week.date[4].day }} + {{lan.$t("zhouwu")}}{{ week.date[5].day }}
- 周六{{ week.date[5].day }} -
-
- 周日{{ week.date[6].day }} + {{lan.$t("zhouliu")}}{{ week.date[6].day }}
@@ -256,6 +256,7 @@ import { getdatelist, userinfo } from '@/api'; import router from '@/router'; import dayjs from 'dayjs'; import { useRoute } from 'vue-router'; +import { useI18n } from '@/utils/i18n'; export default defineComponent({ props: {}, @@ -265,7 +266,7 @@ export default defineComponent({ const time: any = useRoute().query.time; let userid = userinfo.value.memberid; const week = ref(getweek(time, userinfo.value.zoneValue)); - + const lan = useI18n() function getdates(userid: number){ getdatelist(week.value.start, week.value.end, userid).then((res: any)=>{ console.log(res) @@ -358,7 +359,8 @@ export default defineComponent({ top, times, xs, - tolive + tolive, + lan }; }, });