From ba63d6ba41228412c7663fad46e0b87c4266a508 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Thu, 7 Sep 2023 13:26:06 +0700 Subject: voucher multiple brand --- src/lib/checkout/components/Checkout.jsx | 143 +++++++++++++++++-------------- 1 file changed, 78 insertions(+), 65 deletions(-) (limited to 'src/lib') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index ce691403..a565e13a 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -4,7 +4,13 @@ import Link from '@/core/components/elements/Link/Link' import useAuth from '@/core/hooks/useAuth' import { getItemAddress } from '@/core/utils/address' import addressesApi from '@/lib/address/api/addressesApi' -import { ExclamationCircleIcon } from '@heroicons/react/24/outline' +import { + ArrowLongLeftIcon, + BanknotesIcon, + ChevronLeftIcon, + ClockIcon, + ExclamationCircleIcon +} from '@heroicons/react/24/outline' import React, { useEffect, useRef, useState } from 'react' import _ from 'lodash' import { deleteItemCart, getCartApi } from '@/core/utils/cart' @@ -93,6 +99,8 @@ const Checkout = () => { const [etd, setEtd] = useState(null) const [etdFix, setEtdFix] = useState(null) const [bottomPopup, SetBottomPopup] = useState(null) + const [bottomPopupTnC, SetBottomPopupTnC] = useState(null) + const [itemTnC, setItemTnC] = useState(null) const [listVouchers, SetListVoucher] = useState(null) const [discountVoucher, SetDiscountVoucher] = useState(0) const [codeVoucher, SetCodeVoucher] = useState(null) @@ -370,10 +378,58 @@ const Checkout = () => { handleUseVoucher(code, !isChecked) } + const handlingTnC = async (item) => { + setItemTnC(item) + SetBottomPopupTnC(true) + } // const taxTotal = (totalAmount - totalDiscountAmount - discountVoucher) * 0.11 return ( <> + { + SetBottomPopupTnC(false) + SetBottomPopup(false) + }} + title={ +
+ {' '} +
+ } + > +
+

{itemTnC?.name}

+
+
+ {' '} + + {' '} + Berakhir dalam :{' '} + {itemTnC?.remainingTime} lagi + +
+
+ + Kode Voucher : + {itemTnC?.code} +
+
+
+

Syarat dan Ketentuan

+
+
+
+
+
+
+
{ {!loadingVoucher && listVouchers?.map((item) => (
- {item.canApply === false && ( -
- )} -
@@ -508,67 +560,23 @@ const Checkout = () => {

)} - {!item.canApply && item.applyStatus === 'MPA-HF' && ( - - )} - {!item.canApply && item.applyStatus === 'UM' && ( + {!item.canApply && ( )} - {!item.canApply && - item.applyStatus === 'MPA' && - item.manufactureNames != '' && ( - - )} - - {!item.canApply && - item.applyStatus === 'MPA' && - item.manufactureNames === '' && ( - +
+ {item.canApply === false && ( +
)} -
{item.name}
@@ -620,10 +628,15 @@ const Checkout = () => { stroke-linejoin='round' > - - Berakhir dalam{' '} - {item.remainingTime} lagi{' '} - +
+ + Berakhir dalam{' '} + {item.remainingTime} lagi{' '} + + + Baca S&K + +
@@ -1496,13 +1509,13 @@ function calculateEstimatedArrival(duration) { return '' } -function splitDuration(duration){ +function splitDuration(duration) { if (duration) { let estimationDate = null - if (duration.includes('-')){ + if (duration.includes('-')) { estimationDate = duration.split('-') estimationDate = parseInt(estimationDate[1]) - }else{ + } else { estimationDate = parseInt(duration) } -- cgit v1.2.3 From bddbc47caf58b15ee8b520092ec926318f57df98 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Mon, 11 Sep 2023 12:00:52 +0700 Subject: feedback testing CR voucher (baca sdk ketika voucher bisa apply, popup sdk harrus lebih tinggi) --- src/lib/checkout/components/Checkout.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index a565e13a..6d2f62e0 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -387,7 +387,7 @@ const Checkout = () => { return ( <> { SetBottomPopupTnC(false) @@ -629,13 +629,13 @@ const Checkout = () => { >
- +
Berakhir dalam{' '} - {item.remainingTime} lagi{' '} - - + {item.remainingTime} lagi,{' '} +
+
handlingTnC(item)} > Baca S&K - +
-- cgit v1.2.3