From 6a365be470931c3abad50830951cc606dabe8bd0 Mon Sep 17 00:00:00 2001 From: Ultrame <1019265060@qq.com> Date: Sun, 16 Nov 2025 13:02:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?UI=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CommonPopup/index.module.scss | 2 +- src/components/UserInfo/index.scss | 2 +- src/components/UserInfo/index.tsx | 17 ++++++++--------- src/nutui-theme.scss | 6 +++++- src/static/userInfo/info_edit.svg | 4 ++-- src/user_pages/downloadBillRecords/index.scss | 2 +- src/user_pages/wallet/index.scss | 2 +- 7 files changed, 19 insertions(+), 16 deletions(-) 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/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..ff8b0af 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -72,10 +72,10 @@ const UserInfoCardComponent: React.FC = ({ onTab, }) => { const { updateUserInfo } = useUserActions(); - + // 使用 useRef 记录上一次的 user_info,只在真正变化时打印 const prevUserInfoRef = useRef>(); - + useEffect(() => { // 只在 user_info 真正变化时打印(通过 JSON 序列化比较) const prevStr = JSON.stringify(prevUserInfoRef.current); @@ -85,7 +85,7 @@ const UserInfoCardComponent: React.FC = ({ prevUserInfoRef.current = user_info; } }, [user_info]); - + // 编辑个人简介弹窗状态 const [edit_modal_visible, setEditModalVisible] = useState(false); const [editing_field, setEditingField] = useState(""); @@ -507,13 +507,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/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/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; From 9c10f681a6086d30f5b1b3d2c4758e08122a7a8b Mon Sep 17 00:00:00 2001 From: Ultrame <1019265060@qq.com> Date: Sun, 16 Nov 2025 19:40:50 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E8=A2=ABGuideBar=E9=81=AE=E6=8C=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UserInfo/index.tsx | 16 +++++- src/context/index.ts | 13 +++++ src/main_pages/index.tsx | 95 ++++++++++++++++++------------- 3 files changed, 82 insertions(+), 42 deletions(-) create mode 100644 src/context/index.ts diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index ff8b0af..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,6 +72,7 @@ const UserInfoCardComponent: React.FC = ({ set_user_info, onTab, }) => { + const { handleGrandchildTrigger } = useContext(FamilyContext); const { updateUserInfo } = useUserActions(); // 使用 useRef 记录上一次的 user_info,只在真正变化时打印 @@ -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(""); }; 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 9337f12..02f4ed6 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(); @@ -135,8 +137,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 + } - {/* 列表页内容 */} - - - - {/* 消息页内容 */} - - - - - {/* 我的页内容 */} - - - - - {/* 底部导航栏 */} - - + ); }; From 758fa54140555b30d1812b0a13dc6dd59c4c1969 Mon Sep 17 00:00:00 2001 From: Ultrame <1019265060@qq.com> Date: Sun, 16 Nov 2025 19:44:43 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/static/userInfo/edit.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 @@ - - + + From f6e57faa5d0a9c3b96eff59849b7640d284b51c4 Mon Sep 17 00:00:00 2001 From: Ultrame <1019265060@qq.com> Date: Sun, 16 Nov 2025 19:49:01 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EditModal/EditModal.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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';