- 자금이체, 지급대행 입금확인서 BottomSheet useDownloadBottomSheetOn2Store 추가
This commit is contained in:
@@ -213,7 +213,16 @@ export interface ExtensionFundAccountBalanceParams {
|
|||||||
mid: string;
|
mid: string;
|
||||||
};
|
};
|
||||||
export interface ExtensionFundAccountBalanceResponse {
|
export interface ExtensionFundAccountBalanceResponse {
|
||||||
balance: number;
|
status: boolean;
|
||||||
|
error?: {
|
||||||
|
root? : string;
|
||||||
|
errorKey?: string;
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
data?: {
|
||||||
|
balance?: number;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 입금확인증 다운로드
|
// 입금확인증 다운로드
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { showAlert } from '@/widgets/show-alert';
|
|||||||
import { snackBar } from '@/shared/lib';
|
import { snackBar } from '@/shared/lib';
|
||||||
import { DepositReceiptSample } from '@/entities/common/ui/deposit-receipt-sample';
|
import { DepositReceiptSample } from '@/entities/common/ui/deposit-receipt-sample';
|
||||||
import { DepositInfo } from '@/entities/transaction/model/types';
|
import { DepositInfo } from '@/entities/transaction/model/types';
|
||||||
|
import { useDownloadBottomSheetOn2Store } from '@/shared/model/store';
|
||||||
|
|
||||||
export interface FundAccountResultDetailProps {
|
export interface FundAccountResultDetailProps {
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
@@ -31,10 +32,9 @@ export const FundAccountResultDetail = ({
|
|||||||
tid
|
tid
|
||||||
}: FundAccountResultDetailProps) => {
|
}: FundAccountResultDetailProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { downloadBottomSheetOn2, setDownloadBottomSheetOn2 } = useDownloadBottomSheetOn2Store();
|
||||||
|
|
||||||
const [detail, setDetail] = useState<ExtensionFundAccountResultDetailResponse>();
|
const [detail, setDetail] = useState<ExtensionFundAccountResultDetailResponse>();
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
|
||||||
const [depositReceiptSampleOn, setDepositReceiptSampleOn] = useState<boolean>(false);
|
const [depositReceiptSampleOn, setDepositReceiptSampleOn] = useState<boolean>(false);
|
||||||
const { mutateAsync: extensionFundAccountResultDetail } = useExtensionFundAccountResultDetailMutation();
|
const { mutateAsync: extensionFundAccountResultDetail } = useExtensionFundAccountResultDetailMutation();
|
||||||
const { mutateAsync: extensionFundAccountDownlaodReceipt } = useExtensionFundAccountDownloadReceiptMutation();
|
const { mutateAsync: extensionFundAccountDownlaodReceipt } = useExtensionFundAccountDownloadReceiptMutation();
|
||||||
@@ -57,7 +57,7 @@ export const FundAccountResultDetail = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onClickToOpenDownloadBottomSheet = () => {
|
const onClickToOpenDownloadBottomSheet = () => {
|
||||||
setDownloadBottomSheetOn(true);
|
setDownloadBottomSheetOn2(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRequestDownload = (
|
const onRequestDownload = (
|
||||||
@@ -200,17 +200,17 @@ export const FundAccountResultDetail = ({
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!!downloadBottomSheetOn &&
|
{!!downloadBottomSheetOn2 &&
|
||||||
<DownloadBottomSheet
|
<DownloadBottomSheet
|
||||||
bottomSheetOn={downloadBottomSheetOn}
|
bottomSheetOn={downloadBottomSheetOn2}
|
||||||
setBottomSheetOn={setDownloadBottomSheetOn}
|
setBottomSheetOn={setDownloadBottomSheetOn2}
|
||||||
imageMode={true}
|
imageMode={true}
|
||||||
emailMode={true}
|
emailMode={true}
|
||||||
sendRequest={onRequestDownload}
|
sendRequest={onRequestDownload}
|
||||||
></DownloadBottomSheet>
|
></DownloadBottomSheet>
|
||||||
}
|
}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
{ depositReceiptSampleOn &&
|
{depositReceiptSampleOn &&
|
||||||
<DepositReceiptSample
|
<DepositReceiptSample
|
||||||
depositReceiptSampleOn={depositReceiptSampleOn}
|
depositReceiptSampleOn={depositReceiptSampleOn}
|
||||||
setDepositReceiptSampleOn={setDepositReceiptSampleOn}
|
setDepositReceiptSampleOn={setDepositReceiptSampleOn}
|
||||||
|
|||||||
@@ -194,7 +194,17 @@ export const FundAccountTransferListWrap = () => {
|
|||||||
mid: mid
|
mid: mid
|
||||||
};
|
};
|
||||||
extensionFundAccountBalance(params).then((rs: ExtensionFundAccountBalanceResponse) => {
|
extensionFundAccountBalance(params).then((rs: ExtensionFundAccountBalanceResponse) => {
|
||||||
setBalance(rs.balance);
|
if (rs.status) {
|
||||||
|
if (!rs.data?.balance) {
|
||||||
|
setBalance(0);
|
||||||
|
} else {
|
||||||
|
setBalance(balance)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const errorMessage = rs.error?.message || t('additionalService.fundAccount.failRequestBalance');
|
||||||
|
setBalance(0);
|
||||||
|
snackBar(errorMessage)
|
||||||
|
}
|
||||||
}).catch((e: any) => {
|
}).catch((e: any) => {
|
||||||
if (e.response?.data?.error?.message) {
|
if (e.response?.data?.error?.message) {
|
||||||
snackBar(e.response?.data?.error?.message);
|
snackBar(e.response?.data?.error?.message);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { checkGrant } from '@/shared/lib/check-grant';
|
|||||||
import { snackBar } from '@/shared/lib';
|
import { snackBar } from '@/shared/lib';
|
||||||
import { DepositReceiptSample } from '@/entities/common/ui/deposit-receipt-sample';
|
import { DepositReceiptSample } from '@/entities/common/ui/deposit-receipt-sample';
|
||||||
import { DepositInfo } from '@/entities/transaction/model/types';
|
import { DepositInfo } from '@/entities/transaction/model/types';
|
||||||
|
import { useDownloadBottomSheetOn2Store } from '@/shared/model/store';
|
||||||
|
|
||||||
export interface PayoutDetailProps {
|
export interface PayoutDetailProps {
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
@@ -30,10 +31,9 @@ export const PayoutDetail = ({
|
|||||||
depositAmount
|
depositAmount
|
||||||
}: PayoutDetailProps) => {
|
}: PayoutDetailProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { downloadBottomSheetOn2, setDownloadBottomSheetOn2 } = useDownloadBottomSheetOn2Store();
|
||||||
const [detail, setDetail] = useState<ExtensionPayoutDetailResponse>();
|
const [detail, setDetail] = useState<ExtensionPayoutDetailResponse>();
|
||||||
|
|
||||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
|
||||||
const [depositReceiptSampleOn, setDepositReceiptSampleOn] = useState<boolean>(false);
|
const [depositReceiptSampleOn, setDepositReceiptSampleOn] = useState<boolean>(false);
|
||||||
const [depositReceiptData, setDepositReceiptData] = useState<ExtensionPayoutDetailDownloadCertificateResponse>();
|
const [depositReceiptData, setDepositReceiptData] = useState<ExtensionPayoutDetailDownloadCertificateResponse>();
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ export const PayoutDetail = ({
|
|||||||
showAlert(t('common.nopermission'));
|
showAlert(t('common.nopermission'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setDownloadBottomSheetOn(true);
|
setDownloadBottomSheetOn2(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRequestDownload = (
|
const onRequestDownload = (
|
||||||
@@ -208,10 +208,10 @@ export const PayoutDetail = ({
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!!downloadBottomSheetOn &&
|
{!!downloadBottomSheetOn2 &&
|
||||||
<DownloadBottomSheet
|
<DownloadBottomSheet
|
||||||
bottomSheetOn={downloadBottomSheetOn}
|
bottomSheetOn={ downloadBottomSheetOn2 }
|
||||||
setBottomSheetOn={setDownloadBottomSheetOn}
|
setBottomSheetOn={ setDownloadBottomSheetOn2 }
|
||||||
imageMode={true}
|
imageMode={true}
|
||||||
emailMode={true}
|
emailMode={true}
|
||||||
sendRequest={onRequestDownload}
|
sendRequest={onRequestDownload}
|
||||||
|
|||||||
@@ -1131,6 +1131,7 @@
|
|||||||
"registrationSuccess": "Transfer registration successful.",
|
"registrationSuccess": "Transfer registration successful.",
|
||||||
"registrationFailed": "Transfer registration failed.",
|
"registrationFailed": "Transfer registration failed.",
|
||||||
"registrationError": "An error occurred during transfer registration.",
|
"registrationError": "An error occurred during transfer registration.",
|
||||||
|
"failReqeustBalance": "An error occured during request balance",
|
||||||
"register": "Register",
|
"register": "Register",
|
||||||
"transferDetailTitle": "Fund Transfer Detail",
|
"transferDetailTitle": "Fund Transfer Detail",
|
||||||
"detailInfo": "Detail Information",
|
"detailInfo": "Detail Information",
|
||||||
|
|||||||
@@ -1131,6 +1131,7 @@
|
|||||||
"registrationSuccess": "이체등록을 성공하였습니다.",
|
"registrationSuccess": "이체등록을 성공하였습니다.",
|
||||||
"registrationFailed": "이체등록이 실패하였습니다.",
|
"registrationFailed": "이체등록이 실패하였습니다.",
|
||||||
"registrationError": "이체등록 중 오류가 발생했습니다.",
|
"registrationError": "이체등록 중 오류가 발생했습니다.",
|
||||||
|
"failReqeustBalance": "잔액을 불러오는데 실패했습니다.",
|
||||||
"register": "등록",
|
"register": "등록",
|
||||||
"transferDetailTitle": "자금이체 상세",
|
"transferDetailTitle": "자금이체 상세",
|
||||||
"detailInfo": "상세 정보",
|
"detailInfo": "상세 정보",
|
||||||
|
|||||||
Reference in New Issue
Block a user