添加程序选择

This commit is contained in:
张成
2025-11-23 00:24:31 +08:00
parent 17015c0cca
commit 8b3f6c5a3a
18 changed files with 1296 additions and 47 deletions

View File

@@ -3,6 +3,7 @@ import { View } from "@tarojs/components";
import Taro from "@tarojs/taro";
import { wechat_auth_login, save_login_state } from "@/services/loginService";
import { useUserActions } from "@/store/userStore";
import { useGlobalState } from "@/store/global";
import tokenManager from "@/utils/tokenManager";
import GuideBar from "@/components/GuideBar";
import { GeneralNavbar } from "@/components";
@@ -18,17 +19,17 @@ type TabType = "list" | "message" | "personal";
const MainPage: React.FC = () => {
const [currentTab, setCurrentTab] = useState<TabType>("list");
const [isPublishMenuVisible, setIsPublishMenuVisible] = useState(false);
const [guideBarZIndex, setGuideBarZIndex] = useState<'low' | 'high'>('high');
const [isDistanceFilterVisible, setIsDistanceFilterVisible] = useState(false);
const [isCityPickerVisible, setIsCityPickerVisible] = useState(false);
const [isFilterPopupVisible, setIsFilterPopupVisible] = useState(false);
const [isShowInputCustomerNavBar, setIsShowInputCustomerNavBar] = useState(false);
const [listPageScrollToTopTrigger, setListPageScrollToTopTrigger] = useState(0);
const [showGuideBar, setShowGuideBar] = useState(true);
const [showAuthError, setShowAuthError] = useState(false);
const [authErrorMessage, setAuthErrorMessage] = useState('');
const { fetchUserInfo } = useUserActions();
// 从 store 获取 GuideBar 相关状态和方法
const { showGuideBar, guideBarZIndex, setShowGuideBar, setGuideBarZIndex } = useGlobalState();
// 初始化:自动微信授权并获取用户信息
useEffect(() => {
@@ -201,7 +202,8 @@ const MainPage: React.FC = () => {
};
const handleGrandchildTrigger = (value) => {
setShowGuideBar(!value)
console.log('[MainPage] handleGrandchildTrigger called with:', value);
setShowGuideBar(!value);
}
return (