加入社群页面
This commit is contained in:
@@ -12,13 +12,9 @@ export default defineAppConfig({
|
|||||||
"game_pages/sharePoster/index",
|
"game_pages/sharePoster/index",
|
||||||
],
|
],
|
||||||
subPackages: [
|
subPackages: [
|
||||||
|
|
||||||
{
|
{
|
||||||
root: 'publish_pages',
|
root: "publish_pages",
|
||||||
pages: [
|
pages: ["publishBall/index", "footballRules/index"],
|
||||||
"publishBall/index",
|
|
||||||
"footballRules/index"
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "user_pages",
|
root: "user_pages",
|
||||||
@@ -35,6 +31,7 @@ export default defineAppConfig({
|
|||||||
"setTransactionPassword/index", // 设置交易密码
|
"setTransactionPassword/index", // 设置交易密码
|
||||||
"validPhone/index", // 验证手机号
|
"validPhone/index", // 验证手机号
|
||||||
"withdrawal/index", // 提现
|
"withdrawal/index", // 提现
|
||||||
|
"joinGroup/index", // 加入社群
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
@@ -45,15 +42,14 @@ export default defineAppConfig({
|
|||||||
// ],
|
// ],
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
root: 'order_pages',
|
root: "order_pages",
|
||||||
pages: [
|
pages: [
|
||||||
"orderList/index", // 订单列表页
|
"orderList/index", // 订单列表页
|
||||||
"orderDetail/index", // 订单详情页
|
"orderDetail/index", // 订单详情页
|
||||||
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: 'other_pages',
|
root: "other_pages",
|
||||||
pages: [
|
pages: [
|
||||||
"comment_reply/index", // 收到的评论和回复
|
"comment_reply/index", // 收到的评论和回复
|
||||||
"new_follow/index", // 新增关注
|
"new_follow/index", // 新增关注
|
||||||
@@ -63,13 +59,13 @@ export default defineAppConfig({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
"preloadRule": {
|
preloadRule: {
|
||||||
// 移除首屏预加载,所有子包改为按需加载,提升启动速度
|
// 移除首屏预加载,所有子包改为按需加载,提升启动速度
|
||||||
// 如果需要,可以在 main_pages/index 加载后再预加载常用包
|
// 如果需要,可以在 main_pages/index 加载后再预加载常用包
|
||||||
"main_pages/index": {
|
"main_pages/index": {
|
||||||
"packages": ["publish_pages"], // 只预加载最常用的发布页面
|
packages: ["publish_pages"], // 只预加载最常用的发布页面
|
||||||
"network": "all"
|
network: "all",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
window: {
|
window: {
|
||||||
@@ -90,5 +86,5 @@ export default defineAppConfig({
|
|||||||
provider: "wx76a9a06e5b4e693e",
|
provider: "wx76a9a06e5b4e693e",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"lazyCodeLoading": "requiredComponents"
|
lazyCodeLoading: "requiredComponents",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -415,8 +415,10 @@ const EditProfilePage: React.FC = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAddGroup = () => {
|
const handleJoinGroup = () => {
|
||||||
console.log("加入社群~");
|
Taro.navigateTo({
|
||||||
|
url: "/user_pages/joinGroup/index",
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDefaultOption = (options) => {
|
const getDefaultOption = (options) => {
|
||||||
@@ -715,7 +717,7 @@ const EditProfilePage: React.FC = () => {
|
|||||||
></Image>
|
></Image>
|
||||||
<Text className="logout_text">客服聊天</Text>
|
<Text className="logout_text">客服聊天</Text>
|
||||||
</View>
|
</View>
|
||||||
<View className="logout_button" onClick={handleAddGroup}>
|
<View className="logout_button" onClick={handleJoinGroup}>
|
||||||
<Image src={require("@/static/userInfo/chat.svg")}></Image>
|
<Image src={require("@/static/userInfo/chat.svg")}></Image>
|
||||||
<Text className="logout_text">加入社群</Text>
|
<Text className="logout_text">加入社群</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
4
src/user_pages/joinGroup/index.config.ts
Normal file
4
src/user_pages/joinGroup/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: "",
|
||||||
|
navigationStyle: "custom",
|
||||||
|
});
|
||||||
22
src/user_pages/joinGroup/index.scss
Normal file
22
src/user_pages/joinGroup/index.scss
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
// 他人用户页面样式
|
||||||
|
.page_container {
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
overflow-y: auto;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: radial-gradient(
|
||||||
|
circle at 50% 0,
|
||||||
|
/* 光晕圆心在顶部中间 */ rgba(191, 255, 239, 0.9) 0px,
|
||||||
|
/* 中间更深的浅蓝 */ rgba(191, 255, 239, 0.5) 200px,
|
||||||
|
/* 100px 处开始淡化 */ #fafafa 300px,
|
||||||
|
/* 到 200px 变成白色 */ #fafafa 100% /* 200px 以下全白 */
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主要内容区域
|
||||||
|
.main_content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
119
src/user_pages/joinGroup/index.tsx
Normal file
119
src/user_pages/joinGroup/index.tsx
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { View, Text, Image } from "@tarojs/components";
|
||||||
|
import Taro from "@tarojs/taro";
|
||||||
|
import "./index.scss";
|
||||||
|
import { UserService, UserInfoType } from "@/services/userService";
|
||||||
|
import * as LoginService from "@/services/loginService";
|
||||||
|
import { useGlobalState } from "@/store/global";
|
||||||
|
import { GeneralNavbar } from "@/components";
|
||||||
|
|
||||||
|
const OtherUserPage: React.FC = () => {
|
||||||
|
// 获取页面参数
|
||||||
|
const instance = Taro.getCurrentInstance();
|
||||||
|
const user_id = instance.router?.params?.userid;
|
||||||
|
|
||||||
|
// 获取导航栏高度信息
|
||||||
|
const { statusNavbarHeightInfo } = useGlobalState() || {};
|
||||||
|
const { totalHeight = 98 } = statusNavbarHeightInfo || {};
|
||||||
|
|
||||||
|
// 模拟用户数据
|
||||||
|
const [user_info, setUserInfo] = useState<Partial<UserInfoType>>({
|
||||||
|
id: parseInt(user_id || "1") || 1,
|
||||||
|
gender: "",
|
||||||
|
nickname: "网球爱好者",
|
||||||
|
avatar_url: require("@/static/userInfo/default_avatar.svg"),
|
||||||
|
join_date: "2024年3月加入",
|
||||||
|
stats: {
|
||||||
|
following_count: 0,
|
||||||
|
followers_count: 0,
|
||||||
|
hosted_games_count: 0,
|
||||||
|
participated_games_count: 0,
|
||||||
|
},
|
||||||
|
tags: ["北京朝阳", "金融从业者", "NTRP 3.5"],
|
||||||
|
bio: "热爱网球的金融从业者,周末喜欢约球\n技术还在提升中,欢迎一起切磋\n平时在朝阳公园附近活动",
|
||||||
|
city: "北京",
|
||||||
|
district: "朝阳",
|
||||||
|
occupation: "金融从业者",
|
||||||
|
ntrp_level: "NTRP 3.5",
|
||||||
|
is_following: false,
|
||||||
|
ongoing_games: [],
|
||||||
|
personal_profile: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
// 页面加载时获取用户信息
|
||||||
|
useEffect(() => {
|
||||||
|
const load_user_data = async () => {
|
||||||
|
if (user_id) {
|
||||||
|
try {
|
||||||
|
// const user_data = await UserService.get_user_info(user_id);
|
||||||
|
const res = await LoginService.getUserInfoById(user_id);
|
||||||
|
const { data: userData } = res;
|
||||||
|
// setUserInfo({...res.data as UserInfo, avatar: data.avatar_url || require("@/static/userInfo/default_avatar.svg")});
|
||||||
|
setUserInfo({
|
||||||
|
id: parseInt(user_id || "") || 0,
|
||||||
|
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
|
||||||
|
}月加入`
|
||||||
|
: "",
|
||||||
|
stats: {
|
||||||
|
following_count: userData.stats?.following_count || 0,
|
||||||
|
followers_count: userData.stats?.followers_count || 0,
|
||||||
|
hosted_games_count: userData.stats?.hosted_games_count || 0,
|
||||||
|
participated_games_count:
|
||||||
|
userData.stats?.participated_games_count || 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
personal_profile: userData.personal_profile || "",
|
||||||
|
province: userData.province || "",
|
||||||
|
city: userData.city || "",
|
||||||
|
district: userData.district || "",
|
||||||
|
occupation: userData.occupation || "",
|
||||||
|
ntrp_level: "",
|
||||||
|
phone: userData.phone || "",
|
||||||
|
gender: userData.gender || "",
|
||||||
|
birthday: userData.birthday || "",
|
||||||
|
});
|
||||||
|
setIsFollowing(userData.is_following || false);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("加载用户数据失败:", error);
|
||||||
|
Taro.showToast({
|
||||||
|
title: "加载失败",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
load_user_data();
|
||||||
|
}, [user_id]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className="page_container">
|
||||||
|
{/* 顶部导航栏 */}
|
||||||
|
<GeneralNavbar
|
||||||
|
title=""
|
||||||
|
showBack={true}
|
||||||
|
showAvatar={false}
|
||||||
|
onBack={() => {
|
||||||
|
Taro.navigateBack();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{/* 主要内容 */}
|
||||||
|
<View className="main_content" style={{ paddingTop: `${totalHeight}px` }}>
|
||||||
|
<Text>你应该会想加入这里</Text>
|
||||||
|
<Text>你想认识的人,也在找你。</Text>
|
||||||
|
<Image src=""></Image>
|
||||||
|
<Text>长按入群吧👆让运动不再一个人</Text>
|
||||||
|
<Text>你不是一个人在寻找球友。</Text>
|
||||||
|
<Text>你想认识的人,也在找你。</Text>
|
||||||
|
<Text>每一个热爱运动的人,</Text>
|
||||||
|
<Text>都在这里相遇。</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default OtherUserPage;
|
||||||
Reference in New Issue
Block a user