This commit is contained in:
luyuan 2020-11-24 18:22:45 +08:00
parent 546270f4aa
commit c73e27774e
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3
5 changed files with 40 additions and 27 deletions

View File

@ -319,13 +319,18 @@ export default {
paiming: "rank", paiming: "rank",
wo: "my", wo: "my",
yizhucexuesheng: "This number is already registered as a student", yizhucexuesheng: "This number is already registered as a student",
zhouri:"baiSunday", zhouri:"Sunday",
zhouyi:"Monday", zhouyi:"Monday",
zhouer:"Tuesday", zhouer:"Tuesday",
zhousan:"Wednesday", zhousan:"Wednesday",
zhousi:"Thursday", zhousi:"Thursday",
zhouwu:"Friday", zhouwu:"Friday",
zhouliu:"Saturday", zhouliu:"Saturday",
shangyige:"previous",
xiayige:"next",
nian:"year",
yues:"month",
zhourili:"Week",
shichangtishi:"", shichangtishi:"",
renshutishi: '', renshutishi: '',
tixianzhu: "", tixianzhu: "",

View File

@ -326,6 +326,11 @@ export default {
zhousi:"周四", zhousi:"周四",
zhouwu:"周五", zhouwu:"周五",
zhouliu:"周六", zhouliu:"周六",
shangyige:"上一月",
xiayige:"下一月",
nian:"年",
yues:"月",
zhourili:"周日历",
shichangtishi:"", shichangtishi:"",
renshutishi: '', renshutishi: '',
tixianzhu:"", tixianzhu:"",

View File

@ -103,7 +103,7 @@ export function getweek(time: string, id: string,zhou?: number){
for(let i = 0; i < 7; i++){ for(let i = 0; i < 7; i++){
console.log(i); console.log(i);
now = now.day(i + 1) now = now.day(i)
date[i] = {day: ""}; 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].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 = [] date[i].list = []

View File

@ -3,26 +3,26 @@
<div class="head"> <div class="head">
<div @click="shang"> <div @click="shang">
<img src="../../static/images/left.png" alt=""> <img src="../../static/images/left.png" alt="">
上一月 {{lan.$t("shangyige")}}
</div> </div>
{{month.year}}{{month.yue}} {{month.year}}{{lan.$t("nian")}}{{month.yue}}{{lan.$t("yues")}}
<a-button type="primary" class="button" @click="navto()"> <a-button type="primary" class="button" @click="navto()">
周日历 {{lan.$t("zhourili")}}
</a-button> </a-button>
<div @click="xia"> <div @click="xia">
下一月 {{lan.$t("xiayige")}}
<img src="../../static/images/right.png" alt=""> <img src="../../static/images/right.png" alt="">
</div> </div>
</div> </div>
<div class="yue"> <div class="yue">
<div class="heads"> <div class="heads">
<div :class="{zhou: yue == 0 && month.zhou == 0}">周日</div> <div :class="{zhou: yue == 0 && month.zhou == 0}">{{lan.$t("zhouri")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 1}">周一</div> <div :class="{zhou: yue == 0 && month.zhou == 1}">{{lan.$t("zhouyi")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 2}">周二</div> <div :class="{zhou: yue == 0 && month.zhou == 2}">{{lan.$t("zhouer")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 3}">周三</div> <div :class="{zhou: yue == 0 && month.zhou == 3}">{{lan.$t("zhousan")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 4}">周四</div> <div :class="{zhou: yue == 0 && month.zhou == 4}">{{lan.$t("zhousi")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 5}">周五</div> <div :class="{zhou: yue == 0 && month.zhou == 5}">{{lan.$t("zhouwu")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 6}">周六</div> <div :class="{zhou: yue == 0 && month.zhou == 6}">{{lan.$t("zhouliu")}}</div>
</div> </div>
<div class="body"> <div class="body">
<div class="row" v-for="(item,index) in month.date" :key="index"> <div class="row" v-for="(item,index) in month.date" :key="index">
@ -195,14 +195,14 @@ import { getdate, getDay } from "@/utils/date"
import { getdatelist } from '@/api'; import { getdatelist } from '@/api';
import store from '@/store'; import store from '@/store';
import router from '@/router'; import router from '@/router';
import { useI18n } from '@/utils/i18n';
export default defineComponent({ export default defineComponent({
props:{ props:{
}, },
setup(){ setup(){
console.log(1) const lan = useI18n();
const month: any = ref({zhou:0,data:[]}); const month: any = ref({zhou:0,data:[]});
const yue = ref(0); const yue = ref(0);
const userid = computed(() => { const userid = computed(() => {
@ -287,7 +287,8 @@ export default defineComponent({
shang, shang,
yue, yue,
navto, navto,
gotolive gotolive,
lan
} }
} }
}) })

View File

@ -15,26 +15,26 @@
<div class="week"> <div class="week">
<div class="heads"> <div class="heads">
<div></div> <div></div>
<div :class="{ zhou: zhou == 0 && week.zhou == 0 }">
{{lan.$t("zhouri")}}<span>{{ week.date[0].day }}</span>
</div>
<div :class="{ zhou: zhou == 0 && week.zhou == 1 }"> <div :class="{ zhou: zhou == 0 && week.zhou == 1 }">
周一<span>{{ week.date[0].day }}</span> {{lan.$t("zhouyi")}}<span>{{ week.date[1].day }}</span>
</div> </div>
<div :class="{ zhou: zhou == 0 && week.zhou == 2 }"> <div :class="{ zhou: zhou == 0 && week.zhou == 2 }">
周二<span>{{ week.date[1].day }}</span> {{lan.$t("zhouer")}}<span>{{ week.date[2].day }}</span>
</div> </div>
<div :class="{ zhou: zhou == 0 && week.zhou == 3 }"> <div :class="{ zhou: zhou == 0 && week.zhou == 3 }">
周三<span>{{ week.date[2].day }}</span> {{lan.$t("zhousan")}}<span>{{ week.date[3].day }}</span>
</div> </div>
<div :class="{ zhou: zhou == 0 && week.zhou == 4 }"> <div :class="{ zhou: zhou == 0 && week.zhou == 4 }">
周四<span>{{ week.date[3].day }}</span> {{lan.$t("zhousi")}}<span>{{ week.date[4].day }}</span>
</div> </div>
<div :class="{ zhou: zhou == 0 && week.zhou == 5 }"> <div :class="{ zhou: zhou == 0 && week.zhou == 5 }">
周五<span>{{ week.date[4].day }}</span> {{lan.$t("zhouwu")}}<span>{{ week.date[5].day }}</span>
</div> </div>
<div :class="{ zhou: zhou == 0 && week.zhou == 6 }"> <div :class="{ zhou: zhou == 0 && week.zhou == 6 }">
周六<span>{{ week.date[5].day }}</span> {{lan.$t("zhouliu")}}<span>{{ week.date[6].day }}</span>
</div>
<div :class="{ zhou: zhou == 0 && week.zhou == 0 }">
周日<span>{{ week.date[6].day }}</span>
</div> </div>
</div> </div>
<div class="body"> <div class="body">
@ -256,6 +256,7 @@ import { getdatelist, userinfo } from '@/api';
import router from '@/router'; import router from '@/router';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from '@/utils/i18n';
export default defineComponent({ export default defineComponent({
props: {}, props: {},
@ -265,7 +266,7 @@ export default defineComponent({
const time: any = useRoute().query.time; const time: any = useRoute().query.time;
let userid = userinfo.value.memberid; let userid = userinfo.value.memberid;
const week = ref<any>(getweek(time, userinfo.value.zoneValue)); const week = ref<any>(getweek(time, userinfo.value.zoneValue));
const lan = useI18n()
function getdates(userid: number){ function getdates(userid: number){
getdatelist(week.value.start, week.value.end, userid).then((res: any)=>{ getdatelist(week.value.start, week.value.end, userid).then((res: any)=>{
console.log(res) console.log(res)
@ -358,7 +359,8 @@ export default defineComponent({
top, top,
times, times,
xs, xs,
tolive tolive,
lan
}; };
}, },
}); });