This commit is contained in:
2020-11-24 18:22:45 +08:00
parent 546270f4aa
commit c73e27774e
5 changed files with 40 additions and 27 deletions

View File

@@ -3,26 +3,26 @@
<div class="head">
<div @click="shang">
<img src="../../static/images/left.png" alt="">
上一月
{{lan.$t("shangyige")}}
</div>
{{month.year}}{{month.yue}}
{{month.year}}{{lan.$t("nian")}}{{month.yue}}{{lan.$t("yues")}}
<a-button type="primary" class="button" @click="navto()">
周日历
{{lan.$t("zhourili")}}
</a-button>
<div @click="xia">
下一月
{{lan.$t("xiayige")}}
<img src="../../static/images/right.png" alt="">
</div>
</div>
<div class="yue">
<div class="heads">
<div :class="{zhou: yue == 0 && month.zhou == 0}">周日</div>
<div :class="{zhou: yue == 0 && month.zhou == 1}">周一</div>
<div :class="{zhou: yue == 0 && month.zhou == 2}">周二</div>
<div :class="{zhou: yue == 0 && month.zhou == 3}">周三</div>
<div :class="{zhou: yue == 0 && month.zhou == 4}">周四</div>
<div :class="{zhou: yue == 0 && month.zhou == 5}">周五</div>
<div :class="{zhou: yue == 0 && month.zhou == 6}">周六</div>
<div :class="{zhou: yue == 0 && month.zhou == 0}">{{lan.$t("zhouri")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 1}">{{lan.$t("zhouyi")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 2}">{{lan.$t("zhouer")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 3}">{{lan.$t("zhousan")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 4}">{{lan.$t("zhousi")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 5}">{{lan.$t("zhouwu")}}</div>
<div :class="{zhou: yue == 0 && month.zhou == 6}">{{lan.$t("zhouliu")}}</div>
</div>
<div class="body">
<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 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
}
}
})

View File

@@ -15,26 +15,26 @@
<div class="week">
<div class="heads">
<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 }">
周一<span>{{ week.date[0].day }}</span>
{{lan.$t("zhouyi")}}<span>{{ week.date[1].day }}</span>
</div>
<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 :class="{ zhou: zhou == 0 && week.zhou == 3 }">
周三<span>{{ week.date[2].day }}</span>
{{lan.$t("zhousan")}}<span>{{ week.date[3].day }}</span>
</div>
<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 :class="{ zhou: zhou == 0 && week.zhou == 5 }">
周五<span>{{ week.date[4].day }}</span>
{{lan.$t("zhouwu")}}<span>{{ week.date[5].day }}</span>
</div>
<div :class="{ zhou: zhou == 0 && week.zhou == 6 }">
周六<span>{{ week.date[5].day }}</span>
</div>
<div :class="{ zhou: zhou == 0 && week.zhou == 0 }">
周日<span>{{ week.date[6].day }}</span>
{{lan.$t("zhouliu")}}<span>{{ week.date[6].day }}</span>
</div>
</div>
<div class="body">
@@ -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<any>(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
};
},
});