From 024c9b243f3ed290e8970e35aca3a9e07547e3e3 Mon Sep 17 00:00:00 2001
From: Farhaan4 <127176994+Farhaan4@users.noreply.github.com>
Date: Tue, 28 Oct 2025 10:26:37 +0700
Subject: [PATCH] fix design template ultah starter
---
.../templates/UltahStarter/Event.vue | 16 ++--
.../templates/UltahStarter/Landing.vue | 2 +-
.../templates/UltahStarter/ThankYou.vue | 6 +-
.../undangan/undangan-ulang-tahun-starter.vue | 74 +++++++++++++------
.../app/pages/form/ulang_tahun/starter.vue | 10 +++
proyek-frontend/app/pages/p/[code].vue | 4 +-
6 files changed, 75 insertions(+), 37 deletions(-)
diff --git a/proyek-frontend/app/components/templates/UltahStarter/Event.vue b/proyek-frontend/app/components/templates/UltahStarter/Event.vue
index cc0a216..dfd244f 100644
--- a/proyek-frontend/app/components/templates/UltahStarter/Event.vue
+++ b/proyek-frontend/app/components/templates/UltahStarter/Event.vue
@@ -16,7 +16,7 @@
π
Hari & Tanggal
-
Rabu, 22 Oktober 2025
+
{{ hari_tanggal_acara }}
@@ -25,7 +25,7 @@
β°
Waktu Acara
-
18.00
+
{{ waktu }}
@@ -34,16 +34,18 @@
π
Lokasi Petualangan
-
jkbjkb
+
{{ alamat }}
-
- πΊοΈ Link Maps Menyusul
-
+ πΊοΈ Buka Google Maps
+
diff --git a/proyek-frontend/app/components/templates/UltahStarter/Landing.vue b/proyek-frontend/app/components/templates/UltahStarter/Landing.vue
index e3c648a..a5970bf 100644
--- a/proyek-frontend/app/components/templates/UltahStarter/Landing.vue
+++ b/proyek-frontend/app/components/templates/UltahStarter/Landing.vue
@@ -46,7 +46,7 @@
- Bergabunglah dalam petualangan ulang tahun {{ childName }}! π
+ Bergabunglah dalam petualangan ulang tahun ! π
diff --git a/proyek-frontend/app/components/templates/UltahStarter/ThankYou.vue b/proyek-frontend/app/components/templates/UltahStarter/ThankYou.vue
index 3b02936..a22f7cb 100644
--- a/proyek-frontend/app/components/templates/UltahStarter/ThankYou.vue
+++ b/proyek-frontend/app/components/templates/UltahStarter/ThankYou.vue
@@ -51,10 +51,8 @@
Atas kehadiran dan doa spider-power untuk
-
- {{ childName || 'Spider-Kid' }}
+
+ {{ childName }}
diff --git a/proyek-frontend/app/components/undangan/undangan-ulang-tahun-starter.vue b/proyek-frontend/app/components/undangan/undangan-ulang-tahun-starter.vue
index 8e36752..104c375 100644
--- a/proyek-frontend/app/components/undangan/undangan-ulang-tahun-starter.vue
+++ b/proyek-frontend/app/components/undangan/undangan-ulang-tahun-starter.vue
@@ -89,7 +89,7 @@ import ThankYou from '~/components/templates/UltahStarter/ThankYou.vue'
// Props dari induk
const props = defineProps({
data: { type: Object, required: true },
- tamu: { type: Object, required: true } // Tambahkan props tamu
+ tamu: { type: Object, required: true }
})
// URL backend
@@ -103,10 +103,10 @@ const messages = computed(() => props.data.rsvp || [])
// β
Gambar galeri
const galleryImages = computed(() => {
- const f = formData.value
- return [f.foto_1, f.foto_2, f.foto_3, f.foto_4, f.foto_5]
+ const fotos = formData.value.foto || []
+ return fotos
.filter(Boolean)
- .map(img => `${backendUrl}/storage/${img.replace(/^public\//, '')}`)
+ .map(img => `${backendUrl}/storage/${img}`)
})
// π Navigasi section
@@ -139,25 +139,53 @@ const currentComponent = computed(() => {
}
})
-// π Props untuk tiap komponen
-const componentProps = computed(() => ({
- childName: formData.value.nama_panggilan,
- guestName: route.query.guest || props.tamu.nama_tamu || 'Tamu Undangan',
- age: formData.value.umur_yang_dirayakan,
- childOrder: formData.value.anak_ke,
- parentsName: `${formData.value.nama_bapak} & ${formData.value.nama_ibu}`,
- childPhoto: formData.value.foto?.length
- ? `${backendUrl}/storage/${formData.value.foto[0]}`
- : null,
- hari_tanggal_acara: formData.value.hari_tanggal_acara,
- waktu: formData.value.waktu,
- alamat: formData.value.alamat,
- link_gmaps: formData.value.link_gmaps,
- hitung_mundur: formData.value.hitung_mundur,
- images: galleryImages.value,
- messages: messages.value,
- jsonData: formData.value
-}))
+// Props untuk tiap komponen
+const componentProps = computed(() => {
+ const f = formData.value
+
+ // Foto anak (untuk Introduction & ThankYou)
+ const childPhoto = f.foto?.[0]
+ ? `${backendUrl}/storage/${f.foto[0].replace(/^public\//, '')}`
+ : null
+
+ // Format tanggal: 2025-10-24 β Jumat, 24 Oktober 2025
+ const formatDate = (dateStr) => {
+ if (!dateStr) return 'Akan diumumkan'
+ try {
+ const d = new Date(dateStr)
+ return d.toLocaleDateString('id-ID', {
+ weekday: 'long',
+ day: 'numeric',
+ month: 'long',
+ year: 'numeric'
+ })
+ } catch {
+ return dateStr
+ }
+ }
+
+ return {
+ // === Introduction & ThankYou ===
+ childName: f.nama_lengkap || 'Spider Kid',
+ guestName: route.query.guest || props.tamu.nama_tamu || 'Tamu Undangan',
+ age: f.umur_yang_dirayakan,
+ childOrder: f.anak_ke,
+ parentsName: `${f.nama_bapak || 'Bapak'} & ${f.nama_ibu || 'Ibu'}`,
+ childPhoto,
+
+ // === Event ===
+ hari_tanggal_acara: formatDate(f.hari_tanggal_acara),
+ waktu: f.waktu,
+ alamat: f.alamat,
+ link_gmaps: f.link_gmaps || '#',
+
+ // === Gallery ===
+ images: galleryImages.value,
+
+ // === ThankYou ===
+ jsonData: f
+ }
+})
// Debug log
import { watchEffect } from 'vue'
diff --git a/proyek-frontend/app/pages/form/ulang_tahun/starter.vue b/proyek-frontend/app/pages/form/ulang_tahun/starter.vue
index 6e31066..f025d1b 100644
--- a/proyek-frontend/app/pages/form/ulang_tahun/starter.vue
+++ b/proyek-frontend/app/pages/form/ulang_tahun/starter.vue
@@ -113,6 +113,16 @@
Alamat
+
+
+
+ Link Gmaps
+
+
diff --git a/proyek-frontend/app/pages/p/[code].vue b/proyek-frontend/app/pages/p/[code].vue
index 6bda90c..a6777cb 100644
--- a/proyek-frontend/app/pages/p/[code].vue
+++ b/proyek-frontend/app/pages/p/[code].vue
@@ -131,11 +131,11 @@ const fetchInvitation = async () => {
const response = await $fetch(`${backendUrl}/api/pelanggans/code/${route.params.code}`)
console.log('β
API response:', response)
-
+ console.log('π« tamuData:', tamuData.value)
// Validate response
if (!response.success) {
throw new Error(response.message || 'Undangan tidak ditemukan')
- console.log('π« tamuData:', tamuData.value)
+
}
if (!response.data || !response.data.pelanggan) {