增加发布仅上海地区可发布、发布防抖
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
EvaluateCallback,
|
||||
EvaluateScene,
|
||||
} from "@/store/evaluateStore";
|
||||
import { useListState } from "@/store/listStore";
|
||||
|
||||
import { navigateTo, redirectTo, navigateBack } from "@/utils/navigation";
|
||||
import { requireLoginWithPhone } from "@/utils/helper";
|
||||
import styles from "./index.module.scss";
|
||||
@@ -24,6 +26,11 @@ const PublishMenu: React.FC<PublishMenuProps> = (props) => {
|
||||
const { onVisibleChange } = props;
|
||||
const [isVisible, setIsVisible] = useState(false);
|
||||
|
||||
const {
|
||||
area
|
||||
} = useListState();
|
||||
|
||||
|
||||
// 使用 useEffect 监听 isVisible 变化,确保所有情况都能触发回调
|
||||
useEffect(() => {
|
||||
onVisibleChange?.(isVisible);
|
||||
@@ -59,6 +66,16 @@ const PublishMenu: React.FC<PublishMenuProps> = (props) => {
|
||||
});
|
||||
};
|
||||
const handleMenuItemClick = (type: "individual" | "group" | "ai") => {
|
||||
const [_, address] = area;
|
||||
if (address !== '上海') {
|
||||
(Taro as any).showModal({
|
||||
title: '提示',
|
||||
content: '仅上海地区开放,您可加入社群或切换城市',
|
||||
showCancel: false,
|
||||
confirmText: '知道了'
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (!userInfo.ntrp_level) {
|
||||
ntrpRef.current.show({
|
||||
type: EvaluateScene.publish,
|
||||
|
||||
Reference in New Issue
Block a user