diff --git a/src/components/CommonPopup/index.module.scss b/src/components/CommonPopup/index.module.scss index 36570dd..0d0d84a 100644 --- a/src/components/CommonPopup/index.module.scss +++ b/src/components/CommonPopup/index.module.scss @@ -49,7 +49,7 @@ align-items: center; justify-content: space-between; padding: 16px 20px; - border-bottom: 1px solid rgba(0, 0, 0, 0.06); + // border-bottom: 1px solid rgba(0, 0, 0, 0.06); .common-popup__title { font-family: "PingFang SC"; diff --git a/src/components/EditModal/EditModal.scss b/src/components/EditModal/EditModal.scss index 8fe4fab..3c42797 100644 --- a/src/components/EditModal/EditModal.scss +++ b/src/components/EditModal/EditModal.scss @@ -35,7 +35,7 @@ align-items: center; justify-content: space-between; padding: 16px 20px; - border-bottom: 1px solid rgba(0, 0, 0, 0.06); + // border-bottom: 1px solid rgba(0, 0, 0, 0.06); .modal_title { font-family: 'PingFang SC'; diff --git a/src/components/UserInfo/index.scss b/src/components/UserInfo/index.scss index 11c94d2..39d0966 100644 --- a/src/components/UserInfo/index.scss +++ b/src/components/UserInfo/index.scss @@ -122,7 +122,7 @@ align-items: center; gap: 12px; border: 1px solid rgba(0, 0, 0, 0.2); - border-radius: 20px; + border-radius: 999px; .follow_button { display: flex; diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index 3fce108..fb9885f 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from "react"; +import React, { useState, useEffect, useRef, useContext } from "react"; import Taro, { useDidShow } from "@tarojs/taro"; import { View, Text, Image, Button } from "@tarojs/components"; import "./index.scss"; @@ -10,6 +10,7 @@ import { useUserActions } from "@/store/userStore"; import { UserInfoType } from "@/services/userService"; import { useCities, useProfessions } from "@/store/pickerOptionsStore"; import { formatNtrpDisplay } from "@/utils/helper"; +import FamilyContext from '@/context'; // 用户信息接口 // export interface UserInfo { @@ -71,11 +72,12 @@ const UserInfoCardComponent: React.FC = ({ set_user_info, onTab, }) => { + const { handleGrandchildTrigger } = useContext(FamilyContext); const { updateUserInfo } = useUserActions(); - + // 使用 useRef 记录上一次的 user_info,只在真正变化时打印 const prevUserInfoRef = useRef>(); - + useEffect(() => { // 只在 user_info 真正变化时打印(通过 JSON 序列化比较) const prevStr = JSON.stringify(prevUserInfoRef.current); @@ -85,7 +87,7 @@ const UserInfoCardComponent: React.FC = ({ prevUserInfoRef.current = user_info; } }, [user_info]); - + // 编辑个人简介弹窗状态 const [edit_modal_visible, setEditModalVisible] = useState(false); const [editing_field, setEditingField] = useState(""); @@ -102,6 +104,14 @@ const UserInfoCardComponent: React.FC = ({ set_form_data({ ...user_info }); }); + useEffect(() => { + const visibles = [gender_picker_visible, location_picker_visible, ntrp_picker_visible, occupation_picker_visible] + const showGuideBar = visibles.every(item => !item) + if (showGuideBar) { + handleGrandchildTrigger(false) + } + }, [gender_picker_visible, location_picker_visible, ntrp_picker_visible, occupation_picker_visible]) + // 职业数据 const professions = useProfessions(); @@ -132,6 +142,7 @@ const UserInfoCardComponent: React.FC = ({ // }; // 处理编辑弹窗 const handle_open_edit_modal = (field: string) => { + handleGrandchildTrigger(true) if (field === "gender") { setGenderPickerVisible(true); return; @@ -150,9 +161,11 @@ const UserInfoCardComponent: React.FC = ({ } if (field === "nickname") { // 手动输入 + handleGrandchildTrigger(true) setEditingField(field); setEditModalVisible(true); } else { + handleGrandchildTrigger(true) setEditingField(field); setEditModalVisible(true); } @@ -256,6 +269,7 @@ const UserInfoCardComponent: React.FC = ({ handle_field_edit("occupation", `${country} ${province} ${city}`); }; const handle_edit_modal_cancel = () => { + handleGrandchildTrigger(false); setEditModalVisible(false); setEditingField(""); }; @@ -507,13 +521,13 @@ const UserInfoCardComponent: React.FC = ({ ) : null} - + handle_open_edit_modal("personal_profile")}> {user_info.personal_profile ? ( {user_info.personal_profile} ) : is_current_user ? ( handle_open_edit_modal("personal_profile")} > = ({ {hosted_text} on_tab_change("participated")} > {participated_text} diff --git a/src/context/index.ts b/src/context/index.ts new file mode 100644 index 0000000..4e8eec6 --- /dev/null +++ b/src/context/index.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +// 定义Context类型 +interface FamilyContextType { + handleGrandchildTrigger: (data: any) => void; +} + +// 创建Context对象 +const FamilyContext = React.createContext < FamilyContextType > ({ + handleGrandchildTrigger: () => { } +}); + +export default FamilyContext; diff --git a/src/main_pages/index.tsx b/src/main_pages/index.tsx index 04acd6e..2beec5a 100644 --- a/src/main_pages/index.tsx +++ b/src/main_pages/index.tsx @@ -10,6 +10,7 @@ import ListPageContent from "./components/ListPageContent"; import MessagePageContent from "./components/MessagePageContent"; import MyselfPageContent from "./components/MyselfPageContent"; import "./index.scss"; +import FamilyContext from '@/context'; type TabType = "list" | "message" | "personal"; @@ -22,6 +23,7 @@ const MainPage: React.FC = () => { const [isFilterPopupVisible, setIsFilterPopupVisible] = useState(false); const [isShowInputCustomerNavBar, setIsShowInputCustomerNavBar] = useState(false); const [listPageScrollToTopTrigger, setListPageScrollToTopTrigger] = useState(0); + const [showGuideBar, setShowGuideBar] = useState(true); const { fetchUserInfo } = useUserActions(); @@ -136,8 +138,8 @@ const MainPage: React.FC = () => { } else if (currentTab === "message") { // 消息页:使用 GeneralNavbar(与原始消息页一致,显示用户头像和标题) return ( - { } else if (currentTab === "personal") { // 我的页:使用 GeneralNavbar 显示标题 return ( - { return null; }; + const handleGrandchildTrigger = (value) => { + setShowGuideBar(!value) + } + return ( - - {/* 自定义导航栏 */} - {renderCustomNavbar()} + + + {/* 自定义导航栏 */} + {renderCustomNavbar()} + + {/* 列表页内容 */} + + + + + {/* 消息页内容 */} + + + + + {/* 我的页内容 */} + + + + + {/* 底部导航栏 */} + { + showGuideBar ? + : + null + } - {/* 列表页内容 */} - - - - {/* 消息页内容 */} - - - - - {/* 我的页内容 */} - - - - - {/* 底部导航栏 */} - - + ); }; diff --git a/src/nutui-theme.scss b/src/nutui-theme.scss index 36189c7..9ff2401 100644 --- a/src/nutui-theme.scss +++ b/src/nutui-theme.scss @@ -225,4 +225,8 @@ $nut-primary-color-end: #000000 !important; color: #ffffff !important; background: #000000 !important; border: 1px solid #000000 !important; -} \ No newline at end of file +} + +.nut-popup-bottom.nut-popup-round { + border-radius: 0 !important; +} \ No newline at end of file diff --git a/src/static/userInfo/edit.svg b/src/static/userInfo/edit.svg index b035d61..f7d574d 100644 --- a/src/static/userInfo/edit.svg +++ b/src/static/userInfo/edit.svg @@ -1,6 +1,6 @@ - - + + diff --git a/src/static/userInfo/info_edit.svg b/src/static/userInfo/info_edit.svg index 33b0741..575261f 100644 --- a/src/static/userInfo/info_edit.svg +++ b/src/static/userInfo/info_edit.svg @@ -1,4 +1,4 @@ - - + + diff --git a/src/user_pages/downloadBillRecords/index.scss b/src/user_pages/downloadBillRecords/index.scss index a1feb35..451d2be 100644 --- a/src/user_pages/downloadBillRecords/index.scss +++ b/src/user_pages/downloadBillRecords/index.scss @@ -110,7 +110,7 @@ bottom: 0; left: 0; width: 100vw; - background-color: #ffffff; + background-color: #fafafa; padding: 20px 0; } } diff --git a/src/user_pages/wallet/index.scss b/src/user_pages/wallet/index.scss index 85c100a..88b9deb 100644 --- a/src/user_pages/wallet/index.scss +++ b/src/user_pages/wallet/index.scss @@ -3,7 +3,7 @@ .wallet_page { height: 100vh; overflow-y: auto; - background-color: #f5f5f5; + background-color: #fafafa; padding-bottom: 5px; box-sizing: border-box;