From ff864fe64d75702f499b0b4591bc8b06bd72d08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=9D=B0?= Date: Sat, 7 Feb 2026 17:37:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=B8=A4=E5=A4=84?= =?UTF-8?q?=E6=B5=B7=E6=8A=A5logo-text=E5=9B=BE=E7=89=87=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=9B=E5=BB=BA=E7=90=83=E5=B1=80=E5=90=8E=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E8=AF=A6=E6=83=85=E9=A1=B5=E6=89=93=E5=BC=80=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E5=BC=B9=E7=AA=97=E4=BD=8D=E7=BD=AE=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=86=E4=BA=AB=E4=BA=8C=E7=BB=B4=E7=A0=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=8F=96=E5=80=BC=E3=80=81=E4=BF=AE=E6=94=B9ntrp?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=B9=E7=AA=97=E7=9A=84=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=80=BC=E3=80=81=E5=A2=9E=E5=8A=A0=E5=A4=8D=E5=88=B6=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Comments/index.tsx | 218 +++++++++--------- src/components/NTRPEvaluatePopup/index.tsx | 4 +- .../detail/components/SharePopup/index.tsx | 25 +- src/game_pages/detail/index.tsx | 14 +- src/game_pages/sharePoster/index.tsx | 11 +- src/other_pages/ntrp-evaluate/index.tsx | 56 +++-- src/publish_pages/publishBall/index.tsx | 26 +-- src/services/detailService.ts | 5 + src/static/ntrp/ntrp_share_logo.png | Bin 23405 -> 18762 bytes src/utils/genPoster.ts | 3 +- 10 files changed, 194 insertions(+), 168 deletions(-) diff --git a/src/components/Comments/index.tsx b/src/components/Comments/index.tsx index e8eebb1..b470461 100644 --- a/src/components/Comments/index.tsx +++ b/src/components/Comments/index.tsx @@ -34,7 +34,7 @@ function toast(msg) { interface CommentInputProps { onConfirm?: ( - value: { content: string } & Partial + value: { content: string } & Partial, ) => void; } @@ -49,119 +49,118 @@ interface CommentInputReplyParamsType { nickname: string; } -const CommentInput = forwardRef(function ( - props, - ref -) { - const { onConfirm } = props; - const [visible, setVisible] = useState(false); - const [value, setValue] = useState(""); - const [params, setParams] = useState< - CommentInputReplyParamsType | undefined - >(); +const CommentInput = forwardRef( + function (props, ref) { + const { onConfirm } = props; + const [visible, setVisible] = useState(false); + const [value, setValue] = useState(""); + const [params, setParams] = useState< + CommentInputReplyParamsType | undefined + >(); - const { - keyboardHeight, - isKeyboardVisible, - addListener, - initializeKeyboardListener, - } = useKeyboardHeight(); + const { + keyboardHeight, + isKeyboardVisible, + addListener, + initializeKeyboardListener, + } = useKeyboardHeight(); - // 使用全局键盘状态监听 - useEffect(() => { - // 初始化全局键盘监听器 - initializeKeyboardListener(); + // 使用全局键盘状态监听 + useEffect(() => { + // 初始化全局键盘监听器 + initializeKeyboardListener(); - // 添加本地监听器 - const removeListener = addListener((height, visible) => { - console.log("PublishBall 收到键盘变化:", height, visible); - // 这里只记录或用于其他逻辑,布局是否响应交由 shouldReactToKeyboard 决定 - }); + // 添加本地监听器 + const removeListener = addListener(() => { + // 布局是否响应交由 shouldReactToKeyboard 决定 + }); - return () => { - removeListener(); - }; - }, [initializeKeyboardListener, addListener]); + return () => { + removeListener(); + }; + }, [initializeKeyboardListener, addListener]); - const inputDomRef = useRef(null); + const inputDomRef = useRef(null); - useImperativeHandle(ref, () => ({ - show: (_params: CommentInputReplyParamsType | undefined) => { - setVisible(true); - setTimeout(() => { - inputDomRef.current && inputDomRef.current?.focus(); - }, 100); - setParams(_params); - }, - })); + useImperativeHandle(ref, () => ({ + show: (_params: CommentInputReplyParamsType | undefined) => { + setVisible(true); + setTimeout(() => { + inputDomRef.current && inputDomRef.current?.focus(); + }, 100); + setParams(_params); + }, + })); - function handleSend() { - if (!value) { - toast("评论内容不得为空"); - return; + function handleSend() { + if (!value) { + toast("评论内容不得为空"); + return; + } + if (value.length > 200) { + return; + } + onConfirm?.({ content: value, ...params }); + onClose(); } - if (value.length > 200) { - return; - } - onConfirm?.({ content: value, ...params }); - onClose(); - } - function onClose() { - setVisible(false); - setValue(""); - inputDomRef.current && inputDomRef.current?.blur(); - } - console.log(keyboardHeight, "keyboardHeight"); - return ( - 0 ? `${keyboardHeight}px` : "0", - }} - enableDragToClose={false} - > - - -