feat: NTRP测试入口接入

This commit is contained in:
2025-10-01 09:34:20 +08:00
parent 61b70773e3
commit 273da07959
14 changed files with 629 additions and 304 deletions

View File

@@ -7,7 +7,8 @@ import { UserInfoCard, UserInfo } from "@/components/UserInfo/index";
import { UserService } from "@/services/userService";
import ListContainer from "@/container/listContainer";
import { TennisMatch } from "@/../types/list/types";
import { withAuth } from "@/components";
import { withAuth, NTRPTestEntryCard } from "@/components";
import { EvaluateScene } from "@/store/evaluateStore";
const MyselfPage: React.FC = () => {
// 获取页面参数
@@ -34,9 +35,9 @@ const MyselfPage: React.FC = () => {
occupation: "加载中...",
ntrp_level: "NTRP 3.0",
personal_profile: "加载中...",
gender: '',
country: '',
province: '',
gender: "",
country: "",
province: "",
});
// 球局记录状态
@@ -50,7 +51,7 @@ const MyselfPage: React.FC = () => {
// 当前激活的标签页
const [active_tab, setActiveTab] = useState<"hosted" | "participated">(
"hosted",
"hosted"
);
// 加载用户数据
@@ -131,7 +132,10 @@ const MyselfPage: React.FC = () => {
games_data = await UserService.get_participated_games(user_info.id);
}
const sorted_games = games_data.sort((a, b) => {
return new Date(a.original_start_time.replace(/\s/, 'T')).getTime() - new Date(b.original_start_time.replace(/\s/, 'T')).getTime();
return (
new Date(a.original_start_time.replace(/\s/, "T")).getTime() -
new Date(b.original_start_time.replace(/\s/, "T")).getTime()
);
});
const { notEndGames, finishedGames } = classifyGameRecords(sorted_games);
set_game_records(notEndGames);
@@ -147,7 +151,7 @@ const MyselfPage: React.FC = () => {
try {
const new_following_state = await UserService.toggle_follow(
user_id,
is_following,
is_following
);
setIsFollowing(new_following_state);
@@ -221,6 +225,8 @@ const MyselfPage: React.FC = () => {
</View>
</View>
<NTRPTestEntryCard type={EvaluateScene.user} />
{/* 球局类型标签页 */}
<View className="game_tabs_section">
<View className="tab_container">
@@ -231,7 +237,9 @@ const MyselfPage: React.FC = () => {
<Text className="tab_text"></Text>
</View>
<View
className={`tab_item ${active_tab === "participated" ? "active" : ""}`}
className={`tab_item ${
active_tab === "participated" ? "active" : ""
}`}
onClick={() => setActiveTab("participated")}
>
<Text className="tab_text"></Text>
@@ -248,7 +256,7 @@ const MyselfPage: React.FC = () => {
loading={loading}
error={null}
reload={load_game_data}
loadMoreMatches={() => { }}
loadMoreMatches={() => {}}
/>
</ScrollView>
</View>
@@ -271,7 +279,7 @@ const MyselfPage: React.FC = () => {
loading={loading}
error={null}
reload={load_game_data}
loadMoreMatches={() => { }}
loadMoreMatches={() => {}}
/>
</ScrollView>
{/* </View> */}