transaction detail
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
VITE_TOKEN_NAME = 'dsc_token'
|
||||
VITE_REFRESH_TOKEN_NAME = 'dsc_refresh_token'
|
||||
VITE_BASE_URL = 'https://api.danakcorp.com'
|
||||
# VITE_BASE_URL = 'http://192.168.1.124:4000'
|
||||
# VITE_BASE_URL = 'https://api.danakcorp.com'
|
||||
VITE_BASE_URL = 'http://192.168.0.216:4000'
|
||||
+1
-1
@@ -82,7 +82,7 @@ define(['./workbox-e7681877'], (function (workbox) { 'use strict';
|
||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.p2q1at3f1to"
|
||||
"revision": "0.kim5d4lsg4"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
||||
@@ -36,7 +36,7 @@ const ServiceItem: FC<Props> = (props: Props) => {
|
||||
<Button
|
||||
className='h-8 w-fit px-5 text-xs text-black bg-description bg-opacity-20 rounded-xl'
|
||||
>
|
||||
<div className='flex gap-2'>
|
||||
<div className='flex gap-2 whitespace-nowrap'>
|
||||
<div>{t('service.detail')}</div>
|
||||
<ArrowLeft color='black' size={16} />
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -273,7 +273,7 @@
|
||||
"transaction2": "تراکنش",
|
||||
"type_deposit": "نوع واریز",
|
||||
"status": "وضعیت",
|
||||
"success_paid": "پرداخت موفق",
|
||||
"success_paid": "موفق",
|
||||
"print": "پرینت",
|
||||
"download": "دانلود",
|
||||
"type_getway": "نوع درگاه",
|
||||
|
||||
@@ -116,7 +116,7 @@ const TransactionList: FC = () => {
|
||||
<Td text={NumberFormat(+item.amount)} />
|
||||
<Td text={moment(item.createdAt).format('jYYYY-jMM-jDD')} />
|
||||
<Td text={''}>
|
||||
<Detail />
|
||||
<Detail id={item.id} />
|
||||
</Td>
|
||||
</tr>
|
||||
)
|
||||
|
||||
@@ -4,11 +4,21 @@ import DefaulModal from '../../../components/DefaulModal'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import StatusCircle from '../../../components/StatusCircle'
|
||||
import Button from '../../../components/Button'
|
||||
import { useGetTransactionDetail } from '../hooks/useTransactionData'
|
||||
import { NumberFormat } from '../../../config/func'
|
||||
import moment from 'moment-jalaali'
|
||||
|
||||
const Detail: FC = () => {
|
||||
type Props = {
|
||||
id: string
|
||||
}
|
||||
|
||||
const Detail: FC<Props> = ({ id }) => {
|
||||
|
||||
const { t } = useTranslation('global')
|
||||
const [showModal, setShowModal] = useState<boolean>(false)
|
||||
const { data: d } = useGetTransactionDetail(id, showModal)
|
||||
|
||||
const data = d?.data?.transaction
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -18,7 +28,7 @@ const Detail: FC = () => {
|
||||
open={showModal}
|
||||
close={() => setShowModal(false)}
|
||||
isHeader
|
||||
title_header={`${t('transaction.transaction2')} ۱۲۳۴۵۵`}
|
||||
title_header={`${t('transaction.transaction2')}`}
|
||||
>
|
||||
<div className='my-10'>
|
||||
<div className='flex xl:flex-row flex-col gap-8'>
|
||||
@@ -30,7 +40,14 @@ const Detail: FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
واریز شتابی
|
||||
{
|
||||
data?.payment ?
|
||||
' واریز شتابی'
|
||||
:
|
||||
data?.depositRequest ?
|
||||
t('wallet.' + data?.depositRequest?.type.toLowerCase())
|
||||
: '-'
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex-1 px-6 h-10 flex justify-between items-center'>
|
||||
@@ -57,7 +74,12 @@ const Detail: FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
آنلاین بانک سامان
|
||||
{
|
||||
data?.payment ?
|
||||
data?.payment?.paymentGateway?.nameFa
|
||||
:
|
||||
'-'
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex-1 px-6 h-10 flex justify-between items-center'>
|
||||
@@ -68,7 +90,7 @@ const Detail: FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex gap-2 items-center'>
|
||||
۱۰,۰۰۰,۰۰۰ {t('toman')}
|
||||
{NumberFormat(data?.amount)} {t('toman')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,7 +104,7 @@ const Detail: FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
مهرداد مظفری
|
||||
{data?.wallet?.user?.firstName} {data?.wallet?.user?.lastName}
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex-1 px-6 h-10 flex justify-between items-center'>
|
||||
@@ -93,7 +115,7 @@ const Detail: FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex gap-2 items-center'>
|
||||
۱۴۰۳/۰۹/۳۰
|
||||
{moment(data?.createdAt).format('jYYYY/jMM/jDD')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,8 +127,8 @@ const Detail: FC = () => {
|
||||
{t('transaction.tracking_number')}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
bbd704c-۱۲۳۴۵۶
|
||||
<div className='truncate max-w-20'>
|
||||
{data?.id}
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex-1 px-6 h-10 flex justify-between items-center'>
|
||||
@@ -117,7 +139,7 @@ const Detail: FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className='flex gap-2 items-center'>
|
||||
bbd704c-۱۲۳۴۵۶
|
||||
{data?.numericId}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -131,7 +153,7 @@ const Detail: FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
-
|
||||
{data?.description}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,3 +7,11 @@ export const useGetTransactions = (page: number) => {
|
||||
queryFn: () => api.getTransactions(page),
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetTransactionDetail = (id: string, enabled: boolean) => {
|
||||
return useQuery({
|
||||
queryKey: ["transactions-detail", id],
|
||||
queryFn: () => api.getTransactionDetail(id),
|
||||
enabled: enabled,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -4,3 +4,8 @@ export const getTransactions = async (page: number) => {
|
||||
const { data } = await axios.get(`/wallets/transactions?page=${page}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getTransactionDetail = async (id: string) => {
|
||||
const { data } = await axios.get(`/wallets/transactions/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user