Merge branch 'master' into dev

This commit is contained in:
张成
2025-11-16 20:07:07 +08:00
11 changed files with 104 additions and 61 deletions

View File

@@ -49,7 +49,7 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 16px 20px; 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 { .common-popup__title {
font-family: "PingFang SC"; font-family: "PingFang SC";

View File

@@ -35,7 +35,7 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 16px 20px; 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 { .modal_title {
font-family: 'PingFang SC'; font-family: 'PingFang SC';

View File

@@ -122,7 +122,7 @@
align-items: center; align-items: center;
gap: 12px; gap: 12px;
border: 1px solid rgba(0, 0, 0, 0.2); border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 20px; border-radius: 999px;
.follow_button { .follow_button {
display: flex; display: flex;

View File

@@ -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 Taro, { useDidShow } from "@tarojs/taro";
import { View, Text, Image, Button } from "@tarojs/components"; import { View, Text, Image, Button } from "@tarojs/components";
import "./index.scss"; import "./index.scss";
@@ -10,6 +10,7 @@ import { useUserActions } from "@/store/userStore";
import { UserInfoType } from "@/services/userService"; import { UserInfoType } from "@/services/userService";
import { useCities, useProfessions } from "@/store/pickerOptionsStore"; import { useCities, useProfessions } from "@/store/pickerOptionsStore";
import { formatNtrpDisplay } from "@/utils/helper"; import { formatNtrpDisplay } from "@/utils/helper";
import FamilyContext from '@/context';
// 用户信息接口 // 用户信息接口
// export interface UserInfo { // export interface UserInfo {
@@ -71,6 +72,7 @@ const UserInfoCardComponent: React.FC<UserInfoCardProps> = ({
set_user_info, set_user_info,
onTab, onTab,
}) => { }) => {
const { handleGrandchildTrigger } = useContext(FamilyContext);
const { updateUserInfo } = useUserActions(); const { updateUserInfo } = useUserActions();
// 使用 useRef 记录上一次的 user_info只在真正变化时打印 // 使用 useRef 记录上一次的 user_info只在真正变化时打印
@@ -102,6 +104,14 @@ const UserInfoCardComponent: React.FC<UserInfoCardProps> = ({
set_form_data({ ...user_info }); 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(); const professions = useProfessions();
@@ -132,6 +142,7 @@ const UserInfoCardComponent: React.FC<UserInfoCardProps> = ({
// }; // };
// 处理编辑弹窗 // 处理编辑弹窗
const handle_open_edit_modal = (field: string) => { const handle_open_edit_modal = (field: string) => {
handleGrandchildTrigger(true)
if (field === "gender") { if (field === "gender") {
setGenderPickerVisible(true); setGenderPickerVisible(true);
return; return;
@@ -150,9 +161,11 @@ const UserInfoCardComponent: React.FC<UserInfoCardProps> = ({
} }
if (field === "nickname") { if (field === "nickname") {
// 手动输入 // 手动输入
handleGrandchildTrigger(true)
setEditingField(field); setEditingField(field);
setEditModalVisible(true); setEditModalVisible(true);
} else { } else {
handleGrandchildTrigger(true)
setEditingField(field); setEditingField(field);
setEditModalVisible(true); setEditModalVisible(true);
} }
@@ -256,6 +269,7 @@ const UserInfoCardComponent: React.FC<UserInfoCardProps> = ({
handle_field_edit("occupation", `${country} ${province} ${city}`); handle_field_edit("occupation", `${country} ${province} ${city}`);
}; };
const handle_edit_modal_cancel = () => { const handle_edit_modal_cancel = () => {
handleGrandchildTrigger(false);
setEditModalVisible(false); setEditModalVisible(false);
setEditingField(""); setEditingField("");
}; };
@@ -507,13 +521,13 @@ const UserInfoCardComponent: React.FC<UserInfoCardProps> = ({
</View> </View>
) : null} ) : null}
</View> </View>
<View className="personal_profile"> <View className="personal_profile"
onClick={() => handle_open_edit_modal("personal_profile")}>
{user_info.personal_profile ? ( {user_info.personal_profile ? (
<Text className="bio_text">{user_info.personal_profile}</Text> <Text className="bio_text">{user_info.personal_profile}</Text>
) : is_current_user ? ( ) : is_current_user ? (
<View <View
className="personal_profile_edit" className="personal_profile_edit"
onClick={() => handle_open_edit_modal("personal_profile")}
> >
<Image <Image
className="edit_icon" className="edit_icon"
@@ -767,8 +781,7 @@ export const GameTabs: React.FC<GameTabsProps> = ({
<Text className="tab_text">{hosted_text}</Text> <Text className="tab_text">{hosted_text}</Text>
</View> </View>
<View <View
className={`tab_item ${ className={`tab_item ${active_tab === "participated" ? "active" : ""
active_tab === "participated" ? "active" : ""
}`} }`}
onClick={() => on_tab_change("participated")} onClick={() => on_tab_change("participated")}
> >

13
src/context/index.ts Normal file
View File

@@ -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;

View File

@@ -10,6 +10,7 @@ import ListPageContent from "./components/ListPageContent";
import MessagePageContent from "./components/MessagePageContent"; import MessagePageContent from "./components/MessagePageContent";
import MyselfPageContent from "./components/MyselfPageContent"; import MyselfPageContent from "./components/MyselfPageContent";
import "./index.scss"; import "./index.scss";
import FamilyContext from '@/context';
type TabType = "list" | "message" | "personal"; type TabType = "list" | "message" | "personal";
@@ -22,6 +23,7 @@ const MainPage: React.FC = () => {
const [isFilterPopupVisible, setIsFilterPopupVisible] = useState(false); const [isFilterPopupVisible, setIsFilterPopupVisible] = useState(false);
const [isShowInputCustomerNavBar, setIsShowInputCustomerNavBar] = useState(false); const [isShowInputCustomerNavBar, setIsShowInputCustomerNavBar] = useState(false);
const [listPageScrollToTopTrigger, setListPageScrollToTopTrigger] = useState(0); const [listPageScrollToTopTrigger, setListPageScrollToTopTrigger] = useState(0);
const [showGuideBar, setShowGuideBar] = useState(true);
const { fetchUserInfo } = useUserActions(); const { fetchUserInfo } = useUserActions();
@@ -156,7 +158,12 @@ const MainPage: React.FC = () => {
return null; return null;
}; };
const handleGrandchildTrigger = (value) => {
setShowGuideBar(!value)
}
return ( return (
<FamilyContext.Provider value={{ handleGrandchildTrigger }}>
<View className="main-page"> <View className="main-page">
{/* 自定义导航栏 */} {/* 自定义导航栏 */}
{renderCustomNavbar()} {renderCustomNavbar()}
@@ -190,13 +197,19 @@ const MainPage: React.FC = () => {
</View> </View>
{/* 底部导航栏 */} {/* 底部导航栏 */}
{
showGuideBar ?
<GuideBar <GuideBar
currentPage={currentTab} currentPage={currentTab}
guideBarClassName={guideBarZIndex === 'low' ? 'guide-bar-low-z-index' : 'guide-bar-high-z-index'} guideBarClassName={guideBarZIndex === 'low' ? 'guide-bar-low-z-index' : 'guide-bar-high-z-index'}
onTabChange={handleTabChange} onTabChange={handleTabChange}
onPublishMenuVisibleChange={handlePublishMenuVisibleChange} onPublishMenuVisibleChange={handlePublishMenuVisibleChange}
/> /> :
null
}
</View> </View>
</FamilyContext.Provider>
); );
}; };

View File

@@ -226,3 +226,7 @@ $nut-primary-color-end: #000000 !important;
background: #000000 !important; background: #000000 !important;
border: 1px solid #000000 !important; border: 1px solid #000000 !important;
} }
.nut-popup-bottom.nut-popup-round {
border-radius: 0 !important;
}

View File

@@ -1,6 +1,6 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="40" height="40" rx="20" fill="white"/> <rect width="40" height="40" rx="20" fill="white"/>
<rect x="0.25" y="0.25" width="39.5" height="39.5" rx="19.75" stroke="black" stroke-opacity="0.1" stroke-width="0.5"/> <rect x="0.25" y="0.25" width="39.5" height="39.5" rx="19.75" stroke="black" stroke-opacity="0.1" stroke-width="0.5"/>
<path d="M12.9167 27.5H27.9167" stroke="black" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/> <path d="M12.9167 27.5H27.9167" stroke="rgba(0, 0, 0, 0.65)" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M14.5833 21.1333V24.1667H17.6321L26.2499 15.545L23.2062 12.5L14.5833 21.1333Z" stroke="black" stroke-width="1.66667" stroke-linejoin="round"/> <path d="M14.5833 21.1333V24.1667H17.6321L26.2499 15.545L23.2062 12.5L14.5833 21.1333Z" stroke="rgba(0, 0, 0, 0.65)" stroke-width="1.66667" stroke-linejoin="round"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 573 B

View File

@@ -1,4 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.33337 14H14.3334" stroke="black" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/> <path d="M2.33337 14H14.3334" stroke="rgba(0, 0, 0, 0.65)" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M3.66663 8.90663V11.3333H6.10569L13 4.43603L10.565 2L3.66663 8.90663Z" stroke="black" stroke-width="1.33333" stroke-linejoin="round"/> <path d="M3.66663 8.90663V11.3333H6.10569L13 4.43603L10.565 2L3.66663 8.90663Z" stroke="rgba(0, 0, 0, 0.65)" stroke-width="1.33333" stroke-linejoin="round"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 392 B

View File

@@ -110,7 +110,7 @@
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100vw; width: 100vw;
background-color: #ffffff; background-color: #fafafa;
padding: 20px 0; padding: 20px 0;
} }
} }

View File

@@ -3,7 +3,7 @@
.wallet_page { .wallet_page {
height: 100vh; height: 100vh;
overflow-y: auto; overflow-y: auto;
background-color: #f5f5f5; background-color: #fafafa;
padding-bottom: 5px; padding-bottom: 5px;
box-sizing: border-box; box-sizing: border-box;