diff --git a/src/renderer/src/components/SubjectInfo.vue b/src/renderer/src/components/SubjectInfo.vue index 4e3cc6e..c2c28bc 100644 --- a/src/renderer/src/components/SubjectInfo.vue +++ b/src/renderer/src/components/SubjectInfo.vue @@ -11,6 +11,7 @@ 考试状态: {{ statusText }}
考试即将结束
+
剩余时间: {{ remainingTime }}
@@ -69,6 +70,27 @@ const isWarning = computed(() => { return now.value >= fifteenMinutesBeforeEnd && now.value < end; }); +const showRemainingTime = computed(() => { + if (!props.exam) return false; + + const start = new Date(props.exam.start); + const end = new Date(props.exam.end); + const fifteenMinutesBeforeStart = new Date(start.getTime() - 15 * 60 * 1000); + + return now.value >= fifteenMinutesBeforeStart && now.value < end; +}); + +const remainingTime = computed(() => { + if (!props.exam) return ''; + + const end = new Date(props.exam.end); + const timeDiff = end.getTime() - now.value.getTime(); + const minutes = Math.floor(timeDiff / (1000 * 60)); + const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000); + + return `${minutes}分${seconds}秒`; +}); + // Update the current time every second const updateNow = () => { now.value = new Date(); @@ -86,6 +108,10 @@ updateNow(); color: #ffc107 !important; /* Vuetify's default warning color */ } +.text--info { + color: #17a2b8 !important; /* Info color */ +} + .status-before { color: orange; } diff --git a/src/renderer/src/pages/about.vue b/src/renderer/src/pages/about.vue index 9ddbc5f..985dfa0 100644 --- a/src/renderer/src/pages/about.vue +++ b/src/renderer/src/pages/about.vue @@ -12,7 +12,7 @@

版本号: 1.1.0-Malkuth

开发者:Hello8963 & Mkstoler4096