diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 3c00ae1..e51ba38 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -26,7 +26,7 @@ const statusCheckin = ref(true) // สถานะเวลา เข const checkDate = ref(null) const msgCheckTime = ref('') // ข้อความแจ้งเตือน -const isDisabledCheckTime = ref(false) // ข้อความแจ้งเตือน +const isDisabledCheckTime = ref(null) // ข้อความแจ้งเตือน const isErr = ref(null) // ข้อความแจ้งเตือน const endTimeAfternoon = ref('12:00:00') //เวลาเช็คเอาท์ตามรอบ @@ -46,9 +46,14 @@ async function fetchCheckTime(load: any = true) { statusCheckin.value = data.checkInId ? false : true checkInId.value = data.checkInId ? data.checkInId : '' endTimeAfternoon.value = data.endTimeAfternoon + isDisabledCheckTime.value = false }) .catch((err) => { - if (err.response.status === 500) { + if ( + err.response.status === 500 && + err.response.data.message === + 'คุณได้ทำการลงเวลาเข้าและออกเรียบร้อยแล้ว คุณจะสามารถลงเวลาได้อีกครั้งในวันถัดไป' + ) { isErr.value = true isDisabledCheckTime.value = true msgCheckTime.value = err.response.data.message @@ -304,9 +309,6 @@ async function capturePhoto() { await camera.value?.stop() const url = URL.createObjectURL(imageBlob) img.value = url - - // เริ่มนับเวลา 3 นาที เพื่อลบรูป - startPhotoTimeout() } /** function เปลี่ยนรูปภาพ*/ @@ -593,7 +595,7 @@ watch( class="col-12 q-pa-md items-center gt-xs" v-if="isLoadingCheckTime" > - +
@@ -660,7 +662,9 @@ watch(
-
+
-
+
*{{ msgCheckTime }}
@@ -1044,7 +1051,7 @@ watch( -
+