From bdb8aa884317fdca72a20989f73764fdde06f42e Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 10 Jul 2023 16:56:58 +0700 Subject: layouting --- src/lib/checkout/components/Checkout.jsx | 134 +++++++++++++++++++++++++++++-- 1 file changed, 128 insertions(+), 6 deletions(-) (limited to 'src/lib/checkout/components') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index 6cb735fe..629ec5bc 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -24,6 +24,7 @@ import whatsappUrl from '@/core/utils/whatsappUrl' import { createSlug } from '@/core/utils/slug' import BottomPopup from '@/core/components/elements/Popup/BottomPopup' import { gtagPurchase } from '@/core/utils/googleTag' +import getVoucher from '../api/getVoucher' const SELF_PICKUP_ID = 32 @@ -81,7 +82,13 @@ const Checkout = () => { const [selectedExpedisiService, setselectedExpedisiService] = useState(null) const [etd, setEtd] = useState(null) const [etdFix, setEtdFix] = useState(null) + const [bottomPopup, SetBottomPopup] = useState(null) + const [listVouchers, SetListVoucher] = useState(null) + const voucher = async () => { + let dataVoucher = await getVoucher() + SetListVoucher(dataVoucher) + } useEffect(() => { const loadExpedisi = async () => { let dataExpedisi = await ExpedisiList() @@ -93,8 +100,11 @@ const Checkout = () => { setExpedisi(dataExpedisi) } loadExpedisi() + voucher() }, []) + console.log('ini voucher', listVouchers) + useEffect(() => { const loadProducts = async () => { let variantIds = '' @@ -260,6 +270,95 @@ const Checkout = () => { return ( <> + SetBottomPopup(false)} title='Gunakan Promo'> +
+
+
+ +
+
+ +
+
+ +
+
+

Promo yang tersedia

+ {listVouchers?.map((item) => ( +
+
+
+ {item.name} +
+
+
+
+

{item.name}

+
+ {item.description} +
+
+
+ +
+
+
+

+ Kode Voucher :{' '} + {item.code} +

+
+
+
+

+ Voucher ini dapat anda gunakan untuk pengguna pertama{' '} +

+
+
+ + + Berakhir dalam {item.endTime} lagi !{' '} + + Lihat Detail + + +
+
+
+ ))} +
+
+
@@ -353,6 +452,22 @@ const Checkout = () => { )}
+ +
+ +
+ +
{/*

*) Belum termasuk biaya pengiriman

*/}

Dengan melakukan pembelian melalui website Indoteknik, saya menyetujui{' '} @@ -581,12 +696,19 @@ const Checkout = () => {


- +
+ +

Dengan melakukan pembelian melalui website Indoteknik, saya menyetujui{' '} -- cgit v1.2.3