|
@@ -13,6 +13,7 @@ import { FC, Fragment, useLayoutEffect, useRef, useState } from "react";
|
|
|
|
|
|
import actions from "@/app/[locale]/(TabBar)/deposit/actions";
|
|
|
import Empty from "@/components/Empty";
|
|
|
+import { useRouter } from "@/i18n/routing";
|
|
|
import "@/styles/deposit.scss";
|
|
|
import { server } from "@/utils/client";
|
|
|
interface Props {}
|
|
@@ -75,6 +76,7 @@ const getDepositApi = async () => {
|
|
|
};
|
|
|
const DepositData: FC<Props> = (props) => {
|
|
|
const t = useTranslations();
|
|
|
+ const router = useRouter();
|
|
|
const userInfo = useUserInfoStore((state) => state.userInfo);
|
|
|
const [depositState, setDepositState] = useState<DepositsTypes[]>([]);
|
|
|
|
|
@@ -95,7 +97,6 @@ const DepositData: FC<Props> = (props) => {
|
|
|
const onFinish = async (values: any) => {
|
|
|
const params = { ...values, channel_id: activeType.id, amount: +values.amount };
|
|
|
const res = await getUserMoneyApi();
|
|
|
- console.log(`🚀🚀🚀🚀🚀-> in DepositData.tsx on 99`, res);
|
|
|
if (res.data?.tips_reset_rollover) {
|
|
|
tipModelRef.current?.onOpen();
|
|
|
setFormData(params);
|
|
@@ -112,10 +113,14 @@ const DepositData: FC<Props> = (props) => {
|
|
|
// Toast.show({ icon: "success", content: t("code.200"), maskClickable: false });
|
|
|
tipModelRef.current?.onClose();
|
|
|
setAmount(undefined);
|
|
|
+ // const url = encodeURIComponent(
|
|
|
+ // "https://caixa.pay4z.com/brl/qrcode.html?tradeNo=T2501180056ijk21kJ&amount=20&payAmount=20¤cy=BRL&expiredAt=2025-01-18%2001%3A11%3A31&expire=1737173491282&raw=00020101021226870014br.gov.bcb.pix2565qrcode.santsbank.com%2Fdynamic%2Fdc8cf003-1616-47f8-94e6-16be500d05b45204000053039865802BR5907LF%20LTDA6009Sao%20Paulo62070503***6304DF54&type=QRCODE"
|
|
|
+ // );
|
|
|
|
|
|
if (res.data.pay_url) {
|
|
|
- // window.open(res.data.pay_url);
|
|
|
- window.open("https://www.taobao.com");
|
|
|
+ router.push(`/payinfo?url=${res.data.pay_url}`);
|
|
|
+ } else {
|
|
|
+ Toast.show({ icon: "success", content: t("code.200"), maskClickable: false });
|
|
|
}
|
|
|
const data = await getDepositApi();
|
|
|
setDepositState(data);
|