添加 个人页bar
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|||||||
import { View, Text, Image, ScrollView, Button } from '@tarojs/components';
|
import { View, Text, Image, ScrollView, Button } from '@tarojs/components';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
|
import GuideBar from '@/components/GuideBar'
|
||||||
// 用户信息接口
|
// 用户信息接口
|
||||||
interface UserInfo {
|
interface UserInfo {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -47,10 +47,10 @@ const MyselfPage: React.FC = () => {
|
|||||||
// 获取页面参数
|
// 获取页面参数
|
||||||
const instance = Taro.getCurrentInstance();
|
const instance = Taro.getCurrentInstance();
|
||||||
const user_id = instance.router?.params?.userid;
|
const user_id = instance.router?.params?.userid;
|
||||||
|
|
||||||
// 判断是否为当前用户
|
// 判断是否为当前用户
|
||||||
const is_current_user = !user_id;
|
const is_current_user = !user_id;
|
||||||
|
|
||||||
// 模拟用户数据
|
// 模拟用户数据
|
||||||
const [user_info] = useState<UserInfo>({
|
const [user_info] = useState<UserInfo>({
|
||||||
id: '1',
|
id: '1',
|
||||||
@@ -193,13 +193,13 @@ const MyselfPage: React.FC = () => {
|
|||||||
<View className="action_buttons">
|
<View className="action_buttons">
|
||||||
{/* 只有非当前用户才显示关注按钮 */}
|
{/* 只有非当前用户才显示关注按钮 */}
|
||||||
{!is_current_user && (
|
{!is_current_user && (
|
||||||
<Button
|
<Button
|
||||||
className={`follow_button ${is_following ? 'following' : ''}`}
|
className={`follow_button ${is_following ? 'following' : ''}`}
|
||||||
onClick={handle_follow}
|
onClick={handle_follow}
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
className="button_icon"
|
className="button_icon"
|
||||||
src={require('../../../static/userInfo/plus.svg')}
|
src={require('../../../static/userInfo/plus.svg')}
|
||||||
/>
|
/>
|
||||||
<Text className="button_text">
|
<Text className="button_text">
|
||||||
{is_following ? '已关注' : '关注'}
|
{is_following ? '已关注' : '关注'}
|
||||||
@@ -209,9 +209,9 @@ const MyselfPage: React.FC = () => {
|
|||||||
{/* 只有非当前用户才显示消息按钮 */}
|
{/* 只有非当前用户才显示消息按钮 */}
|
||||||
{!is_current_user && (
|
{!is_current_user && (
|
||||||
<Button className="message_button">
|
<Button className="message_button">
|
||||||
<Image
|
<Image
|
||||||
className="button_icon"
|
className="button_icon"
|
||||||
src={require('../../../static/userInfo/message.svg')}
|
src={require('../../../static/userInfo/message.svg')}
|
||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
@@ -234,9 +234,9 @@ const MyselfPage: React.FC = () => {
|
|||||||
<View className="tags_bio_section">
|
<View className="tags_bio_section">
|
||||||
<View className="tags_container">
|
<View className="tags_container">
|
||||||
<View className="tag_item">
|
<View className="tag_item">
|
||||||
<Image
|
<Image
|
||||||
className="tag_icon"
|
className="tag_icon"
|
||||||
src={require('../../../static/userInfo/location.svg')}
|
src={require('../../../static/userInfo/location.svg')}
|
||||||
/>
|
/>
|
||||||
<Text className="tag_text">{user_info.location}</Text>
|
<Text className="tag_text">{user_info.location}</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -254,17 +254,17 @@ const MyselfPage: React.FC = () => {
|
|||||||
<View className="quick_actions_section">
|
<View className="quick_actions_section">
|
||||||
<View className="action_card">
|
<View className="action_card">
|
||||||
<View className="action_content" onClick={handle_game_orders}>
|
<View className="action_content" onClick={handle_game_orders}>
|
||||||
<Image
|
<Image
|
||||||
className="action_icon"
|
className="action_icon"
|
||||||
src={require('../../../static/userInfo/tennis.svg')}
|
src={require('../../../static/userInfo/tennis.svg')}
|
||||||
/>
|
/>
|
||||||
<Text className="action_text">球局订单</Text>
|
<Text className="action_text">球局订单</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className="action_divider"></View>
|
<View className="action_divider"></View>
|
||||||
<View className="action_content" onClick={handle_favorites}>
|
<View className="action_content" onClick={handle_favorites}>
|
||||||
<Image
|
<Image
|
||||||
className="action_icon"
|
className="action_icon"
|
||||||
src={require('../../../static/userInfo/tennis.svg')}
|
src={require('../../../static/userInfo/tennis.svg')}
|
||||||
/>
|
/>
|
||||||
<Text className="action_text">收藏</Text>
|
<Text className="action_text">收藏</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -291,12 +291,12 @@ const MyselfPage: React.FC = () => {
|
|||||||
<Text className="separator">/</Text>
|
<Text className="separator">/</Text>
|
||||||
<Text className="weekday_text">星期三</Text>
|
<Text className="weekday_text">星期三</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* 球局卡片 */}
|
{/* 球局卡片 */}
|
||||||
<View className="game_cards">
|
<View className="game_cards">
|
||||||
{game_records.map((game) => (
|
{game_records.map((game) => (
|
||||||
<View
|
<View
|
||||||
key={game.id}
|
key={game.id}
|
||||||
className="game_card"
|
className="game_card"
|
||||||
onClick={() => handle_game_detail(game.id)}
|
onClick={() => handle_game_detail(game.id)}
|
||||||
>
|
>
|
||||||
@@ -304,9 +304,9 @@ const MyselfPage: React.FC = () => {
|
|||||||
<View className="game_header">
|
<View className="game_header">
|
||||||
<Text className="game_title">{game.title}</Text>
|
<Text className="game_title">{game.title}</Text>
|
||||||
<View className="game_type_icon">
|
<View className="game_type_icon">
|
||||||
<Image
|
<Image
|
||||||
className="type_icon"
|
className="type_icon"
|
||||||
src={require('../../../static/userInfo/tennis.svg')}
|
src={require('../../../static/userInfo/tennis.svg')}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
@@ -330,10 +330,10 @@ const MyselfPage: React.FC = () => {
|
|||||||
{/* 球局图片 */}
|
{/* 球局图片 */}
|
||||||
<View className="game_images">
|
<View className="game_images">
|
||||||
{game.images.map((image, index) => (
|
{game.images.map((image, index) => (
|
||||||
<Image
|
<Image
|
||||||
key={index}
|
key={index}
|
||||||
className="game_image"
|
className="game_image"
|
||||||
src={image}
|
src={image}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
@@ -343,10 +343,10 @@ const MyselfPage: React.FC = () => {
|
|||||||
<View className="participants_info">
|
<View className="participants_info">
|
||||||
<View className="avatars">
|
<View className="avatars">
|
||||||
{game.participants.map((participant, index) => (
|
{game.participants.map((participant, index) => (
|
||||||
<Image
|
<Image
|
||||||
key={index}
|
key={index}
|
||||||
className="participant_avatar"
|
className="participant_avatar"
|
||||||
src={participant.avatar}
|
src={participant.avatar}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
@@ -370,6 +370,7 @@ const MyselfPage: React.FC = () => {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
<GuideBar currentPage='personal' />
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user