From 930919a6f99626436bf2e24aa0ee2b0566808a88 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 11 Aug 2025 13:53:36 +0700 Subject: (andri) add iframe embed tutorial pengajuan tempo --- src/lib/pengajuan-tempo/component/FinishTempo.jsx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/lib/pengajuan-tempo/component') diff --git a/src/lib/pengajuan-tempo/component/FinishTempo.jsx b/src/lib/pengajuan-tempo/component/FinishTempo.jsx index aacb9ef3..84c80e60 100644 --- a/src/lib/pengajuan-tempo/component/FinishTempo.jsx +++ b/src/lib/pengajuan-tempo/component/FinishTempo.jsx @@ -111,6 +111,26 @@ const FinishTempo = ({ query }) => { : 'Kembali Ke Beranda'} + {/* Video panduan khusus tampil saat status switch-account */} + {query?.status === 'switch-account' && ( +
+
+

Agar tidak bingung saat mengubah akun,

+

Yuk pelajari dulu langkah-langkah pengajuan tempo lewat video berikut

+
+
+ +
+
+ )} ); }; -- cgit v1.2.3 From 7647104348478302778c0afbd3a3d1b2637bc03b Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 11 Aug 2025 15:35:25 +0700 Subject: (andri) set true checklist ubah ke akun bisnis --- src/lib/pengajuan-tempo/component/FinishTempo.jsx | 58 +++++++++++++++-------- 1 file changed, 39 insertions(+), 19 deletions(-) (limited to 'src/lib/pengajuan-tempo/component') diff --git a/src/lib/pengajuan-tempo/component/FinishTempo.jsx b/src/lib/pengajuan-tempo/component/FinishTempo.jsx index 84c80e60..9d912b1a 100644 --- a/src/lib/pengajuan-tempo/component/FinishTempo.jsx +++ b/src/lib/pengajuan-tempo/component/FinishTempo.jsx @@ -8,6 +8,7 @@ import useAuth from '@/core/hooks/useAuth'; import axios from 'axios'; import { toast } from 'react-hot-toast'; import { ChevronRightIcon, ChevronLeftIcon } from '@heroicons/react/24/outline'; +import { useRouter } from 'next/router'; const FinishTempo = ({ query }) => { const [data, setData] = useState(); @@ -15,6 +16,8 @@ const FinishTempo = ({ query }) => { const { isDesktop, isMobile } = useDevice(); const auth = useAuth(); const so_order = query?.order_id?.replaceAll('-', '/'); + const router = useRouter(); + useEffect(() => { const fetchData = async () => { const fetchedData = await odooApi( @@ -26,6 +29,14 @@ const FinishTempo = ({ query }) => { fetchData(); }, [query]); + // Handler khusus untuk tombol Ubah Akun + const handleSwitchAccountClick = () => { + // Set flag di localStorage + localStorage.setItem('autoCheckProfile', 'true'); + // Navigate tanpa query param ke halaman profile + router.push('/my/profile'); + }; + return (
{ {query?.status == 'approve' && 'Proses pengajuan tempo anda sudah berhasil terdaftar di indoteknik.com. Nikmati pembelian anda di website indoteknik dengan menggunakan pembayaran tempo'}
- - {query?.status === 'switch-account' - ? 'Ubah Akun' - : query?.status === 'approve' - ? 'Lihat Detail Tempo' - : 'Kembali Ke Beranda'} - - + + {/* Tombol dengan behavior berbeda jika status switch-account */} + {query?.status === 'switch-account' ? ( + + ) : ( + + {query?.status === 'approve' + ? 'Lihat Detail Tempo' + : 'Kembali Ke Beranda'} + + + )} + {/* Video panduan khusus tampil saat status switch-account */} {query?.status === 'switch-account' && ( -
-
+
+

Agar tidak bingung saat mengubah akun,

Yuk pelajari dulu langkah-langkah pengajuan tempo lewat video berikut

-- cgit v1.2.3 From dd0c699d8a866b53b962f92f98939ebb527dded0 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 11 Aug 2025 15:56:53 +0700 Subject: (andri) fix layout --- src/lib/pengajuan-tempo/component/FinishTempo.jsx | 55 +++++++++++++---------- 1 file changed, 32 insertions(+), 23 deletions(-) (limited to 'src/lib/pengajuan-tempo/component') diff --git a/src/lib/pengajuan-tempo/component/FinishTempo.jsx b/src/lib/pengajuan-tempo/component/FinishTempo.jsx index 9d912b1a..ad8a7e67 100644 --- a/src/lib/pengajuan-tempo/component/FinishTempo.jsx +++ b/src/lib/pengajuan-tempo/component/FinishTempo.jsx @@ -106,11 +106,41 @@ const FinishTempo = ({ query }) => { 'Proses pengajuan tempo anda sudah berhasil terdaftar di indoteknik.com. Nikmati pembelian anda di website indoteknik dengan menggunakan pembayaran tempo'}
+
+ + {/* Video panduan khusus tampil saat status switch-account */} + {query?.status === 'switch-account' && ( +
+
+

+ Video Panduan Pengajuan Tempo +

+
+
+ +
+
+ )} + {/* Tombol dengan behavior berbeda jika status switch-account */} {query?.status === 'switch-account' ? (
); }; -- cgit v1.2.3 From 1085602ad84e73692e3ab8b9141c5f61381a8cea Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 13 Aug 2025 10:57:36 +0700 Subject: (andri) layout pengajuan tempo jika status akun pending --- src/lib/pengajuan-tempo/component/FinishTempo.jsx | 77 +++++++++++++++++------ 1 file changed, 57 insertions(+), 20 deletions(-) (limited to 'src/lib/pengajuan-tempo/component') diff --git a/src/lib/pengajuan-tempo/component/FinishTempo.jsx b/src/lib/pengajuan-tempo/component/FinishTempo.jsx index ad8a7e67..abf218d9 100644 --- a/src/lib/pengajuan-tempo/component/FinishTempo.jsx +++ b/src/lib/pengajuan-tempo/component/FinishTempo.jsx @@ -9,9 +9,12 @@ import axios from 'axios'; import { toast } from 'react-hot-toast'; import { ChevronRightIcon, ChevronLeftIcon } from '@heroicons/react/24/outline'; import { useRouter } from 'next/router'; +import switchAccountProgresApi from '@/lib/auth/api/switchAccountProgresApi.js'; const FinishTempo = ({ query }) => { const [data, setData] = useState(); + const [switchStatus, setSwitchStatus] = useState(null); + const [loadingStatus, setLoadingStatus] = useState(true); const [transactionData, setTransactionData] = useState(); const { isDesktop, isMobile } = useDevice(); const auth = useAuth(); @@ -29,16 +32,46 @@ const FinishTempo = ({ query }) => { fetchData(); }, [query]); + useEffect(() => { + const fetchSwitchStatus = async () => { + try { + const progres = await switchAccountProgresApi(); + setSwitchStatus(progres?.status); + } catch (err) { + console.error('Gagal cek progres switch account:', err); + } finally { + setLoadingStatus(false); + } + }; + fetchSwitchStatus(); + }, []); + // Handler khusus untuk tombol Ubah Akun const handleSwitchAccountClick = () => { - // Set flag di localStorage + if (switchStatus === 'pending') { + toast.info('Akun sedang menunggu verifikasi. Tidak dapat mengubah akun saat ini.', { duration: 2500 }); + return; + } localStorage.setItem('autoCheckProfile', 'true'); - // Navigate tanpa query param ke halaman profile router.push('/my/profile'); }; + if (loadingStatus) { + return ( +
+
Memuat data...
+
+ ); + } + return ( -
+
{ > {query?.status == 'finish' && 'Form Pengajuan Tempo kamu Telah Berhasil Didaftarkan Mohon menunggu hingga Proses Verifikasi Selesai Dilakukan'} - {query?.status == 'switch-account' && - 'Form Pengajuan Tempo Kamu Gagal Dilakukan'} + {switchStatus === 'pending' + ? 'Form Pengajuan Tempo Kamu Belum Dapat Dilakukan' + : query?.status == 'switch-account' && + 'Form Pengajuan Tempo Kamu Gagal Dilakukan' + } {query?.status == 'review' && 'Pengajuan Tempo dalam Proses Verifikasi'} {query?.status == 'approve' && 'Pengajuan Tempo Berhasil'} @@ -96,8 +132,11 @@ const FinishTempo = ({ query }) => { isMobile ? 'w-full text-sm' : 'w-4/5 text-base' }`} > - {query?.status == 'switch-account' && - 'Terima kasih atas minat anda untuk mendaftar Tempo, namun sayangnya akun anda bukan merupakan akun bisnis. Segera ubah akun anda menjadi Bisnis untuk menggunakan fitur ini'} + {switchStatus === 'pending' + ? 'Proses perubahan ke akun bisnis sedang kami review, mohon menunggu hingga 2x24 jam' + : query?.status == 'switch-account' && + 'Terima kasih atas minat anda untuk mendaftar Tempo, namun sayangnya akun anda bukan merupakan akun bisnis. Segera ubah akun anda menjadi Bisnis untuk menggunakan fitur ini' + } {query?.status == 'finish' && 'Mohon menunggu untuk verifikasi dokumen dan kelengkapan data yang telah anda berikan. Proses approval pembayaran tempo kamu berhasil atau tidak akan diinfokan melalui email perusahaan / email yang mendaftar'} {query?.status == 'review' && @@ -106,10 +145,12 @@ const FinishTempo = ({ query }) => { 'Proses pengajuan tempo anda sudah berhasil terdaftar di indoteknik.com. Nikmati pembelian anda di website indoteknik dengan menggunakan pembayaran tempo'}
-
+ {switchStatus !== 'pending' && ( +
+ )} {/* Video panduan khusus tampil saat status switch-account */} - {query?.status === 'switch-account' && ( + {query?.status === 'switch-account' && switchStatus !== 'pending' && (

{ )} {/* Tombol dengan behavior berbeda jika status switch-account */} - {query?.status === 'switch-account' ? ( + {query?.status === 'switch-account' && switchStatus !== 'pending' ? ( - ) : ( + ) : query?.status !== 'switch-account' && ( {query?.status === 'approve' ? 'Lihat Detail Tempo' : 'Kembali Ke Beranda'} - + )}

-- cgit v1.2.3 From b1bdfbb9f780a1a1305e02c4b9c338b98c7a4556 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Fri, 15 Aug 2025 13:58:59 +0700 Subject: (andri) fix switch account --- src/lib/pengajuan-tempo/component/PengajuanTempo.jsx | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib/pengajuan-tempo/component') diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx index d59bfd75..3dac0015 100644 --- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx +++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx @@ -40,6 +40,7 @@ const PengajuanTempo = () => { const { form, errors, validate, updateForm } = usePengajuanTempoStore(); const { control, watch, setValue } = useForm(); const auth = useAuth(); + console.log('auth', auth); const router = useRouter(); const [BannerTempo, setBannerTempo] = useState(); const { formDokumen, errorsDokumen, validateDokumen, updateFormDokumen } = -- cgit v1.2.3