在预约和验证页面显示倒计时

This commit is contained in:
cxc
2022-10-19 11:52:41 +08:00
parent b7a3446efc
commit 05cbb62aba
7 changed files with 83 additions and 25 deletions

View File

@ -1,7 +1,8 @@
<template> <template>
<div class="count-down" v-if="durationTime > 0"> <div class="count-down">
<div class="title">会议倒计时</div> <!-- <div class="title">会议倒计时</div> -->
<div class="count">{{ remainTime }}</div> <div v-if="durationTime > 0" class="count">将在{{ remainTime }}后开始</div>
<div v-else class="count">已开始</div>
</div> </div>
</template> </template>
<script setup name="CountDown"> <script setup name="CountDown">
@ -28,8 +29,8 @@ onMounted(() => {
} }
const duraDayjs = dayjs.duration(durationTime.value); const duraDayjs = dayjs.duration(durationTime.value);
remainTime.value = `${parseInt( remainTime.value = `${parseInt(
duraDayjs.asHours() duraDayjs.asDays()
)}${duraDayjs.minutes()}${duraDayjs.seconds()}`; )}${duraDayjs.hours()}${duraDayjs.minutes()}${duraDayjs.seconds()}`;
}, 500); }, 500);
}); });
onUnmounted(() => { onUnmounted(() => {
@ -39,21 +40,21 @@ onUnmounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
.count-down { .count-down {
position: absolute; // position: absolute;
z-index: -1; // z-index: -1;
top: 20%; // top: 20%;
left: 50%; // left: 50%;
transform: translate(-50%, -50%); // transform: translate(-50%, -50%);
display: flex; // display: flex;
flex-direction: column; // flex-direction: column;
align-items: center; // align-items: center;
.title { // .title {
font-size: 24px; // font-size: 16px;
font-weight: bold; // font-weight: bold;
} // }
.count { .count {
font-size: 36px; font-size: 16px;
margin-top: 20px; // margin-top: 20px;
} }
} }
</style> </style>

View File

@ -0,0 +1,30 @@
@media only screen and (max-width: 768px) {
.meeting-cover {
width: 100%;
display: block;
margin: 0 auto;
}
.meeting-title {
font-size: 7vw;
}
.meeting-time {
flex-direction: column;
align-items: center;
font-size: 5vw;
}
.meeting-time .title {
margin-right: 3vw;
}
.meeting-time :not(:last-child) {
margin-right: 0px;
}
.form-container {
padding: 0 2vw 0;
}
.form-container .joinuser-item {
width: 100%;
}
.form-container .joinuser-item :deep(.el-form-item__label) {
width: 70px;
}
}

1
src/style/appoint-mobile.min.css vendored Normal file
View File

@ -0,0 +1 @@
@media only screen and (max-width: 768px){.meeting-cover{width:100%;display:block;margin:0 auto}.meeting-title{font-size:7vw}.meeting-time{flex-direction:column;align-items:center;font-size:5vw}.meeting-time .title{margin-right:3vw}.meeting-time :not(:last-child){margin-right:0px}.form-container{padding:0 2vw 0}.form-container .joinuser-item{width:100%}.form-container .joinuser-item :deep(.el-form-item__label){width:70px}}

View File

@ -12,10 +12,15 @@
font-size: 7vw; font-size: 7vw;
} }
.meeting-time { .meeting-time {
flex-direction: column;
align-items: center;
font-size: 5vw; font-size: 5vw;
.title { .title {
margin-right: 3vw; margin-right: 3vw;
} }
:not(:last-child) {
margin-right: 0px;
}
} }
.form-container { .form-container {
padding: 0 2vw 0; padding: 0 2vw 0;

View File

@ -6,8 +6,9 @@
/> />
<h3 class="meeting-title">{{ meeting.meetingName }}</h3> <h3 class="meeting-title">{{ meeting.meetingName }}</h3>
<p class="meeting-time"> <p class="meeting-time">
<span class="title">会议时间</span> <span class="title">会议开始时间</span>
<span class="time">{{ meeting.startTime }}</span> <span class="time">{{ meeting.startTime }}</span>
<CountDown :start-time="meeting.startTime" />
</p> </p>
<div class="form-container" v-if="appointStatus === `pending`"> <div class="form-container" v-if="appointStatus === `pending`">
<el-form <el-form
@ -261,6 +262,7 @@
</template> </template>
<script setup> <script setup>
import CountDown from "@/components/countDown.vue";
import { reactive, ref, toRefs } from "vue"; import { reactive, ref, toRefs } from "vue";
import { getMeetingDetailById, newAppointment } from "@/api/meeting"; import { getMeetingDetailById, newAppointment } from "@/api/meeting";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
@ -533,7 +535,12 @@ loadMeetingDetail(meetingId.value);
} }
.meeting-time { .meeting-time {
text-align: center; // text-align: center;
display: flex;
justify-content: center;
:not(:last-child) {
margin-right: 12px;
}
} }
.form-item-container { .form-item-container {

View File

@ -6,8 +6,9 @@
/> />
<h3 class="meeting-title">{{ meeting.meetingName }}</h3> <h3 class="meeting-title">{{ meeting.meetingName }}</h3>
<p class="meeting-time"> <p class="meeting-time">
<span class="title">会议时间</span> <span class="title">会议开始时间</span>
<span class="time">{{ meeting.startTime }}</span> <span class="time">{{ meeting.startTime }}</span>
<CountDown :start-time="meeting.startTime" />
</p> </p>
<div class="form-container"> <div class="form-container">
<el-form <el-form
@ -66,6 +67,7 @@
</template> </template>
<script setup> <script setup>
import CountDown from "@/components/countDown.vue";
import { reactive, ref, toRefs } from "vue"; import { reactive, ref, toRefs } from "vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
@ -128,7 +130,12 @@ const submitVerify = async (newJoinUserRef) => {
text-align: center; text-align: center;
} }
.meeting-time { .meeting-time {
text-align: center; // text-align: center;
display: flex;
justify-content: center;
:not(:last-child) {
margin-right: 12px;
}
} }
.form-item-container { .form-item-container {
display: flex; display: flex;

View File

@ -6,8 +6,9 @@
/> />
<h3 class="meeting-title">{{ meeting.meetingName }}</h3> <h3 class="meeting-title">{{ meeting.meetingName }}</h3>
<p class="meeting-time"> <p class="meeting-time">
<span class="title">会议时间</span> <span class="title">会议开始时间</span>
<span class="time">{{ meeting.startTime }}</span> <span class="time">{{ meeting.startTime }}</span>
<CountDown :start-time="meeting.startTime" />
</p> </p>
<div class="form-container"> <div class="form-container">
<el-form <el-form
@ -392,6 +393,7 @@
</template> </template>
<script setup> <script setup>
import CountDown from "@/components/countDown.vue";
import { reactive, ref, toRefs } from "vue"; import { reactive, ref, toRefs } from "vue";
import { registerJoinUser, visitorJoinUser } from "@/api/meeting"; import { registerJoinUser, visitorJoinUser } from "@/api/meeting";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
@ -644,7 +646,12 @@ const submitVerify = async (newJoinUserRef) => {
text-align: center; text-align: center;
} }
.meeting-time { .meeting-time {
text-align: center; // text-align: center;
display: flex;
justify-content: center;
:not(:last-child) {
margin-right: 12px;
}
} }
.form-item-container { .form-item-container {
display: flex; display: flex;