Merge branch 'baru' of https://git.abbauf.com/Magang-2025/Undangan into baru
This commit is contained in:
commit
18303628e8
@ -12,12 +12,26 @@
|
|||||||
<section class="mb-8">
|
<section class="mb-8">
|
||||||
<h2 class="font-semibold text-blue-600 mb-3 border-b pb-1">📋 Data Pemesan</h2>
|
<h2 class="font-semibold text-blue-600 mb-3 border-b pb-1">📋 Data Pemesan</h2>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
<input v-model="form.nama_pemesan" type="text" placeholder="Nama Pemesan"
|
<input
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
v-model="form.nama_pemesan"
|
||||||
<input v-model="form.email" type="email" placeholder="Email"
|
type="text"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
placeholder="Nama Pemesan"
|
||||||
<input v-model="form.no_tlpn" type="text" placeholder="No Telepon"
|
required
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.email"
|
||||||
|
type="email"
|
||||||
|
placeholder="Email"
|
||||||
|
required
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.no_tlpn"
|
||||||
|
type="text"
|
||||||
|
placeholder="No Telepon"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@ -29,20 +43,41 @@
|
|||||||
<div>
|
<div>
|
||||||
<h3 class="font-medium text-gray-700 mb-2">Mempelai Pria</h3>
|
<h3 class="font-medium text-gray-700 mb-2">Mempelai Pria</h3>
|
||||||
<div class="grid gap-2">
|
<div class="grid gap-2">
|
||||||
<input v-model="form.form.nama_lengkap_pria" placeholder="Nama Lengkap"
|
<input
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
v-model="form.form.nama_lengkap_pria"
|
||||||
<input v-model="form.form.nama_panggilan_pria" placeholder="Nama Panggilan"
|
placeholder="Nama Lengkap"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
<input v-model="form.form.nama_bapak_pria" placeholder="Nama Bapak"
|
/>
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
<input
|
||||||
<input v-model="form.form.nama_ibu_pria" placeholder="Nama Ibu"
|
v-model="form.form.nama_panggilan_pria"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
placeholder="Nama Panggilan"
|
||||||
<input v-model="form.form.instagram_pria" placeholder="Instagram"
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
/>
|
||||||
<input v-model="form.form.facebook_pria" placeholder="Facebook"
|
<input
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
v-model="form.form.nama_bapak_pria"
|
||||||
<input v-model="form.form.twitter_pria" placeholder="Twitter"
|
placeholder="Nama Bapak"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.nama_ibu_pria"
|
||||||
|
placeholder="Nama Ibu"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_instagram_pria"
|
||||||
|
placeholder="Link Instagram"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_facebook_pria"
|
||||||
|
placeholder="Link Facebook"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_twitter_pria"
|
||||||
|
placeholder="Link Twitter"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -50,45 +85,205 @@
|
|||||||
<div>
|
<div>
|
||||||
<h3 class="font-medium text-gray-700 mb-2">Mempelai Wanita</h3>
|
<h3 class="font-medium text-gray-700 mb-2">Mempelai Wanita</h3>
|
||||||
<div class="grid gap-2">
|
<div class="grid gap-2">
|
||||||
<input v-model="form.form.nama_lengkap_wanita" placeholder="Nama Lengkap"
|
<input
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition" />
|
v-model="form.form.nama_lengkap_wanita"
|
||||||
<input v-model="form.form.nama_panggilan_wanita" placeholder="Nama Panggilan"
|
placeholder="Nama Lengkap"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition" />
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition"
|
||||||
<input v-model="form.form.nama_bapak_wanita" placeholder="Nama Bapak"
|
/>
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition" />
|
<input
|
||||||
<input v-model="form.form.nama_ibu_wanita" placeholder="Nama Ibu"
|
v-model="form.form.nama_panggilan_wanita"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition" />
|
placeholder="Nama Panggilan"
|
||||||
<input v-model="form.form.instagram_wanita" placeholder="Instagram"
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition" />
|
/>
|
||||||
<input v-model="form.form.facebook_wanita" placeholder="Facebook"
|
<input
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition" />
|
v-model="form.form.nama_bapak_wanita"
|
||||||
<input v-model="form.form.twitter_wanita" placeholder="Twitter"
|
placeholder="Nama Bapak"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition" />
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.nama_ibu_wanita"
|
||||||
|
placeholder="Nama Ibu"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_instagram_wanita"
|
||||||
|
placeholder="Link Instagram"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_facebook_wanita"
|
||||||
|
placeholder="Link Facebook"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_twitter_wanita"
|
||||||
|
placeholder="Link Twitter"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-pink-400 focus:border-pink-400 outline-none transition"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- Detail Acara -->
|
||||||
|
<section class="mb-8">
|
||||||
|
<h2 class="font-semibold text-blue-600 mb-3 border-b pb-1">📅 Detail Acara</h2>
|
||||||
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
|
<!-- Akad -->
|
||||||
|
<div>
|
||||||
|
<h3 class="font-medium text-gray-700 mb-2">Akad</h3>
|
||||||
|
<div class="grid gap-2">
|
||||||
|
<input
|
||||||
|
v-model="form.form.hari_tanggal_akad"
|
||||||
|
type="date"
|
||||||
|
placeholder="Hari & Tanggal Akad"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.waktu_akad"
|
||||||
|
type="time"
|
||||||
|
placeholder="Waktu Akad"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<textarea
|
||||||
|
v-model="form.form.alamat_akad"
|
||||||
|
rows="3"
|
||||||
|
placeholder="Alamat Akad"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition resize-none"
|
||||||
|
></textarea>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_gmaps_akad"
|
||||||
|
type="text"
|
||||||
|
placeholder="Link Google Maps Akad"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Resepsi -->
|
||||||
|
<div>
|
||||||
|
<h3 class="font-medium text-gray-700 mb-2">Resepsi</h3>
|
||||||
|
<div class="grid gap-2">
|
||||||
|
<input
|
||||||
|
v-model="form.form.hari_tanggal_resepsi"
|
||||||
|
type="date"
|
||||||
|
placeholder="Hari & Tanggal Resepsi"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.waktu_resepsi"
|
||||||
|
type="time"
|
||||||
|
placeholder="Waktu Resepsi"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<textarea
|
||||||
|
v-model="form.form.alamat_resepsi"
|
||||||
|
rows="3"
|
||||||
|
placeholder="Alamat Resepsi"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition resize-none"
|
||||||
|
></textarea>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_gmaps_resepsi"
|
||||||
|
type="text"
|
||||||
|
placeholder="Link Google Maps Resepsi"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Syukuran -->
|
||||||
|
<div>
|
||||||
|
<h3 class="font-medium text-gray-700 mb-2">Syukuran</h3>
|
||||||
|
<div class="grid gap-2">
|
||||||
|
<input
|
||||||
|
v-model="form.form.hari_tanggal_syukuran"
|
||||||
|
type="date"
|
||||||
|
placeholder="Hari & Tanggal Syukuran"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.waktu_syukuran"
|
||||||
|
type="time"
|
||||||
|
placeholder="Waktu Syukuran"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<textarea
|
||||||
|
v-model="form.form.alamat_syukuran"
|
||||||
|
rows="3"
|
||||||
|
placeholder="Alamat Syukuran"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition resize-none"
|
||||||
|
></textarea>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_gmaps_syukuran"
|
||||||
|
type="text"
|
||||||
|
placeholder="Link Google Maps Syukuran"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Hitung Mundur -->
|
||||||
|
<div>
|
||||||
|
<h3 class="font-medium text-gray-700 mb-2">Hitung Mundur</h3>
|
||||||
|
<input
|
||||||
|
v-model="form.form.hitung_mundur"
|
||||||
|
type="datetime-local"
|
||||||
|
placeholder="Hitung Mundur Waktu Acara"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- Cerita Kita -->
|
<!-- Cerita Kita -->
|
||||||
<section class="mb-8">
|
<section class="mb-8">
|
||||||
<h2 class="font-semibold text-blue-600 mb-3 border-b pb-1">💌 Cerita Kita</h2>
|
<h2 class="font-semibold text-blue-600 mb-3 border-b pb-1">💌 Cerita Kita</h2>
|
||||||
<textarea v-model="form.form.cerita_kita" rows="4" placeholder="Ceritakan kisah kalian..."
|
<textarea
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition resize-none"></textarea>
|
v-model="form.form.cerita_kita"
|
||||||
|
rows="4"
|
||||||
|
placeholder="Ceritakan kisah kalian..."
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition resize-none"
|
||||||
|
></textarea>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- Say Something -->
|
||||||
|
<section class="mb-8">
|
||||||
|
<h2 class="font-semibold text-blue-600 mb-3 border-b pb-1">💬 Say Something</h2>
|
||||||
|
<textarea
|
||||||
|
v-model="form.form.say_something"
|
||||||
|
rows="4"
|
||||||
|
placeholder="Kata-kata spesial atau pesan untuk tamu..."
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition resize-none"
|
||||||
|
></textarea>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Rekening & Musik -->
|
<!-- Rekening & Musik -->
|
||||||
<section class="mb-8">
|
<section class="mb-8">
|
||||||
<h2 class="font-semibold text-blue-600 mb-3 border-b pb-1">💳 Rekening & Musik</h2>
|
<h2 class="font-semibold text-blue-600 mb-3 border-b pb-1">💳 Rekening & Musik</h2>
|
||||||
<div class="grid md:grid-cols-3 gap-4">
|
<div class="grid md:grid-cols-3 gap-4">
|
||||||
<input v-model="form.form.rekening1" placeholder="Rekening 1"
|
<input
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
v-model="form.form.rekening_1"
|
||||||
<input v-model="form.form.rekening2" placeholder="Rekening 2"
|
placeholder="Rekening 1"
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
<input v-model="form.form.rekening3" placeholder="Rekening 3"
|
/>
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
<input
|
||||||
|
v-model="form.form.rekening_2"
|
||||||
|
placeholder="Rekening 2"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.rekening_3"
|
||||||
|
placeholder="Rekening 3"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<input v-model="form.form.link_music" placeholder="Link Music (opsional)"
|
<input
|
||||||
class="w-full border border-gray-300 rounded-lg px-3 py-2 mt-4 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition" />
|
v-model="form.form.link_music"
|
||||||
|
placeholder="Link Music (opsional)"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 mt-4 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
v-model="form.form.link_live_streaming"
|
||||||
|
placeholder="Link Live Streaming (opsional)"
|
||||||
|
class="w-full border border-gray-300 rounded-lg px-3 py-2 mt-4 focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none transition"
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<!-- Foto Upload -->
|
<!-- Foto Upload -->
|
||||||
@ -107,7 +302,7 @@
|
|||||||
/>
|
/>
|
||||||
<label v-if="!previews.length" for="gallery" class="cursor-pointer flex flex-col items-center">
|
<label v-if="!previews.length" for="gallery" class="cursor-pointer flex flex-col items-center">
|
||||||
<span class="text-4xl font-bold">+</span>
|
<span class="text-4xl font-bold">+</span>
|
||||||
<span class="text-sm mt-2">Pilih Foto (maks. 6, JPEG/PNG, maks. 2MB)</span>
|
<span class="text-sm mt-2">Pilih Foto (maks. 8, JPEG/PNG, maks. 2MB)</span>
|
||||||
</label>
|
</label>
|
||||||
<div v-else class="grid grid-cols-3 sm:grid-cols-4 gap-4">
|
<div v-else class="grid grid-cols-3 sm:grid-cols-4 gap-4">
|
||||||
<div
|
<div
|
||||||
@ -128,7 +323,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<label
|
<label
|
||||||
v-if="previews.length < 6"
|
v-if="previews.length < 8"
|
||||||
for="gallery"
|
for="gallery"
|
||||||
class="cursor-pointer flex flex-col items-center justify-center w-24 h-24 border-2 border-dashed border-gray-300 rounded-lg text-gray-400 hover:border-blue-400 hover:text-blue-500 transition"
|
class="cursor-pointer flex flex-col items-center justify-center w-24 h-24 border-2 border-dashed border-gray-300 rounded-lg text-gray-400 hover:border-blue-400 hover:text-blue-500 transition"
|
||||||
>
|
>
|
||||||
@ -140,138 +335,157 @@
|
|||||||
|
|
||||||
<!-- Tombol -->
|
<!-- Tombol -->
|
||||||
<div class="text-end mt-6">
|
<div class="text-end mt-6">
|
||||||
<button @click="batal"
|
<button
|
||||||
class="bg-gray-600 text-white font-semibold px-6 py-2 rounded-lg transition mr-2">
|
@click="batal"
|
||||||
|
class="bg-gray-600 text-white font-semibold px-6 py-2 rounded-lg transition mr-2"
|
||||||
|
>
|
||||||
Batal
|
Batal
|
||||||
</button>
|
</button>
|
||||||
<button @click="konfirmasi"
|
<button
|
||||||
class="bg-blue-700 text-white font-semibold px-6 py-2 rounded-lg transition">
|
@click="konfirmasi"
|
||||||
|
class="bg-blue-700 text-white font-semibold px-6 py-2 rounded-lg transition"
|
||||||
|
>
|
||||||
Konfirmasi
|
Konfirmasi
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const form = ref({
|
const form = ref({
|
||||||
nama_pemesan: '',
|
nama_pemesan: '',
|
||||||
email: '',
|
email: '',
|
||||||
no_tlpn: '',
|
no_tlpn: '',
|
||||||
form: {
|
form: {
|
||||||
nama_lengkap_pria: '',
|
nama_lengkap_pria: '',
|
||||||
nama_panggilan_pria: '',
|
nama_panggilan_pria: '',
|
||||||
nama_bapak_pria: '',
|
nama_bapak_pria: '',
|
||||||
nama_ibu_pria: '',
|
nama_ibu_pria: '',
|
||||||
instagram_pria: '',
|
link_instagram_pria: '',
|
||||||
facebook_pria: '',
|
link_facebook_pria: '',
|
||||||
twitter_pria: '',
|
link_twitter_pria: '',
|
||||||
nama_lengkap_wanita: '',
|
nama_lengkap_wanita: '',
|
||||||
nama_panggilan_wanita: '',
|
nama_panggilan_wanita: '',
|
||||||
nama_bapak_wanita: '',
|
nama_bapak_wanita: '',
|
||||||
nama_ibu_wanita: '',
|
nama_ibu_wanita: '',
|
||||||
instagram_wanita: '',
|
link_instagram_wanita: '',
|
||||||
facebook_wanita: '',
|
link_facebook_wanita: '',
|
||||||
twitter_wanita: '',
|
link_twitter_wanita: '',
|
||||||
cerita_kita: '',
|
cerita_kita: '',
|
||||||
rekening1: '',
|
hari_tanggal_akad: '',
|
||||||
rekening2: '',
|
waktu_akad: '',
|
||||||
rekening3: '',
|
alamat_akad: '',
|
||||||
link_music: ''
|
link_gmaps_akad: '',
|
||||||
},
|
hari_tanggal_resepsi: '',
|
||||||
foto: []
|
waktu_resepsi: '',
|
||||||
})
|
alamat_resepsi: '',
|
||||||
|
link_gmaps_resepsi: '',
|
||||||
const previews = ref([])
|
hari_tanggal_syukuran: '',
|
||||||
|
waktu_syukuran: '',
|
||||||
const handleFileChange = (e) => {
|
alamat_syukuran: '',
|
||||||
const files = Array.from(e.target.files)
|
link_gmaps_syukuran: '',
|
||||||
const totalFiles = form.value.foto.length + files.length
|
hitung_mundur: '',
|
||||||
|
link_live_streaming: '',
|
||||||
if (totalFiles > 6) {
|
say_something: '',
|
||||||
alert('Maksimal 6 foto!')
|
rekening_1: '',
|
||||||
e.target.value = ''
|
rekening_2: '',
|
||||||
return
|
rekening_3: '',
|
||||||
}
|
link_music: ''
|
||||||
|
},
|
||||||
files.forEach(file => {
|
foto: []
|
||||||
// Validate file size (2MB) and type
|
|
||||||
if (file.size > 2 * 1024 * 1024) {
|
|
||||||
alert(`File ${file.name} terlalu besar! Maksimal 2MB.`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!['image/jpeg', 'image/png', 'image/jpg'].includes(file.type)) {
|
|
||||||
alert(`File ${file.name} harus berupa JPEG atau PNG!`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
form.value.foto.push(file)
|
|
||||||
previews.value.push(URL.createObjectURL(file))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
e.target.value = ''
|
const previews = ref([])
|
||||||
}
|
|
||||||
|
|
||||||
const removeFile = (index) => {
|
const handleFileChange = (e) => {
|
||||||
form.value.foto.splice(index, 1)
|
const files = Array.from(e.target.files)
|
||||||
previews.value.splice(index, 1)
|
const totalFiles = form.value.foto.length + files.length
|
||||||
}
|
|
||||||
|
|
||||||
const konfirmasi = async () => {
|
if (totalFiles > 8) {
|
||||||
try {
|
alert('Maksimal 8 foto!')
|
||||||
// Basic client-side validation
|
e.target.value = ''
|
||||||
if (!form.value.nama_pemesan || !form.value.email || !form.value.no_tlpn) {
|
|
||||||
alert('Harap isi semua kolom wajib (Nama Pemesan, Email, No Telepon)!')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = new FormData()
|
files.forEach(file => {
|
||||||
data.append('nama_pemesan', form.value.nama_pemesan)
|
// Validate file size (2MB) and type
|
||||||
data.append('email', form.value.email)
|
if (file.size > 2 * 1024 * 1024) {
|
||||||
data.append('no_tlpn', form.value.no_tlpn)
|
alert(`File ${file.name} terlalu besar! Maksimal 2MB.`)
|
||||||
data.append('template_slug', 'undangan-pernikahan-premium')
|
return
|
||||||
|
}
|
||||||
// Append form fields individually to ensure Laravel receives them as an array
|
if (!['image/jpeg', 'image/png', 'image/jpg'].includes(file.type)) {
|
||||||
for (const [key, value] of Object.entries(form.value.form)) {
|
alert(`File ${file.name} harus berupa JPEG atau PNG!`)
|
||||||
data.append(`form[${key}]`, value)
|
return
|
||||||
}
|
}
|
||||||
|
form.value.foto.push(file)
|
||||||
form.value.foto.forEach((file, index) => {
|
previews.value.push(URL.createObjectURL(file))
|
||||||
data.append(`foto[${index}]`, file)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log([...data]) // untuk debugging
|
e.target.value = ''
|
||||||
|
|
||||||
const res = await fetch('http://localhost:8000/api/pelanggans', {
|
|
||||||
method: 'POST',
|
|
||||||
body: data
|
|
||||||
})
|
|
||||||
|
|
||||||
const result = await res.json()
|
|
||||||
|
|
||||||
if (!res.ok) {
|
|
||||||
if (res.status === 422) {
|
|
||||||
const errors = result.errors || {}
|
|
||||||
const errorMessages = Object.values(errors).flat().join('\n')
|
|
||||||
throw new Error(errorMessages || result.message || 'Validasi gagal')
|
|
||||||
}
|
|
||||||
if (res.status === 404) {
|
|
||||||
throw new Error(result.message || 'Template tidak ditemukan')
|
|
||||||
}
|
|
||||||
throw new Error(result.message || 'Gagal mengirim data')
|
|
||||||
}
|
|
||||||
|
|
||||||
alert(result.message || 'Data berhasil disimpan!')
|
|
||||||
router.push('/')
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err)
|
|
||||||
alert('Terjadi kesalahan: ' + err.message)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const batal = () => router.back()
|
const removeFile = (index) => {
|
||||||
</script>
|
form.value.foto.splice(index, 1)
|
||||||
|
previews.value.splice(index, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
const konfirmasi = async () => {
|
||||||
|
try {
|
||||||
|
// Basic client-side validation
|
||||||
|
if (!form.value.nama_pemesan || !form.value.email) {
|
||||||
|
alert('Harap isi semua kolom wajib (Nama Pemesan, Email)!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = new FormData()
|
||||||
|
data.append('nama_pemesan', form.value.nama_pemesan)
|
||||||
|
data.append('email', form.value.email)
|
||||||
|
data.append('no_tlpn', form.value.no_tlpn)
|
||||||
|
data.append('template_slug', 'undangan-pernikahan-premium')
|
||||||
|
|
||||||
|
// Append form fields individually to ensure Laravel receives them as an array
|
||||||
|
for (const [key, value] of Object.entries(form.value.form)) {
|
||||||
|
data.append(`form[${key}]`, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
form.value.foto.forEach((file, index) => {
|
||||||
|
data.append(`foto[${index}]`, file)
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log([...data]) // untuk debugging
|
||||||
|
|
||||||
|
const res = await fetch('http://localhost:8000/api/pelanggans', {
|
||||||
|
method: 'POST',
|
||||||
|
body: data
|
||||||
|
})
|
||||||
|
|
||||||
|
const result = await res.json()
|
||||||
|
|
||||||
|
if (!res.ok) {
|
||||||
|
if (res.status === 422) {
|
||||||
|
const errors = result.errors || {}
|
||||||
|
const errorMessages = Object.values(errors).flat().join('\n')
|
||||||
|
throw new Error(errorMessages || result.message || 'Validasi gagal')
|
||||||
|
}
|
||||||
|
if (res.status === 404) {
|
||||||
|
throw new Error(result.message || 'Template tidak ditemukan')
|
||||||
|
}
|
||||||
|
throw new Error(result.message || 'Gagal mengirim data')
|
||||||
|
}
|
||||||
|
|
||||||
|
alert(result.message || 'Data berhasil disimpan!')
|
||||||
|
router.push('/')
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err)
|
||||||
|
alert('Terjadi kesalahan: ' + err.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const batal = () => router.back()
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user