pop up form premium

This commit is contained in:
Farhaan4 2025-10-15 16:47:07 +07:00
parent b27f6a47fb
commit 6bb0e98021
3 changed files with 34 additions and 17 deletions

View File

@ -9,7 +9,7 @@
</template>
<script setup>
import WeddingA from '~/components/templates/wedding/WeddingA.vue'
import WeddingA from '~/components/templates/wedding/weddingA.vue'
// Props dari parent (/p/[code].vue)
const props = defineProps({

View File

@ -303,18 +303,7 @@ const konfirmasi = async () => {
return
}
const confirm = await Swal.fire({
title: 'Simpan Data?',
text: 'Pastikan data sudah benar sebelum dikirim.',
icon: 'question',
showCancelButton: true,
confirmButtonColor: '#2563eb',
cancelButtonColor: '#d33',
confirmButtonText: 'Ya, Simpan',
cancelButtonText: 'Batal'
})
if (!confirm.isConfirmed) return
try {
const data = new FormData()
@ -348,10 +337,19 @@ const konfirmasi = async () => {
}
await Swal.fire({
title: 'Berhasil!',
text: result.message || 'Data berhasil disimpan!',
title: '🎉 Berhasil!',
text: result.message || 'Data undangan kamu berhasil disimpan.',
icon: 'success',
confirmButtonColor: '#16a34a'
confirmButtonText: 'Lanjut ke WhatsApp',
confirmButtonColor: '#2563eb',
background: '#f9fafb',
color: '#111827',
showClass: {
popup: 'animate__animated animate__fadeInDown'
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp'
}
})
// Kirim ke WhatsApp admin

View File

@ -212,6 +212,7 @@
<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import Swal from 'sweetalert2'
const router = useRouter()
@ -266,7 +267,7 @@ const form = ref({
const showAlert = ref(false)
const alertTitle = ref('')
const alertMessage = ref('')
const alertType = ref('info') // success | error | warning | info
const alertType = ref('info')
const triggerAlert = (type, title, message) => {
alertType.value = type
@ -346,6 +347,24 @@ const konfirmasi = async () => {
throw new Error(msg)
}
await Swal.fire({
title: '🎉 Berhasil!',
text: result.message || 'Data undangan kamu berhasil disimpan.',
icon: 'success',
confirmButtonText: 'Lanjut ke WhatsApp',
confirmButtonColor: '#2563eb',
background: '#f9fafb',
color: '#111827',
showClass: {
popup: 'animate__animated animate__fadeInDown'
},
hideClass: {
popup: 'animate__animated animate__fadeOutUp'
}
})
const adminPhone = '62895333053398'
const pesan = `
Halo Admin 👋