瀏覽代碼

关闭需求

zcj03 6 月之前
父節點
當前提交
af1a89f6dd
共有 2 個文件被更改,包括 22 次插入8 次删除
  1. 二進制
      public/close_login.png
  2. 22 8
      src/app/[locale]/game/page.tsx

二進制
public/close_login.png


+ 22 - 8
src/app/[locale]/game/page.tsx

@@ -33,24 +33,38 @@ const Page = () => {
     const goBlack = () => {
         router.push("/")
     }
+    const [showClose, setShowClose] = useState<boolean>(false);
+    useEffect(() => {
+        const iframe_game: any = document.getElementById('iframe_game');
+        iframe_game.addEventListener('load', () => { setShowClose(true) });
+        return () => iframe_game.removeEventListener("load", () => { setShowClose(true) });
+    }, []);
+
     return (
         <>
-            <div style={{ width: "100%", height: "100%" }}>
+            <div style={{ width: "100%", height: "100%", backgroundColor: "#000" }}>
+                <iframe id="iframe_game" src={url} width={"100%"} height={"100%"} style={{paddingBottom: '.4rem'}}></iframe>
                 {/* 真人游戏添加关闭按钮 */}
                 {
-                    categoryName === "Live Casino Jogos" && <i 
-                        className={"iconfont icon-guanbi"} 
+                    showClose && ["Live Casino Jogos", 'PG'].includes(categoryName) && <div 
                         style={{
                             position: 'fixed',
-                            top: '0.1rem',
-                            right: '0.1rem',
+                            bottom: '0',
+                            right: '0',
                             zIndex: "99999",
-                            fontSize: '.2rem'
+                            width: "100%",
+                            height: ".4rem",
+                            display: "flex",
+                            alignItems: "center",
+                            justifyContent: "center",
+                            backgroundColor: "#000"
                         }} 
                         onClick={goBlack}
-                    ></i>
+                    >
+                        {/* <i className={"iconfont icon-guanbi"} style={{ fontSize: '.2rem'}}></i>    */}
+                        <img src="/close_login.png" alt="" style={{ width: '.22rem'}}/>
+                    </div>
                 }
-                <iframe src={url} width={"100%"} height={"100%"}></iframe>
             </div>
 
             {/* 数千补偿 */}