|
@@ -202,54 +202,50 @@ const Deposit = () => {
|
|
|
|
|
|
if (!amount) return Toast.show({ content: t("form.amount") });
|
|
|
|
|
|
- const res = await getUserMoneyApi();
|
|
|
-
|
|
|
- if (res.data?.tips_reset_rollover) {
|
|
|
- tipModelRef.current?.onOpen();
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
handleUserRecharge(false);
|
|
|
};
|
|
|
const handleUserRecharge = async (is_reset_rollover: boolean, data?: any) => {
|
|
|
- const values = formInstanceRef.current.getFieldsValue();
|
|
|
- const params: any = {
|
|
|
- channel_id: currentChannel?.id,
|
|
|
- amount: +values.amount,
|
|
|
- prod_id: currentProduct?.id,
|
|
|
- };
|
|
|
+ try {
|
|
|
+ goBlankPage(async () => {
|
|
|
+ if (!is_reset_rollover) {
|
|
|
+ const res = await getUserMoneyApi();
|
|
|
|
|
|
- if (isStrictMode) {
|
|
|
- params.user_name = `${values.name} ${values.lastname}`;
|
|
|
- params.passport = values.passport;
|
|
|
- }
|
|
|
+ if (res.data?.tips_reset_rollover) {
|
|
|
+ tipModelRef.current?.onOpen();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- try {
|
|
|
- const res = await getUserRechargeApi({ is_reset_rollover, ...params });
|
|
|
- formInstanceRef.current?.resetFields();
|
|
|
- tipModelRef.current?.onClose();
|
|
|
- setAmount("");
|
|
|
- const url =
|
|
|
- "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";
|
|
|
- // const a = document.createElement("a");
|
|
|
- // a.target = "_blank";
|
|
|
- // a.href = url;
|
|
|
- // document.body.append(a);
|
|
|
- // setTimeout(() => {
|
|
|
- // a.click();
|
|
|
- // // window.open(url);
|
|
|
- // }, 300);
|
|
|
- goBlankPage(url, "_blank");
|
|
|
- if (res.data.pay_url) {
|
|
|
- eventInitiate();
|
|
|
+ const values = formInstanceRef.current.getFieldsValue();
|
|
|
+ const params: any = {
|
|
|
+ channel_id: currentChannel?.id,
|
|
|
+ amount: +values.amount,
|
|
|
+ prod_id: currentProduct?.id,
|
|
|
+ };
|
|
|
|
|
|
- // fix: ios 限制
|
|
|
- // setTimeout(() => {
|
|
|
- // window.open(res.data.pay_url);
|
|
|
- // }, 0);
|
|
|
- } else {
|
|
|
- Toast.show({ icon: "success", content: t("code.200"), maskClickable: false });
|
|
|
- }
|
|
|
+ if (isStrictMode) {
|
|
|
+ params.user_name = `${values.name} ${values.lastname}`;
|
|
|
+ params.passport = values.passport;
|
|
|
+ }
|
|
|
+
|
|
|
+ const res = await getUserRechargeApi({ is_reset_rollover, ...params });
|
|
|
+ formInstanceRef.current?.resetFields();
|
|
|
+ tipModelRef.current?.onClose();
|
|
|
+ setAmount("");
|
|
|
+ // const url =
|
|
|
+ // "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) {
|
|
|
+ eventInitiate();
|
|
|
+ return res.data.pay_url;
|
|
|
+ // fix: ios 限制
|
|
|
+ // setTimeout(() => {
|
|
|
+ // window.open(res.data.pay_url);
|
|
|
+ // }, 0);
|
|
|
+ } else {
|
|
|
+ Toast.show({ icon: "success", content: t("code.200"), maskClickable: false });
|
|
|
+ }
|
|
|
+ // return url;
|
|
|
+ }, "_blank");
|
|
|
|
|
|
// await actions();
|
|
|
} catch (error: any) {
|