year vor 3 Monaten
Ursprung
Commit
e9db160265

+ 2 - 0
src/app/[locale]/(TabBar)/[[...share]]/@actionWidget/Dialog.tsx

@@ -1,3 +1,4 @@
+import DialogImg from "@/dialog/img";
 import DialogPay from "@/dialog/pay";
 import DialogSign from "@/dialog/sign";
 import DialogWheel from "@/dialog/wheel";
@@ -8,6 +9,7 @@ const Dialogs = () => {
             <DialogWheel></DialogWheel>
             <DialogSign></DialogSign>
             <DialogPay></DialogPay>
+            <DialogImg></DialogImg>
         </>
     );
 };

+ 0 - 0
src/dialog/img/index.module.scss


+ 26 - 0
src/dialog/img/index.tsx

@@ -0,0 +1,26 @@
+"use client";
+import { Mask } from "antd-mobile";
+import React from "react";
+import dialogManage from "../manager";
+
+const ImgDialog = () => {
+    const keyName = "ImgDialog"; // 确保这个keyName是唯一的,与其他地方的keyName不同,以避免冲突
+
+    React.useEffect(() => {
+        dialogManage.registerDialog({
+            key: keyName,
+            show(data: any, idx: number) {
+                console.log(data, idx);
+            },
+            hide() {},
+        });
+    });
+
+    return (
+        <>
+            <Mask visible={false}></Mask>
+        </>
+    );
+};
+
+export default ImgDialog;

+ 1 - 0
src/dialog/manager.ts

@@ -25,6 +25,7 @@ class DialogManage {
     showDialog(key: string, ...args: any[]) {
         return new Promise((resolve) => {
             const dialog = this._dialogs.get(key);
+            console.log("showDialog", Object.fromEntries(this._dialogs));
             this._resolve = resolve;
             if (dialog) {
                 dialog.show && dialog.show(...args);