个人页优化

This commit is contained in:
2025-11-08 20:38:16 +08:00
parent 5a15a5886d
commit 023f120388
2 changed files with 27 additions and 16 deletions

View File

@@ -170,6 +170,7 @@ const MyselfPage: React.FC = () => {
const handle_wallet = () => { const handle_wallet = () => {
Taro.navigateTo({ Taro.navigateTo({
url: "/user_pages/wallet/index", url: "/user_pages/wallet/index",
// url: "/user_pages/other/index?userid=16"
}); });
}; };

View File

@@ -16,12 +16,13 @@ import { UserService, UserInfoType } from "@/services/userService";
import * as LoginService from "@/services/loginService"; import * as LoginService from "@/services/loginService";
import CustomNavbar from "@/components/CustomNavbar"; import CustomNavbar from "@/components/CustomNavbar";
import { useGlobalState } from "@/store/global"; import { useGlobalState } from "@/store/global";
import { BackNavbar } from "@/components";
const OtherUserPage: React.FC = () => { const OtherUserPage: React.FC = () => {
// 获取页面参数 // 获取页面参数
const instance = Taro.getCurrentInstance(); const instance = Taro.getCurrentInstance();
const user_id = instance.router?.params?.userid; const user_id = instance.router?.params?.userid;
if(!user_id) { if (!user_id) {
Taro.showToast({ Taro.showToast({
title: "用户不存在", title: "用户不存在",
icon: "none", icon: "none",
@@ -87,9 +88,8 @@ const OtherUserPage: React.FC = () => {
nickname: userData.nickname || "", nickname: userData.nickname || "",
avatar_url: userData.avatar_url || "", avatar_url: userData.avatar_url || "",
join_date: userData.subscribe_time join_date: userData.subscribe_time
? `${new Date(userData.subscribe_time).getFullYear()}${ ? `${new Date(userData.subscribe_time).getFullYear()}${new Date(userData.subscribe_time).getMonth() + 1
new Date(userData.subscribe_time).getMonth() + 1 }月加入`
}月加入`
: "", : "",
stats: { stats: {
following_count: userData.stats?.following_count || 0, following_count: userData.stats?.following_count || 0,
@@ -200,9 +200,8 @@ const OtherUserPage: React.FC = () => {
// 处理发送消息 // 处理发送消息
const handle_send_message = () => { const handle_send_message = () => {
Taro.navigateTo({ Taro.navigateTo({
url: `/mode_user/message/chat/index?user_id=${ url: `/mode_user/message/chat/index?user_id=${user_info.id || ""
user_info.id || "" }&nickname=${user_info.nickname || ""}`,
}&nickname=${user_info.nickname || ""}`,
}); });
}; };
@@ -219,19 +218,28 @@ const OtherUserPage: React.FC = () => {
return ( return (
<View className="other_user_page"> <View className="other_user_page">
<CustomNavbar> {/* <CustomNavbar>
<View className="navbar_content"> <View className="navbar_content">
<View className="navbar_back" onClick={() => Taro.navigateBack()}> <View className="navbar_back" onClick={() => Taro.navigateBack()}>
<View className="back_icon" /> <View className="back_icon" />
</View> </View>
<Text className="navbar_title"></Text> <Text className="navbar_title"></Text>
<View className="navbar_action"> <View className="navbar_action">
{/* 右侧占位,保持标题居中 */}
</View> </View>
</View> </View>
</CustomNavbar> </CustomNavbar> */}
{/* 顶部导航栏 */}
<BackNavbar
title=""
showBackButton={true}
showAvatar={false}
backgroundColor="unset"
onBack={() => {
Taro.navigateBack();
}}
/>
{/* 主要内容 */} {/* 主要内容 */}
<View className="main_content" style={{ paddingTop: `${totalHeight}px` }}> <View className="main_content">
{/* 用户信息区域 */} {/* 用户信息区域 */}
<View className="user_info_section"> <View className="user_info_section">
<UserInfoCard <UserInfoCard
@@ -267,9 +275,10 @@ const OtherUserPage: React.FC = () => {
recommendList={[]} recommendList={[]}
loading={loading} loading={loading}
error={null} error={null}
isShowNoData={game_records.length === 0}
errorImg="ICON_LIST_EMPTY" errorImg="ICON_LIST_EMPTY"
emptyText="暂无消息,去互动看看吧" emptyText="暂无球局信息"
loadMoreMatches={() => {}} loadMoreMatches={() => { }}
collapse={true} collapse={true}
style={{ paddingBottom: 0, overflow: "hidden" }} style={{ paddingBottom: 0, overflow: "hidden" }}
defaultShowNum={3} defaultShowNum={3}
@@ -306,9 +315,10 @@ const OtherUserPage: React.FC = () => {
recommendList={[]} recommendList={[]}
loading={loading} loading={loading}
error={null} error={null}
isShowNoData={ended_game_records.length === 0}
errorImg="ICON_LIST_EMPTY" errorImg="ICON_LIST_EMPTY"
emptyText="暂无消息,去互动看看吧" emptyText="暂无球局信息"
loadMoreMatches={() => {}} loadMoreMatches={() => { }}
collapse={true} collapse={true}
style={{ paddingBottom: "90px", overflow: "hidden" }} style={{ paddingBottom: "90px", overflow: "hidden" }}
defaultShowNum={3} defaultShowNum={3}