diff --git a/public/img/qr.png b/public/img/qr.png new file mode 100644 index 0000000..da7c1db Binary files /dev/null and b/public/img/qr.png differ diff --git a/src/components/ChatUI.tsx b/src/components/ChatUI.tsx index 4081d65..55f89fc 100644 --- a/src/components/ChatUI.tsx +++ b/src/components/ChatUI.tsx @@ -525,13 +525,18 @@ const ChatUI = () => { ))}
+ {/* 添加一个二维码 */} +
+ QR Code +

扫码体验AI群聊

+
{/* Input Area */}
-
+
@@ -563,9 +568,8 @@ const ChatUI = () => { {isLoading ? (
) : ( - + )} - 发送
diff --git a/src/components/SharePoster.tsx b/src/components/SharePoster.tsx index 1025a76..3a0b9ae 100644 --- a/src/components/SharePoster.tsx +++ b/src/components/SharePoster.tsx @@ -28,7 +28,10 @@ export function SharePoster({ isOpen, onClose, chatAreaRef }: SharePosterProps) try { const messageContainer = chatAreaRef.current.querySelector('.space-y-4'); if (!messageContainer) return; - + const qrCode = messageContainer.querySelector('#qrcode'); + if (qrCode) { + qrCode.classList.remove('hidden'); + } // 预处理所有图片 const preloadImages = async () => { const images = Array.from(messageContainer.getElementsByTagName('img')); @@ -141,7 +144,16 @@ export function SharePoster({ isOpen, onClose, chatAreaRef }: SharePosterProps) }; return ( - + { + if (!open) { + // Hide QR code when dialog closes + const qrCode = chatAreaRef.current?.querySelector('#qrcode'); + if (qrCode) { + qrCode.classList.add('hidden'); + } + onClose(); + } + }}> {/* 图片容器 */}