update layout success salin dengan swal alert #5
@ -745,23 +745,45 @@ function hitungTotalHarga(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function copyNoRek() {
|
function copyNoRek() {
|
||||||
const text = document.getElementById('noRekText').innerText;
|
const text = document.getElementById('noRekText').innerText;
|
||||||
navigator.clipboard.writeText(text).then(() => {
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
alert("Nomor rekening berhasil disalin: " + text);
|
Swal.fire({
|
||||||
}).catch(err => {
|
icon: 'success',
|
||||||
console.error('Gagal menyalin: ', err);
|
title: 'Disalin!',
|
||||||
alert("Gagal menyalin teks.");
|
text: 'Nomor rekening berhasil disalin: ' + text,
|
||||||
});
|
showConfirmButton: false,
|
||||||
}
|
timer: 1500
|
||||||
|
});
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('Gagal menyalin: ', err);
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'warning',
|
||||||
|
text: 'Gagal menyalin teks: ' + text,
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 2000
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function copyNoOrder() {
|
function copyNoOrder() {
|
||||||
const text = document.getElementById('no_order_display').innerText;
|
const text = document.getElementById('no_order_display').innerText;
|
||||||
navigator.clipboard.writeText(text).then(() => {
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
alert("Nomor order berhasil disalin: " + text);
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Disalin!',
|
||||||
|
text: 'Nomor order berhasil disalin: ' + text,
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('Gagal menyalin: ', err);
|
console.error('Gagal menyalin: ', err);
|
||||||
alert("Gagal menyalin teks.");
|
Swal.fire({
|
||||||
|
icon: 'warning',
|
||||||
|
text: 'Gagal menyalin teks: ' + text,
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 2000
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<p class="lead">Terima kasih atas pesanan Anda. Kami akan segera menyiapkannya dan menghubungi Anda jika diperlukan.</p>
|
<p class="lead">Terima kasih atas pesanan Anda. Kami akan segera menyiapkannya dan menghubungi Anda jika diperlukan.</p>
|
||||||
<hr class="my-4">
|
<hr class="my-4">
|
||||||
<p class="text-muted">Simpan Nomor Order Anda untuk memantau status pesanan secara berkala. Hubungi kami jika ada pertanyaan.</p>
|
<p class="text-muted">Simpan Nomor Order Anda untuk memantau status pesanan secara berkala. Hubungi kami jika ada pertanyaan.</p>
|
||||||
<p>No Order : <strong>{{ $no_order }}</strong>
|
<p>No Order : <strong id="noOrderText">{{ $no_order }}</strong>
|
||||||
<button class="btn btn-sm btn-outline-secondary ms-2" onclick="copyNoOrder()">
|
<button class="btn btn-sm btn-outline-secondary ms-2" onclick="copyNoOrder()">
|
||||||
<i class="fa fa-copy"></i> Salin
|
<i class="fa fa-copy"></i> Salin
|
||||||
</button>
|
</button>
|
||||||
@ -27,10 +27,21 @@
|
|||||||
function copyNoOrder() {
|
function copyNoOrder() {
|
||||||
const text = document.getElementById('noOrderText').innerText;
|
const text = document.getElementById('noOrderText').innerText;
|
||||||
navigator.clipboard.writeText(text).then(() => {
|
navigator.clipboard.writeText(text).then(() => {
|
||||||
alert("Nomor order berhasil disalin: " + text);
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Disalin!',
|
||||||
|
text: 'Nomor order berhasil disalin: ' + text,
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 1500
|
||||||
|
});
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('Gagal menyalin: ', err);
|
console.error('Gagal menyalin: ', err);
|
||||||
alert("Gagal menyalin teks.");
|
Swal.fire({
|
||||||
|
icon: 'warning',
|
||||||
|
text: 'Gagal menyalin teks: ' + text,
|
||||||
|
showConfirmButton: false,
|
||||||
|
timer: 2000
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user