修复 z-index 层级问题

This commit is contained in:
张成
2025-11-09 23:07:38 +08:00
parent 302720ba18
commit df875feaec
11 changed files with 177 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
import React, { useState, useRef } from "react";
import React, { useState, useRef, useEffect } from "react";
import { View, Text, Image } from "@tarojs/components";
import Taro from "@tarojs/taro";
import { useUserInfo } from "@/store/userStore";
@@ -15,10 +15,17 @@ import NTRPEvaluatePopup from "../NTRPEvaluatePopup";
export interface PublishMenuProps {
onPersonalPublish?: () => void;
onActivityPublish?: () => void;
onVisibleChange?: (visible: boolean) => void; // 菜单显示/隐藏回调
}
const PublishMenu: React.FC<PublishMenuProps> = () => {
const PublishMenu: React.FC<PublishMenuProps> = (props) => {
const { onVisibleChange } = props;
const [isVisible, setIsVisible] = useState(false);
// 使用 useEffect 监听 isVisible 变化,确保所有情况都能触发回调
useEffect(() => {
onVisibleChange?.(isVisible);
}, [isVisible, onVisibleChange]);
const [aiImportVisible, setAiImportVisible] = useState(false);
const userInfo = useUserInfo();
const ntrpRef = useRef<{