year 2 tygodni temu
rodzic
commit
8e32cbbd6d

+ 12 - 4
src/app/[locale]/(TabBar)/[[...share]]/_home/DownloadSection.tsx

@@ -1,17 +1,25 @@
 "use client";
 import { Link } from "@/i18n/routing";
 import { useEffect, useState } from "react";
-function isWebView() {
-    const userAgent = window.navigator && navigator.userAgent;
+// function isWebView() {
+//     const userAgent = window.navigator && navigator.userAgent;
 
-    return /WebView|iPhone|iPod|Android/.test(userAgent);
+//     return /WebView|iPhone|iPod|Android/.test(userAgent);
+// }
+function isWebView() {
+    const ua = navigator.userAgent.toLowerCase();
+    return (
+        (ua.indexOf("wv") > -1 || (ua.indexOf("android") > -1 && ua.indexOf("mobile") > -1)) &&
+        ua.indexOf("like mac os x") === -1
+    );
 }
+
 const DownloadSection = () => {
     const [visible, setVisible] = useState<boolean>(false);
 
     useEffect(() => {
         const isCloseDownload = sessionStorage.getItem("isCloseDownload");
-        if (isWebView() || isCloseDownload) {
+        if (window?.isAndroidAPK || isCloseDownload) {
             setVisible(true);
         }
     }, []);

+ 2 - 2
src/app/[locale]/(TabBar)/deposit/component/deposit/index.tsx

@@ -285,9 +285,9 @@ const Deposit = () => {
                                         /> */}
                                         {item.name}
                                     </div>
-                                    <div className="mt-[.02rem] text-[.13rem]">
+                                    {/* <div className="mt-[.02rem] text-[.13rem]">
                                         R${shopType.condition.min}~{shopType.condition.max}
-                                    </div>
+                                    </div> */}
                                     {/* <i className={clsx("iconfont icon-gouxuan1", styles.checked)}></i> */}
                                     {/* <div className={styles.cover}></div> */}
                                 </div>

+ 11 - 6
src/app/[locale]/(TabBar)/deposit/component/withdraw/index.tsx

@@ -140,11 +140,11 @@ const Withdraw = () => {
                 case "account_no":
                     {
                         if (currentType.type === ChannelEnum.CPF) {
-                            const toValue = inputNumber(curValue, { length: 11 });
+                            const toValue = inputNumber(curValue, { length: 11, notNumber: true });
                             formInstanceRef.current?.setFieldValue(key, toValue);
                         }
                         if (currentType.type === ChannelEnum.CNPJ) {
-                            const toValue = inputNumber(curValue, { length: 14 });
+                            const toValue = inputNumber(curValue, { length: 14, notNumber: true });
                             formInstanceRef.current?.setFieldValue(key, toValue);
                         }
                         if (currentType.type === ChannelEnum.Phone) {
@@ -159,7 +159,7 @@ const Withdraw = () => {
                     break;
                 case "passport":
                     {
-                        const toValue = inputNumber(curValue, { length: 11 });
+                        const toValue = inputNumber(curValue, { length: 11, notNumber: true });
                         formInstanceRef.current?.setFieldValue(key, toValue);
                     }
                     break;
@@ -172,16 +172,21 @@ const Withdraw = () => {
         opts?: {
             max?: number;
             length?: number;
+            notNumber?: boolean;
         }
     ) => {
         const toValue = value.replace(/[^0-9]/gi, "");
         let toAmount = "";
-        if (toValue) {
+        if (toValue && !opts?.notNumber) {
             toAmount = new BigNumber(toValue).toFixed(0, BigNumber.ROUND_DOWN);
+            if (opts?.max !== undefined && new BigNumber(toAmount).isGreaterThan(opts.max)) {
+                toAmount = opts.max.toString();
+            }
         }
-        if (opts?.max !== undefined && new BigNumber(toAmount).isGreaterThan(opts.max)) {
-            toAmount = opts.max.toString();
+        if (toValue && opts?.notNumber) {
+            toAmount = toValue;
         }
+
         if (opts?.length && toAmount.length > opts.length) {
             toAmount = toAmount.slice(0, opts.length);
         }

+ 1 - 1
src/components/Card/Card.tsx

@@ -173,7 +173,7 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
                     onClick={() => handler(item!)}
                 >
                     <Image
-                        lazy={true}
+                        // lazy={true}
                         src={item?.game_icon}
                         alt={item?.game_name_cn}
                         width={"100%"}

+ 1 - 1
src/types/global.d.ts

@@ -9,7 +9,7 @@ declare global {
         var config: DefaultConfigTypes;
         var fbq: (event: string, eventName: string, params?: any) => void;
         var kwaiq: Kwaiq;
-
+        var isAndroidAPK: boolean;
         var pomelo: any;
     }