添加了加载中 日历完成一般
This commit is contained in:
@@ -39,21 +39,21 @@
|
||||
</div>
|
||||
<div class="body">
|
||||
<div class="row" v-for="item in 24" :key="item">
|
||||
<div class="day date">
|
||||
{{ item > 10 ? item - 1 : "0" + (item - 1) }}:00-{{
|
||||
item > 9 ? item : "0" + item
|
||||
}}:00
|
||||
</div>
|
||||
<div v-for="i in 7" :key="i">
|
||||
<div class="day">
|
||||
<div class="">
|
||||
<div class="one-line-hide">
|
||||
one-line-hideon
|
||||
<div class="day date">
|
||||
{{ item > 10 ? item - 1 : "0" + (item - 1) }}:00-{{
|
||||
item > 9 ? item : "0" + item
|
||||
}}:00
|
||||
</div>
|
||||
<div v-for="i in 7" :key="i">
|
||||
<div class="day">
|
||||
<div class="next" v-if="week.date[i -1].list[item - 1].title != ''">
|
||||
<div class="one-line-hide" style="max-width: 1.5rem">
|
||||
{{week.date[i -1].list[item - 1].title}}
|
||||
</div>
|
||||
<div>{{week.date[i -1].list[item - 1].time}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>11:00-11:00</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -176,7 +176,8 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 11px;
|
||||
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
> div:last-child {
|
||||
font-size: 11px;
|
||||
margin-top: 8px;
|
||||
@@ -185,6 +186,7 @@
|
||||
.old {
|
||||
background-color: #f7f7f7;
|
||||
color: #111;
|
||||
|
||||
}
|
||||
.ing {
|
||||
background-color: #0dbba4;
|
||||
@@ -206,17 +208,42 @@
|
||||
</style>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, watch } from "vue";
|
||||
import { getweek } from "@/utils/date";
|
||||
import { getDay, gethour, getminute, gettime, getweek } from "@/utils/date";
|
||||
import store from '@/store';
|
||||
import { getdatelist, userinfo } from '@/api';
|
||||
|
||||
export default defineComponent({
|
||||
props: {},
|
||||
setup() {
|
||||
const zhou = ref(0);
|
||||
const week = ref(getweek());
|
||||
const week = ref<any>(getweek());
|
||||
const userid = store.state.userinfo.memberid;
|
||||
console.log(week.value);
|
||||
getdates(userid);
|
||||
function getdates(userid: number){
|
||||
getdatelist(week.value.start, week.value.end, userid).then((res: any)=>{
|
||||
console.log(res)
|
||||
for(let i in res){
|
||||
const day = getDay(res[i].dateline)
|
||||
console.log(day)
|
||||
for(let j in week.value.date){
|
||||
console.log(getDay(week.value.date[j].day))
|
||||
if(day == getDay(week.value.date[j].day)){
|
||||
console.log("fuzhi")
|
||||
week.value.date[j].list[gethour(res[i].dateline)].start = getminute(res[i].dateline);
|
||||
week.value.date[j].list[gethour(res[i].dateline)].num = res[i].livetime
|
||||
week.value.date[j].list[gethour(res[i].dateline)].title = res[i].title
|
||||
week.value.date[j].list[gethour(res[i].dateline)].time = gettime(res[i].dateline, res[i].livetime)
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(week.value)
|
||||
})
|
||||
}
|
||||
watch(zhou, (value) => {
|
||||
week.value = getweek(value);
|
||||
console.log(week.value);
|
||||
getdates(userid)
|
||||
});
|
||||
return {
|
||||
zhou,
|
||||
|
||||
Reference in New Issue
Block a user