跳转他人页
This commit is contained in:
@@ -21,7 +21,8 @@ export default defineAppConfig({
|
|||||||
root: "user_pages",
|
root: "user_pages",
|
||||||
pages: [
|
pages: [
|
||||||
"myself/index", // 个人中心
|
"myself/index", // 个人中心
|
||||||
"edit/index", // 个人中心
|
"edit/index", // 编辑个人中心
|
||||||
|
"other/index", // 他人个人主页
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -24,10 +24,13 @@ export interface UserInfo {
|
|||||||
ntrp_level: string;
|
ntrp_level: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
gender?: string;
|
gender?: string;
|
||||||
bio?: string,
|
bio?: string;
|
||||||
latitude?: string,
|
latitude?: string;
|
||||||
longitude?: string,
|
longitude?: string;
|
||||||
birthday?: string,
|
birthday?: string;
|
||||||
|
is_following?: boolean;
|
||||||
|
tags?: string[];
|
||||||
|
ongoing_games?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -59,7 +62,7 @@ export const UserInfoCard: React.FC<UserInfoCardProps> = ({
|
|||||||
on_share,
|
on_share,
|
||||||
set_user_info,
|
set_user_info,
|
||||||
}) => {
|
}) => {
|
||||||
console.log("用户信息xx:", user_info);
|
console.log("用户信息:", user_info);
|
||||||
// 编辑个人简介弹窗状态
|
// 编辑个人简介弹窗状态
|
||||||
const [edit_modal_visible, setEditModalVisible] = useState(false);
|
const [edit_modal_visible, setEditModalVisible] = useState(false);
|
||||||
const [editing_field, setEditingField] = useState<string>('');
|
const [editing_field, setEditingField] = useState<string>('');
|
||||||
|
|||||||
@@ -855,6 +855,12 @@ function OrganizerInfo(props) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const viewOtherPage = () => {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: `/user_pages/other/index?userid=${id}`,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className="detail-page-content-organizer-recommend-games">
|
<View className="detail-page-content-organizer-recommend-games">
|
||||||
{/* orgnizer title */}
|
{/* orgnizer title */}
|
||||||
@@ -863,7 +869,7 @@ function OrganizerInfo(props) {
|
|||||||
</View>
|
</View>
|
||||||
{/* organizer avatar and name */}
|
{/* organizer avatar and name */}
|
||||||
<View className="organizer-avatar-name">
|
<View className="organizer-avatar-name">
|
||||||
<Avatar className="organizer-avatar-name-avatar" src={avatar_url} />
|
<Avatar className="organizer-avatar-name-avatar" src={avatar_url} onClick={viewOtherPage} />
|
||||||
<View className="organizer-avatar-name-message">
|
<View className="organizer-avatar-name-message">
|
||||||
<Text className="organizer-avatar-name-message-name">{nickname}</Text>
|
<Text className="organizer-avatar-name-message-name">{nickname}</Text>
|
||||||
<View className="organizer-avatar-name-message-stats">
|
<View className="organizer-avatar-name-message-stats">
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: '用户主页',
|
navigationBarTitleText: '用户主页',
|
||||||
navigationStyle: 'custom'
|
|
||||||
})
|
})
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
margin-top: 98px;
|
||||||
|
|
||||||
// 基本信息
|
// 基本信息
|
||||||
.basic_info {
|
.basic_info {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
GameRecord,
|
GameRecord,
|
||||||
} from "@/components/UserInfo";
|
} from "@/components/UserInfo";
|
||||||
import { UserService } from "@/services/userService";
|
import { UserService } from "@/services/userService";
|
||||||
|
import * as LoginService from "@/services/loginService";
|
||||||
|
|
||||||
const OtherUserPage: React.FC = () => {
|
const OtherUserPage: React.FC = () => {
|
||||||
// 获取页面参数
|
// 获取页面参数
|
||||||
@@ -34,6 +35,9 @@ const OtherUserPage: React.FC = () => {
|
|||||||
location: "北京朝阳",
|
location: "北京朝阳",
|
||||||
occupation: "金融从业者",
|
occupation: "金融从业者",
|
||||||
ntrp_level: "NTRP 3.5",
|
ntrp_level: "NTRP 3.5",
|
||||||
|
is_following: false,
|
||||||
|
ongoing_games: [],
|
||||||
|
personal_profile: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
// 模拟球局数据
|
// 模拟球局数据
|
||||||
@@ -52,8 +56,9 @@ const OtherUserPage: React.FC = () => {
|
|||||||
const load_user_data = async () => {
|
const load_user_data = async () => {
|
||||||
if (user_id) {
|
if (user_id) {
|
||||||
try {
|
try {
|
||||||
const user_data = await UserService.get_user_info(user_id);
|
// const user_data = await UserService.get_user_info(user_id);
|
||||||
setUserInfo(user_data);
|
const res = await LoginService.getUserInfoById(user_id);
|
||||||
|
setUserInfo(res.data as UserInfo);
|
||||||
|
|
||||||
const games_data = await UserService.get_user_games(
|
const games_data = await UserService.get_user_games(
|
||||||
user_id,
|
user_id,
|
||||||
@@ -151,7 +156,7 @@ const OtherUserPage: React.FC = () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<GuideBar currentPage="personal" />
|
{/* <GuideBar currentPage="personal" /> */}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user