diff --git a/src/modules/01_exam/components/ExamPayment.vue b/src/modules/01_exam/components/ExamPayment.vue index 1cd8d90..39b42fe 100644 --- a/src/modules/01_exam/components/ExamPayment.vue +++ b/src/modules/01_exam/components/ExamPayment.vue @@ -1,56 +1,28 @@ @@ -78,41 +50,44 @@ import { log } from 'console' import { defineComponent, ref, Ref } from 'vue' import { onMounted } from 'vue' import { ComponentRef } from '@vue/runtime-core' +const status = ref('') + +const img = ref('https://cdn-icons-png.flaticon.com/512/2496/2496846.png') -const img1 = ref('https://cdn-icons-png.flaticon.com/512/2496/2496846.png') -const img2 = ref('') const uploadImg = (file: any) => { - img1.value = - 'https://s359.kapook.com/r/600/auto/pagebuilder/ba154685-db18-4ac7-b318-a4a2b15b9d4c.jpg' - img2.value = 'https://f.ptcdn.info/914/078/000/rkq4y4prgcMlHAUfb3h-o.jpg' - console.log('string') + // img.value = + // 'https://s359.kapook.com/r/600/auto/pagebuilder/ba154685-db18-4ac7-b318-a4a2b15b9d4c.jpg' + img.value = + 'https://www.bangkokbank.com/-/media/feature/page-content/bbl-corporate/image-carousel-slides/digital-banking/bualuang-mbanking/how-to-use/payment/others/7_en.png' } -const badgeOutline = ref(true) -const badgeColor = ref('blue') -const badgeLabel = ref('รออัปโหลดหลักฐานชำระเงิน') + const slide = ref(1) -function updateBadge(): void { - badgeColor.value = 'orange' - badgeLabel.value = 'รอการตรวจสอบ' +const setStatus = (val: string) => { + status.value = val } -function updateBadgeReject(): void { - badgeColor.value = 'red' - badgeLabel.value = 'หลักฐานการชำระเงินผิดพลาด' -} -function updateBadgeSuceed(): void { - badgeColor.value = 'primary' - badgeLabel.value = 'ตรวจสอบเเล้ว' -} -function removeSlide(slide: Ref, carouselRef: ComponentRef): void { - // Get the current index of the slide - const currentSlide = slide.value - // Remove the current slide from the array - carouselRef.value.removeSlide(currentSlide) - - // If the current slide was the last one, go back one slide - if (slide.value === carouselRef.value.slides.length) { - slide.value -= 1 +const getClass = (val: string) => { + switch (val) { + case 'processing': + return 'bg-lime-12' + case 'rejected': + return 'bg-deep-orange-4' + case 'success': + return 'bg-green-12' + default: + return 'bg-blue-grey-2' + } +} +const message = (val: string) => { + switch (val) { + case 'processing': + return 'รอการตรวจสอบ' + case 'rejected': + return 'หลักฐานการชำระเงินผิดพลาด' + case 'success': + return 'ตรวจสอบเเล้ว' + default: + return 'รออัปโหลดหลักฐานชำระเงิน' } } @@ -121,8 +96,4 @@ function removeSlide(slide: Ref, carouselRef: ComponentRef): void { .q-img { margin: 0 auto; } -.my-carousel { - width: 100%; /* Set the width to 100% of the parent container */ - height: 500px; /* Set the height to the desired value */ -}