ดิง id สมัครสอบจาก path

This commit is contained in:
Kittapath 2023-03-29 12:54:32 +07:00
parent d8e47aad92
commit b5c6c83d62
11 changed files with 75 additions and 31 deletions

View file

@ -81,25 +81,28 @@ import ExamForm from '@/modules/01_exam/components/ExamForm.vue'
import ExamPayment from '@/modules/01_exam/components/ExamPayment.vue'
import ExamFinished from '@/modules/01_exam/components/ExamFinished.vue'
import Conference from '@/modules/01_exam/components/Conference.vue'
import { useRoute } from 'vue-router'
const $q = useQuasar()
const store = useExamDataStore()
const step = ref<number>(1)
const stepRaw = ref<number>(1)
const tittle = ref<string>('การสอบภาค ข. พิเศษ สำหรับผู้สอบผ่านของส่วนราชการแล้ว ทดสอบ')
const candidateId = ref<string>('2223ba53-2fb2-470b-8dc1-27e5471b0331')
const tittle = ref<string>('')
const route = useRoute()
const examId = ref<string>(route.params.id.toString())
const loader = ref<boolean>(false)
const status = ref<string>('register')
const modalConsend = ref<boolean>(false)
onMounted(async () => {
await fetchPeriodExam()
await candidateCheck()
})
const candidateCheck = async () => {
loader.value = true
await http
.get(config.API.candidateCheckCreate(candidateId.value))
.get(config.API.candidateCheckCreate(examId.value))
.then(async (res) => {
const data = res.data.result
store.consend = data
@ -120,7 +123,7 @@ const candidateCheck = async () => {
const fetchStep = async () => {
loader.value = true
await http
.get(config.API.candidateStatus(candidateId.value))
.get(config.API.candidateStatus(examId.value))
.then((res) => {
const data = res.data.result
status.value = data
@ -156,6 +159,20 @@ const fetchStep = async () => {
})
}
const fetchPeriodExam = async () => {
loader.value = true
await http
.get(config.API.periodExamId(examId.value))
.then((res) => {
const data = res.data.result
tittle.value = data.name
})
.catch(() => {})
.finally(() => {
loader.value = false
})
}
const consenClose = () => {
modalConsend.value = false
}