update flow final
This commit is contained in:
No files matched your search
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
{
|
||||||
|
}
|
||||||
+62
-82
@@ -4,29 +4,29 @@
|
|||||||
<div class="logo-group-contact">
|
<div class="logo-group-contact">
|
||||||
<v-img
|
<v-img
|
||||||
src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/74/Coat_of_arms_of_East_Java.svg/1456px-Coat_of_arms_of_East_Java.svg.png"
|
src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/74/Coat_of_arms_of_East_Java.svg/1456px-Coat_of_arms_of_East_Java.svg.png"
|
||||||
width="60"
|
width="50"
|
||||||
height="60"
|
height="50"
|
||||||
class="logo-img-contact"
|
class="logo-img-contact"
|
||||||
contain
|
contain
|
||||||
/>
|
/>
|
||||||
<v-img
|
<v-img
|
||||||
src="https://static.wikia.nocookie.net/logopedia/images/1/15/Rumah_Sakit_Umum_Daerah_Dr._Saiful_Anwar.png"
|
src="https://static.wikia.nocookie.net/logopedia/images/1/15/Rumah_Sakit_Umum_Daerah_Dr._Saiful_Anwar.png"
|
||||||
width="60"
|
width="50"
|
||||||
height="60"
|
height="50"
|
||||||
class="logo-img-contact"
|
class="logo-img-contact"
|
||||||
contain
|
contain
|
||||||
/>
|
/>
|
||||||
<v-img
|
<v-img
|
||||||
src="https://www.menpan.go.id/site/images/berita_foto_backup/2021/sipanday_berakhlak_bangga-melayani-bangsa/Logo_BerAKHLAK.png"
|
src="https://www.menpan.go.id/site/images/berita_foto_backup/2021/sipanday_berakhlak_bangga-melayani-bangsa/Logo_BerAKHLAK.png"
|
||||||
width="60"
|
width="50"
|
||||||
height="60"
|
height="50"
|
||||||
class="logo-img-contact"
|
class="logo-img-contact"
|
||||||
contain
|
contain
|
||||||
/>
|
/>
|
||||||
<v-img
|
<v-img
|
||||||
src="https://rsusaifulanwar.jatimprov.go.id/v2/img/KARS_RSSA.png"
|
src="https://rsusaifulanwar.jatimprov.go.id/v2/img/KARS_RSSA.png"
|
||||||
width="60"
|
width="50"
|
||||||
height="60"
|
height="50"
|
||||||
class="logo-img-contact"
|
class="logo-img-contact"
|
||||||
contain
|
contain
|
||||||
/>
|
/>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
:cycle="false"
|
:cycle="false"
|
||||||
:interval="0"
|
:interval="0"
|
||||||
class="banner-carousel"
|
class="banner-carousel"
|
||||||
height="450"
|
height="300"
|
||||||
:continuous="false"
|
:continuous="false"
|
||||||
>
|
>
|
||||||
<v-carousel-item
|
<v-carousel-item
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
class="thumbnail-img"
|
class="thumbnail-img"
|
||||||
/>
|
/>
|
||||||
<div class="play-button-overlay">
|
<div class="play-button-overlay">
|
||||||
<v-icon color="white" size="64">mdi-play-circle</v-icon>
|
<v-icon color="white" size="48">mdi-play-circle</v-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -110,50 +110,31 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="cta-section-contact">
|
|
||||||
<v-btn
|
|
||||||
@click="navigateToQrisPayment"
|
|
||||||
color="#FF9248"
|
|
||||||
class="cta-button"
|
|
||||||
x-large
|
|
||||||
>
|
|
||||||
<span class="button-text">LANJUT KE PEMBAYARAN</span>
|
|
||||||
</v-btn>
|
|
||||||
<v-btn
|
|
||||||
@click="navigateToDebugPage"
|
|
||||||
color="#FF9248"
|
|
||||||
class="cta-button debug-button"
|
|
||||||
x-large
|
|
||||||
>
|
|
||||||
<span class="button-text">DEBUG KE STEP 2</span>
|
|
||||||
</v-btn>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="orange-background-contact">
|
<div class="orange-background-contact">
|
||||||
<div class="contact-info-section-contact">
|
<div class="contact-info-section-contact">
|
||||||
<div class="contact-item-contact">
|
<div class="contact-item-contact">
|
||||||
<div class="contact-icon-contact whatsapp-icon">
|
<div class="contact-icon-contact whatsapp-icon">
|
||||||
<v-icon color="#25D366" size="28">mdi-whatsapp</v-icon>
|
<v-icon color="#25D366" size="24">mdi-whatsapp</v-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-text-contact">+62 815-5560-6668</div>
|
<div class="contact-text-contact">+62 815-5560-6668</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-item-contact">
|
<div class="contact-item-contact">
|
||||||
<div class="contact-icon-contact instagram-icon">
|
<div class="contact-icon-contact instagram-icon">
|
||||||
<v-icon color="#E1306C" size="28">mdi-instagram</v-icon>
|
<v-icon color="#E1306C" size="24">mdi-instagram</v-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-text-contact">rssasaifulanwar</div>
|
<div class="contact-text-contact">rssasaifulanwar</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-item-contact">
|
<div class="contact-item-contact">
|
||||||
<div class="contact-icon-contact phone-icon">
|
<div class="contact-icon-contact phone-icon">
|
||||||
<v-icon color="#FF9248" size="28">mdi-phone</v-icon>
|
<v-icon color="#FF9248" size="24">mdi-phone</v-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-text-contact">0341-362101</div>
|
<div class="contact-text-contact">0341-362101</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-item-contact">
|
<div class="contact-item-contact">
|
||||||
<div class="contact-icon-contact web-icon">
|
<div class="contact-icon-contact web-icon">
|
||||||
<v-icon color="#2196F3" size="28">mdi-web</v-icon>
|
<v-icon color="#2196F3" size="24">mdi-web</v-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-text-contact">rsusaifulanwar.jatimprov.go.id</div>
|
<div class="contact-text-contact">rsusaifulanwar.jatimprov.go.id</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -233,9 +214,8 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
.contact-page-container {
|
.contact-page-container {
|
||||||
min-height: 100vh;
|
min-height:auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: white;
|
background: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -244,29 +224,29 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
|
|
||||||
.orange-background-contact {
|
.orange-background-contact {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: clamp(120px, 15vh, 200px);
|
height: clamp(80px, 12vh, 180px);
|
||||||
background: #ff9248;
|
background: #ff9248;
|
||||||
border-top-left-radius: 60px;
|
border-top-left-radius: 40px;
|
||||||
border-top-right-radius: 60px;
|
border-top-right-radius: 40px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 10px;
|
||||||
margin-top: 2rem;
|
margin-top: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-section-contact {
|
.logo-section-contact {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
padding: 15px 20px;
|
padding: 8px 12px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-group-contact {
|
.logo-group-contact {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 2rem;
|
gap: 1rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -274,8 +254,8 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
|
|
||||||
.logo-img-contact {
|
.logo-img-contact {
|
||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
width: clamp(40px, 6vw, 60px) !important;
|
width: clamp(20px, 5vw, 50px) !important;
|
||||||
height: clamp(40px, 6vw, 60px) !important;
|
height: clamp(20px, 5vw, 50px) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-img-contact:hover {
|
.logo-img-contact:hover {
|
||||||
@@ -290,52 +270,52 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
padding: 10px 20px;
|
padding: 5px 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-section-contact {
|
.title-section-contact {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-title-contact {
|
.main-title-contact {
|
||||||
color: #ff9248;
|
color: #ff9248;
|
||||||
font-size: clamp(2.2rem, 5vw, 3.5rem);
|
font-size: clamp(2rem, 2vw, 1.5rem);
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 8px;
|
||||||
line-height: 1.2;
|
line-height: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.subtitle-contact {
|
.subtitle-contact {
|
||||||
color: black;
|
color: black;
|
||||||
font-size: clamp(0.9rem, 2vw, 1.1rem);
|
font-size: clamp(0.8rem, 1.8vw, 1rem);
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
max-width: 600px;
|
max-width: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner-carousel-container {
|
.banner-carousel-container {
|
||||||
width: 90%;
|
width: 95%;
|
||||||
max-width: 900px;
|
max-width: 800px;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-radius: 20px;
|
border-radius: 15px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.banner-carousel {
|
.banner-carousel {
|
||||||
border-radius: 20px;
|
border-radius: 15px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
height: 450px;
|
height: clamp(300px, 45vh, 400px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.carousel-item {
|
.carousel-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 450px;
|
height: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-container {
|
.video-container {
|
||||||
@@ -352,7 +332,7 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 20px;
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-thumbnail {
|
.video-thumbnail {
|
||||||
@@ -369,7 +349,7 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 20px;
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.play-button-overlay {
|
.play-button-overlay {
|
||||||
@@ -379,7 +359,7 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
background: rgba(0, 0, 0, 0.7);
|
background: rgba(0, 0, 0, 0.7);
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
padding: 20px;
|
padding: 15px;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,23 +375,23 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
right: 0;
|
right: 0;
|
||||||
background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
|
background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
|
||||||
color: white;
|
color: white;
|
||||||
padding: 40px 30px 30px;
|
padding: 30px 20px 20px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overlay-content {
|
.overlay-content {
|
||||||
max-width: 600px;
|
max-width: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overlay-title {
|
.overlay-title {
|
||||||
font-size: clamp(1.4rem, 2vw, 1.8rem);
|
font-size: clamp(1.2rem, 1.8vw, 1.6rem);
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 6px;
|
||||||
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.overlay-description {
|
.overlay-description {
|
||||||
font-size: clamp(0.9rem, 1.5vw, 1.1rem);
|
font-size: clamp(0.8rem, 1.3vw, 1rem);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
@@ -420,17 +400,17 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
|
|
||||||
.custom-indicators {
|
.custom-indicators {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 15px;
|
bottom: 10px;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 10px;
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.indicator-dot {
|
.indicator-dot {
|
||||||
width: 12px;
|
width: 10px;
|
||||||
height: 12px;
|
height: 10px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: rgba(255, 255, 255, 0.5);
|
background: rgba(255, 255, 255, 0.5);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -448,7 +428,7 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
|
|
||||||
.contact-info-section-contact {
|
.contact-info-section-contact {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 2rem;
|
gap: 1.5rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -459,18 +439,18 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact-icon-contact {
|
.contact-icon-contact {
|
||||||
width: clamp(40px, 8vw, 50px);
|
width: 35px;
|
||||||
height: clamp(40px, 8vw, 50px);
|
height: 35px;
|
||||||
border-radius: 50%;
|
border-radius: 80%;
|
||||||
background: white;
|
background: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
|
||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,7 +460,7 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
|
|
||||||
.contact-text-contact {
|
.contact-text-contact {
|
||||||
color: white;
|
color: white;
|
||||||
font-size: clamp(12px, 2vw, 14px);
|
font-size: 12px;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -490,13 +470,13 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 16px;
|
gap: 12px;
|
||||||
margin-top: 20px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cta-button {
|
.cta-button {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 300px;
|
max-width: 250px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
@@ -510,6 +490,6 @@ watch(currentSlide, (newSlide, oldSlide) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.v-carousel__controls--bottom) {
|
:deep(.v-carousel__controls--bottom) {
|
||||||
bottom: 50px !important;
|
bottom: 40px !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
+14
-10
@@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="payment-step">
|
<div class="payment-step">
|
||||||
<v-card-text class="pa-8 text-center">
|
<v-card-text class="pa-0 text-center">
|
||||||
<div class="mb-2">
|
<div class="mb-0">
|
||||||
<v-img
|
<v-img
|
||||||
src="https://iconlogovector.com/uploads/images/2024/03/lg-65ffda68a47ee-QRIS.webp"
|
src="https://iconlogovector.com/uploads/images/2024/03/lg-65ffda68a47ee-QRIS.webp"
|
||||||
height="100"
|
height="80"
|
||||||
class="mx-auto"
|
class="mb-1"
|
||||||
contain
|
contain
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 class="text-h4 mb-6 font-weight-bold">PINDAI KODE QR</h2>
|
<!-- <h2 class="text-h4 mb-6 font-weight-bold">PINDAI KODE QR</h2> -->
|
||||||
|
|
||||||
<div class="qr-container mb-6">
|
<div class="qr-container mb-6">
|
||||||
<v-card
|
<v-card
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="payment-details">
|
<div class="payment-details">
|
||||||
<v-row dense class="mb-2">
|
<v-row dense class="mb-1">
|
||||||
<v-col cols="5" class="text-left">
|
<v-col cols="5" class="text-left">
|
||||||
<strong>NAMA PASIEN:</strong>
|
<strong>NAMA PASIEN:</strong>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<v-row dense class="mb-2">
|
<v-row dense class="mb-1">
|
||||||
<v-col cols="5" class="text-left">
|
<v-col cols="5" class="text-left">
|
||||||
<strong>NOMINAL:</strong>
|
<strong>NOMINAL:</strong>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<v-row dense class="mb-2">
|
<v-row dense class="mb-1">
|
||||||
<v-col cols="5" class="text-left">
|
<v-col cols="5" class="text-left">
|
||||||
<strong>NOMOR TAGIHAN:</strong>
|
<strong>NOMOR TAGIHAN:</strong>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -60,9 +60,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex gap-4 justify-center">
|
<div class="d-flex gap-4 justify-center">
|
||||||
<v-btn color="grey" variant="outlined" @click="paymentStore.prevStep">
|
<!-- <v-btn color="grey" variant="outlined" @click="paymentStore.prevStep">
|
||||||
Kembali
|
Kembali
|
||||||
</v-btn>
|
</v-btn> -->
|
||||||
<v-btn color="primary" variant="flat" @click="paymentStore.nextStep">
|
<v-btn color="primary" variant="flat" @click="paymentStore.nextStep">
|
||||||
Simulasi Pembayaran
|
Simulasi Pembayaran
|
||||||
</v-btn>
|
</v-btn>
|
||||||
@@ -103,6 +103,10 @@ watch(() => paymentStore.qrData, () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.payment-content {
|
||||||
|
padding-top: 40px !important; /* Sesuaikan jarak atas */
|
||||||
|
padding-bottom: 40px !important; /* Sesuaikan jarak bawah */
|
||||||
|
}
|
||||||
.payment-step {
|
.payment-step {
|
||||||
background: rgb(233, 233, 233);
|
background: rgb(233, 233, 233);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
<template>
|
||||||
|
<div class="setup-container">
|
||||||
|
<v-card class="setup-card" elevation="4">
|
||||||
|
<v-card-title class="text-h5 text-center font-weight-bold">
|
||||||
|
Setup Loket Pembayaran
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text>
|
||||||
|
<div v-if="currentIp" class="mb-4 text-center">
|
||||||
|
<p class="text-subtitle-1 text-grey-darken-1">IP Loket Saat Ini:</p>
|
||||||
|
<p class="text-h5 font-weight-bold">{{ currentIp }}</p>
|
||||||
|
<v-btn
|
||||||
|
color="red"
|
||||||
|
variant="text"
|
||||||
|
size="small"
|
||||||
|
class="mt-2"
|
||||||
|
@click="clearIp"
|
||||||
|
>
|
||||||
|
Hapus IP
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<v-text-field
|
||||||
|
v-model="loketIp"
|
||||||
|
label="Masukkan IP Address Baru"
|
||||||
|
variant="outlined"
|
||||||
|
:rules="[rules.required, rules.ipAddress]"
|
||||||
|
hide-details="auto"
|
||||||
|
class="mt-4"
|
||||||
|
></v-text-field>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions class="justify-center">
|
||||||
|
<v-btn
|
||||||
|
color="primary"
|
||||||
|
@click="saveIpAddress"
|
||||||
|
:disabled="!isValidIp"
|
||||||
|
variant="flat"
|
||||||
|
>
|
||||||
|
Simpan dan Lanjutkan
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed, onMounted } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
const loketIp = ref('');
|
||||||
|
const currentIp = ref(null);
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const rules = {
|
||||||
|
required: value => !!value || 'IP Address wajib diisi.',
|
||||||
|
ipAddress: value => {
|
||||||
|
const pattern = /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/;
|
||||||
|
return pattern.test(value) || 'Format IP Address tidak valid.';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const isValidIp = computed(() => {
|
||||||
|
return loketIp.value && rules.ipAddress(loketIp.value) === true;
|
||||||
|
});
|
||||||
|
|
||||||
|
const saveIpAddress = () => {
|
||||||
|
if (isValidIp.value) {
|
||||||
|
localStorage.setItem('loketIp', loketIp.value);
|
||||||
|
console.log('IP Address disimpan:', loketIp.value);
|
||||||
|
router.push('/');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearIp = () => {
|
||||||
|
localStorage.removeItem('loketIp');
|
||||||
|
currentIp.value = null;
|
||||||
|
loketIp.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
currentIp.value = localStorage.getItem('loketIp');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.setup-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
background: linear-gradient(135deg, #ffd7b5 20%, #ff9248 100%);
|
||||||
|
}
|
||||||
|
.setup-card {
|
||||||
|
max-width: 400px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+141
-40
@@ -11,7 +11,11 @@
|
|||||||
'payment-centered': paymentStore.currentStep !== 1,
|
'payment-centered': paymentStore.currentStep !== 1,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<component :is="activeComponent" />
|
<component :is="activeComponent" v-if="hasIpAddress" />
|
||||||
|
<div v-else class="text-center pa-10">
|
||||||
|
<v-progress-circular indeterminate color="primary"></v-progress-circular>
|
||||||
|
<p class="mt-4">Memeriksa konfigurasi...</p>
|
||||||
|
</div>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -24,83 +28,180 @@ import { usePaymentStore } from '~/stores/payment';
|
|||||||
import Home from '~/components/Home.vue';
|
import Home from '~/components/Home.vue';
|
||||||
import QRISPayment from '~/components/QRISPayment.vue';
|
import QRISPayment from '~/components/QRISPayment.vue';
|
||||||
import Success from '~/components/PembayaranSukses.vue';
|
import Success from '~/components/PembayaranSukses.vue';
|
||||||
|
import Gagal from '~/components/PembayaranGagal.vue';
|
||||||
|
import { onMounted, onUnmounted, ref, computed, watch } from 'vue';
|
||||||
|
|
||||||
const paymentStore = usePaymentStore();
|
const paymentStore = usePaymentStore();
|
||||||
const apiURL = 'http://10.10.150.37:8084/api/v1/qris';
|
const router = useRouter();
|
||||||
|
const localIpAddress = ref(null);
|
||||||
|
const pollingInterval = ref(null);
|
||||||
|
|
||||||
|
const hasIpAddress = computed(() => !!localIpAddress.value);
|
||||||
|
const apiURL = 'http://10.10.150.68:8084/api/v1/qris/allstatus';
|
||||||
|
|
||||||
const paymentSteps = {
|
const paymentSteps = {
|
||||||
1: Home,
|
1: Home,
|
||||||
2: QRISPayment,
|
2: QRISPayment,
|
||||||
3: Success,
|
3: Success,
|
||||||
|
4: Gagal,
|
||||||
};
|
};
|
||||||
|
|
||||||
const activeComponent = computed(() => {
|
const activeComponent = computed(() => {
|
||||||
return paymentSteps[paymentStore.currentStep] || Home;
|
return paymentSteps[paymentStore.currentStep] || Home;
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data: apiData, refresh } = await useFetch(apiURL, {
|
// Watch untuk debugging perubahan step
|
||||||
server: false,
|
watch(() => paymentStore.currentStep, (newStep, oldStep) => {
|
||||||
immediate: false,
|
console.log(`Step berubah dari ${oldStep} ke ${newStep}`);
|
||||||
});
|
}, { immediate: true });
|
||||||
|
|
||||||
watch(apiData, (newData) => {
|
const startPolling = () => {
|
||||||
if (newData && newData.data && newData.data.length > 0) {
|
if (pollingInterval.value) {
|
||||||
const relevantData = newData.data[0];
|
clearInterval(pollingInterval.value);
|
||||||
if (relevantData) {
|
console.log('🛑 Stopping previous polling');
|
||||||
paymentStore.updatePayment({ data: [relevantData] });
|
|
||||||
clearInterval(pollingInterval);
|
|
||||||
console.log('Polling stopped. Data received from API.');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
let pollingInterval = null;
|
pollingInterval.value = setInterval(async () => {
|
||||||
|
try {
|
||||||
|
console.log(`🔄 POLLING - Step: ${paymentStore.currentStep}`);
|
||||||
|
const response = await $fetch(apiURL);
|
||||||
|
|
||||||
|
if (response?.data?.length > 0) {
|
||||||
|
|
||||||
|
if (paymentStore.currentStep === 1) {
|
||||||
|
// Step 1: Find data by IP address (original logic)
|
||||||
|
console.log('🔍 Step 1: Looking for IP:', localIpAddress.value);
|
||||||
|
const relevantData = response.data.find(item => item.ip === localIpAddress.value);
|
||||||
|
|
||||||
|
if (relevantData) {
|
||||||
|
console.log('✅ Data found for IP:', relevantData);
|
||||||
|
paymentStore.updatePayment({ data: [relevantData] });
|
||||||
|
paymentStore.currentStep = 2;
|
||||||
|
} else {
|
||||||
|
console.log('⏳ No data found for IP:', localIpAddress.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (paymentStore.currentStep === 2) {
|
||||||
|
// Step 2: Monitor payment status for THE SAME PATIENT
|
||||||
|
console.log('🔍 Step 2: Monitoring payment status...');
|
||||||
|
|
||||||
|
// Get patient identifiers from store (data yang sudah di-load di step 1)
|
||||||
|
const currentPatientBill = paymentStore.qrData.display_nobill;
|
||||||
|
const currentPatientName = paymentStore.qrData.display_name;
|
||||||
|
|
||||||
|
console.log('👤 Current patient:', {
|
||||||
|
name: currentPatientName,
|
||||||
|
bill: currentPatientBill
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!currentPatientBill || !currentPatientName) {
|
||||||
|
console.warn('⚠️ Patient data incomplete in store');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find ALL records for this same patient (same name + bill)
|
||||||
|
const samePatientRecords = response.data.filter(item => {
|
||||||
|
const sameBill = item.display_nobill === currentPatientBill;
|
||||||
|
const sameName = item.display_name === currentPatientName;
|
||||||
|
|
||||||
|
console.log(`🔄 Checking record: ${item.display_name} (${item.display_nobill}) status=${item.status}`);
|
||||||
|
console.log(` → Same patient? ${sameBill && sameName}`);
|
||||||
|
|
||||||
|
return sameBill && sameName;
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`📊 Found ${samePatientRecords.length} records for same patient:`,
|
||||||
|
samePatientRecords.map(r => `status: ${r.status}`));
|
||||||
|
|
||||||
|
// Now look for final status (success or fail) among same patient records
|
||||||
|
const successRecord = samePatientRecords.find(record => record.status === "2");
|
||||||
|
const failRecord = samePatientRecords.find(record => record.status === "0");
|
||||||
|
|
||||||
|
if (successRecord) {
|
||||||
|
console.log('🎉 SUCCESS STATUS FOUND!', successRecord);
|
||||||
|
paymentStore.updatePayment({ data: [successRecord] });
|
||||||
|
paymentStore.currentStep = 3;
|
||||||
|
clearInterval(pollingInterval.value);
|
||||||
|
|
||||||
|
// Auto return to home after 5 seconds
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log('🏠 Auto return to home');
|
||||||
|
paymentStore.reset();
|
||||||
|
startPolling();
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
|
} else if (failRecord) {
|
||||||
|
console.log('❌ FAIL STATUS FOUND!', failRecord);
|
||||||
|
paymentStore.updatePayment({ data: [failRecord] });
|
||||||
|
paymentStore.currentStep = 4;
|
||||||
|
clearInterval(pollingInterval.value);
|
||||||
|
|
||||||
|
// Auto return to home after 5 seconds
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log('🏠 Auto return to home');
|
||||||
|
paymentStore.reset();
|
||||||
|
startPolling();
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log('⏳ Still waiting for final status...');
|
||||||
|
console.log('Current statuses for this patient:',
|
||||||
|
samePatientRecords.map(r => r.status));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log('📭 No data in API response');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("❌ Polling error:", error);
|
||||||
|
}
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
|
console.log(`🚀 Polling started - IP-based patient detection`);
|
||||||
|
};
|
||||||
|
|
||||||
|
const checkAndRedirect = () => {
|
||||||
|
const savedIp = localStorage.getItem('loketIp');
|
||||||
|
if (!savedIp) {
|
||||||
|
console.warn('IP Address belum diatur. Mengarahkan ke halaman setup.');
|
||||||
|
router.push('/setup-ip');
|
||||||
|
} else {
|
||||||
|
localIpAddress.value = savedIp;
|
||||||
|
console.log('IP Address ditemukan:', savedIp);
|
||||||
|
startPolling();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (paymentStore.currentStep === 1) {
|
console.log('Component mounted, step saat ini:', paymentStore.currentStep);
|
||||||
pollingInterval = setInterval(() => {
|
checkAndRedirect();
|
||||||
refresh();
|
|
||||||
}, 500000);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
if (pollingInterval) {
|
if (pollingInterval.value) {
|
||||||
clearInterval(pollingInterval);
|
clearInterval(pollingInterval.value);
|
||||||
console.log('Polling stopped on unmount.');
|
console.log('Polling dihentikan saat unmount.');
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(() => paymentStore.currentStep, (newStep, oldStep) => {
|
|
||||||
if (newStep === 1 && oldStep !== 1) {
|
|
||||||
pollingInterval = setInterval(() => {
|
|
||||||
refresh();
|
|
||||||
}, 5000);
|
|
||||||
} else if (newStep !== 1 && pollingInterval) {
|
|
||||||
clearInterval(pollingInterval);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.medical-payment-app {
|
.medical-payment-app {
|
||||||
min-height: 100vh;
|
background: linear-gradient(135deg, #ff9248 20%, #ff9248 100%);
|
||||||
background: linear-gradient(135deg, #ffd7b5 20%, #ff9248 100%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.contact-fullscreen {
|
.contact-fullscreen {
|
||||||
height: 100vh !important;
|
|
||||||
max-width: none !important;
|
max-width: none !important;
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
.payment-centered {
|
.payment-centered {
|
||||||
max-width: 500px !important;
|
max-width: 500px !important;
|
||||||
margin-top: 2rem !important;
|
margin-top: 2rem !important;
|
||||||
|
margin-bottom: 2rem !important;
|
||||||
border-radius: 16px !important;
|
border-radius: 16px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.payment-card {
|
.payment-card {
|
||||||
background: white;
|
background: rgb(224, 224, 224);
|
||||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
// // src/stores/payment.js
|
||||||
|
// import { defineStore } from 'pinia';
|
||||||
|
|
||||||
|
// export const usePaymentStore = defineStore('payment', {
|
||||||
|
// state: () => ({
|
||||||
|
// currentStep: 1,
|
||||||
|
// patientInfo: {
|
||||||
|
// name: '',
|
||||||
|
// amount: '',
|
||||||
|
// expiry: '',
|
||||||
|
// },
|
||||||
|
// paymentData: null, // Tambahkan state ini untuk menyimpan data dari backend
|
||||||
|
// }),
|
||||||
|
// actions: {
|
||||||
|
// nextStep() {
|
||||||
|
// this.currentStep++;
|
||||||
|
// },
|
||||||
|
// prevStep() {
|
||||||
|
// this.currentStep--;
|
||||||
|
// },
|
||||||
|
// reset() {
|
||||||
|
// this.currentStep = 1;
|
||||||
|
// this.patientInfo = {};
|
||||||
|
// this.paymentData = null; // Reset data pembayaran
|
||||||
|
// },
|
||||||
|
// // Tambahkan action baru untuk menerima data dari WebSocket
|
||||||
|
// updatePayment(data: { patientName: any; amount: any; expiryDate: any; } | null) {
|
||||||
|
// this.paymentData = data;
|
||||||
|
// this.patientInfo = {
|
||||||
|
// name: data.patientName,
|
||||||
|
// amount: data.amount,
|
||||||
|
// expiry: data.expiryDate,
|
||||||
|
// };
|
||||||
|
// this.currentStep = 2; // Pindah ke step 2 secara otomatis
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// });
|
||||||
+86
-18
@@ -9,19 +9,32 @@ export const usePaymentStore = defineStore('payment', {
|
|||||||
amount: '',
|
amount: '',
|
||||||
expiry: '',
|
expiry: '',
|
||||||
},
|
},
|
||||||
// Berikan default object instead of null
|
|
||||||
qrData: {
|
qrData: {
|
||||||
qrvalue: null,
|
qrvalue: null,
|
||||||
display_nobill: null,
|
display_nobill: null,
|
||||||
display_name: null,
|
display_name: null,
|
||||||
display_amount: null
|
display_amount: null,
|
||||||
|
status: null, // Tambahkan status untuk tracking
|
||||||
|
ip: null, // Tambahkan IP untuk reference
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
// Tambahkan getter untuk safe access
|
|
||||||
hasQrData: (state) => state.qrData && state.qrData.qrvalue,
|
hasQrData: (state) => state.qrData && state.qrData.qrvalue,
|
||||||
safeQrValue: (state) => state.qrData?.qrvalue || 'https://www.google.com'
|
safeQrValue: (state) => state.qrData?.qrvalue || 'https://www.google.com',
|
||||||
|
|
||||||
|
// Getter untuk cek apakah data siap untuk polling status
|
||||||
|
isReadyForStatusCheck: (state) => {
|
||||||
|
return state.qrData.display_nobill && state.qrData.display_name;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Getter untuk informasi debug
|
||||||
|
debugInfo: (state) => ({
|
||||||
|
step: state.currentStep,
|
||||||
|
hasIdentifiers: !!(state.qrData.display_nobill && state.qrData.display_name),
|
||||||
|
qrData: state.qrData,
|
||||||
|
patientInfo: state.patientInfo,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
@@ -31,22 +44,32 @@ export const usePaymentStore = defineStore('payment', {
|
|||||||
prevStep() {
|
prevStep() {
|
||||||
this.currentStep--;
|
this.currentStep--;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setStep(step) {
|
||||||
|
console.log(`Setting step from ${this.currentStep} to ${step}`);
|
||||||
|
this.currentStep = step;
|
||||||
|
},
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
|
console.log('Resetting payment store');
|
||||||
this.currentStep = 1;
|
this.currentStep = 1;
|
||||||
this.patientInfo = {
|
this.patientInfo = {
|
||||||
name: '',
|
name: '',
|
||||||
amount: '',
|
amount: '',
|
||||||
expiry: '',
|
expiry: '',
|
||||||
};
|
};
|
||||||
// Reset ke default object, bukan null
|
|
||||||
this.qrData = {
|
this.qrData = {
|
||||||
qrvalue: null,
|
qrvalue: null,
|
||||||
display_nobill: null,
|
display_nobill: null,
|
||||||
display_name: null,
|
display_name: null,
|
||||||
display_amount: null
|
display_amount: null,
|
||||||
|
status: null,
|
||||||
|
ip: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
updatePayment(apiResponse) {
|
updatePayment(apiResponse) {
|
||||||
|
console.log("=== UPDATE PAYMENT ===");
|
||||||
console.log("API Response:", apiResponse);
|
console.log("API Response:", apiResponse);
|
||||||
|
|
||||||
// Validasi response
|
// Validasi response
|
||||||
@@ -58,27 +81,72 @@ export const usePaymentStore = defineStore('payment', {
|
|||||||
const apiData = apiResponse.data[0];
|
const apiData = apiResponse.data[0];
|
||||||
console.log("API Data:", apiData);
|
console.log("API Data:", apiData);
|
||||||
|
|
||||||
// Update qrData dengan validasi
|
// Simpan data lama untuk comparison
|
||||||
|
const oldQrData = { ...this.qrData };
|
||||||
|
|
||||||
|
// Update qrData dengan semua properti dari API
|
||||||
this.qrData = {
|
this.qrData = {
|
||||||
qrvalue: apiData.qrvalue || null,
|
qrvalue: apiData.qrvalue || apiData.qr_code || this.qrData.qrvalue,
|
||||||
display_nobill: apiData.display_nobill || null,
|
display_nobill: apiData.display_nobill || this.qrData.display_nobill,
|
||||||
display_name: apiData.display_name || null,
|
display_name: apiData.display_name || this.qrData.display_name,
|
||||||
display_amount: apiData.display_amount || null,
|
display_amount: apiData.display_amount || apiData.nominal || this.qrData.display_amount,
|
||||||
...apiData // spread untuk properti lain yang mungkin ada
|
status: apiData.status || this.qrData.status,
|
||||||
|
ip: apiData.ip || this.qrData.ip,
|
||||||
|
// Spread untuk properti lain yang mungkin ada
|
||||||
|
...apiData
|
||||||
};
|
};
|
||||||
|
|
||||||
// Update patientInfo
|
// Update patientInfo
|
||||||
this.patientInfo = {
|
this.patientInfo = {
|
||||||
name: apiData.display_name || 'Unknown',
|
name: apiData.display_name || this.patientInfo.name || 'Unknown',
|
||||||
amount: apiData.display_amount || '0',
|
amount: apiData.display_amount || apiData.nominal || this.patientInfo.amount || '0',
|
||||||
expiry: this.patientInfo.expiry, // keep existing value
|
expiry: this.patientInfo.expiry,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Log changes
|
||||||
|
if (oldQrData.status !== this.qrData.status) {
|
||||||
|
console.log(`Status changed: ${oldQrData.status} -> ${this.qrData.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
console.log("Updated qrData:", this.qrData);
|
console.log("Updated qrData:", this.qrData);
|
||||||
console.log("Updated patientInfo:", this.patientInfo);
|
console.log("Updated patientInfo:", this.patientInfo);
|
||||||
|
console.log("===================");
|
||||||
// Ganti step
|
|
||||||
this.currentStep = 2;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Method untuk debug
|
||||||
|
debugCurrentState() {
|
||||||
|
console.log("=== PAYMENT STORE DEBUG ===");
|
||||||
|
console.log("Current Step:", this.currentStep);
|
||||||
|
console.log("Patient Info:", this.patientInfo);
|
||||||
|
console.log("QR Data:", this.qrData);
|
||||||
|
console.log("Has QR Data:", this.hasQrData);
|
||||||
|
console.log("Ready for Status Check:", this.isReadyForStatusCheck);
|
||||||
|
console.log("Safe QR Value:", this.safeQrValue);
|
||||||
|
console.log("==========================");
|
||||||
|
},
|
||||||
|
|
||||||
|
// Method untuk validasi data
|
||||||
|
validateData() {
|
||||||
|
const issues = [];
|
||||||
|
|
||||||
|
if (!this.qrData.display_nobill) {
|
||||||
|
issues.push('display_nobill missing');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.qrData.display_name) {
|
||||||
|
issues.push('display_name missing');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.qrData.qrvalue && !this.qrData.qr_code) {
|
||||||
|
issues.push('QR code missing');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (issues.length > 0) {
|
||||||
|
console.warn('Data validation issues:', issues);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
// src/stores/payment.js
|
|
||||||
import { defineStore } from 'pinia';
|
|
||||||
|
|
||||||
export const usePaymentStore = defineStore('payment', {
|
|
||||||
state: () => ({
|
|
||||||
currentStep: 1,
|
|
||||||
patientInfo: {
|
|
||||||
name: '',
|
|
||||||
amount: '',
|
|
||||||
expiry: '',
|
|
||||||
},
|
|
||||||
paymentData: null, // Tambahkan state ini untuk menyimpan data dari backend
|
|
||||||
}),
|
|
||||||
actions: {
|
|
||||||
nextStep() {
|
|
||||||
this.currentStep++;
|
|
||||||
},
|
|
||||||
prevStep() {
|
|
||||||
this.currentStep--;
|
|
||||||
},
|
|
||||||
reset() {
|
|
||||||
this.currentStep = 1;
|
|
||||||
this.patientInfo = {};
|
|
||||||
this.paymentData = null; // Reset data pembayaran
|
|
||||||
},
|
|
||||||
// Tambahkan action baru untuk menerima data dari WebSocket
|
|
||||||
updatePayment(data: { patientName: any; amount: any; expiryDate: any; } | null) {
|
|
||||||
this.paymentData = data;
|
|
||||||
this.patientInfo = {
|
|
||||||
name: data.patientName,
|
|
||||||
amount: data.amount,
|
|
||||||
expiry: data.expiryDate,
|
|
||||||
};
|
|
||||||
this.currentStep = 2; // Pindah ke step 2 secara otomatis
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user