个人页优化

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