diff --git a/src/game_pages/detail/index.tsx b/src/game_pages/detail/index.tsx index 45d1409..93b5930 100644 --- a/src/game_pages/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -333,7 +333,9 @@ function Coursel(props) { // 分享弹窗 const SharePopup = forwardRef(({ id, from, detail, userInfo }, ref) => { const [visible, setVisible] = useState(false); + const [publishFlag, setPublishFlag] = useState(false); // const posterRef = useRef(); + const { max_participants, participant_count } = detail || {}; useEffect(() => { if (id) { @@ -361,7 +363,8 @@ const SharePopup = forwardRef(({ id, from, detail, userInfo }, ref) => { } useImperativeHandle(ref, () => ({ - show: () => { + show: (publish_flag = false) => { + setPublishFlag(publish_flag); setVisible(true); }, })); @@ -451,6 +454,7 @@ const SharePopup = forwardRef(({ id, from, detail, userInfo }, ref) => { function onClose() { setVisible(false); + setPublishFlag(false); } return ( @@ -467,11 +471,27 @@ const SharePopup = forwardRef(({ id, from, detail, userInfo }, ref) => { > - 分享至 + {publishFlag ? ( + 球局发布成功 🎉 + ) : ( + 分享至 + )} + {publishFlag && ( + + + 还剩 + + {" "} + {max_participants - participant_count}{" "} + + 人加入完成组局, 去邀请好友加入吧~ + + + )}