From 0dab223d410e1c6011bfb4e1e850dfe566c8d044 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 29 Aug 2023 14:11:23 +0700 Subject: add params etd di checkout --- public/images/BOX_DELIVERY_GREEN.svg | 71 +++++++++++++++++++++++++++++++ src/lib/checkout/components/Checkout.jsx | 18 ++++++++ src/lib/shipment/components/Shipments.jsx | 4 +- src/pages/my/menu.jsx | 53 ++++++++++++++++++++--- 4 files changed, 137 insertions(+), 9 deletions(-) create mode 100644 public/images/BOX_DELIVERY_GREEN.svg diff --git a/public/images/BOX_DELIVERY_GREEN.svg b/public/images/BOX_DELIVERY_GREEN.svg new file mode 100644 index 00000000..45ae81c4 --- /dev/null +++ b/public/images/BOX_DELIVERY_GREEN.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx index afb94c10..0eb05345 100644 --- a/src/lib/checkout/components/Checkout.jsx +++ b/src/lib/checkout/components/Checkout.jsx @@ -297,10 +297,12 @@ const Checkout = () => { order_line: JSON.stringify(productOrder), delivery_amount: biayaKirim, carrier_id: selectedCarrierId, + estimated_arrival_days: splitDuration(etd), delivery_service_type: selectedExpedisiService, voucher: activeVoucher, type: 'sale_order' } + if (query) { data.source = 'buy' } @@ -1444,6 +1446,22 @@ function calculateEstimatedArrival(duration) { return '' } +function splitDuration(duration){ + if (duration) { + let estimationDate = null + if (duration.includes('-')){ + estimationDate = duration.split('-') + estimationDate = parseInt(estimationDate[1]) + }else{ + estimationDate = parseInt(duration) + } + + return estimationDate + } + + return '' +} + const extractDuration = (text) => { const matches = text.match(/\d+(?:-\d+)?/g) diff --git a/src/lib/shipment/components/Shipments.jsx b/src/lib/shipment/components/Shipments.jsx index d62afcb7..c9d3e627 100644 --- a/src/lib/shipment/components/Shipments.jsx +++ b/src/lib/shipment/components/Shipments.jsx @@ -144,8 +144,8 @@ const Shipments = () => { onClick={() => setIdAWB(shipment.id)} className='flex items-center mt-1 gap-x-1 min-w-full' > - -

+ +

{shipment.lastManifest.description}

{'>'}

diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx index 8d209fba..124c87c9 100644 --- a/src/pages/my/menu.jsx +++ b/src/pages/my/menu.jsx @@ -6,6 +6,7 @@ import { deleteAuth } from '@/core/utils/auth' import IsAuth from '@/lib/auth/components/IsAuth' import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid' import { useRouter } from 'next/router' +import ImageNext from 'next/image' export default function Menu() { const auth = useAuth() @@ -40,11 +41,38 @@ export default function Menu() { Aktivitas Pembelian
- Daftar Quotation - Daftar Transaksi - Daftar Pengiriman - Invoice & Faktur Pajak - Wishlist + + {' '} +
+ +

Daftar Quotation

+
+
+ +
+ +

Daftar Transaksi

+
+
+ +
+ +

Daftar Pengiriman

+
+
+ + {' '} +
+ +

Invoice & Faktur Pajak

+
+
+ +
+ +

Wishlist

+
+
@@ -52,7 +80,13 @@ export default function Menu() { Pusat Bantuan
- Layanan Pelanggan + + {' '} +
+ +

Layanan Pelanggan

+
+
@@ -60,7 +94,12 @@ export default function Menu() { Pengaturan Akun
- Daftar Alamat + +
+ +

Daftar Alamat

+
+
-- cgit v1.2.3