修改详情页 ntrp 的展示
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { View, Text, Image, ScrollView } from "@tarojs/components";
|
import { View, Text, Image, ScrollView } from "@tarojs/components";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import img from "@/config/images";
|
import img from "@/config/images";
|
||||||
|
import { formatNtrpDisplay } from "@/utils/helper";
|
||||||
import styles from "./index.module.scss";
|
import styles from "./index.module.scss";
|
||||||
|
|
||||||
// 参与者
|
// 参与者
|
||||||
@@ -65,10 +66,15 @@ export default function Participants(props) {
|
|||||||
avatar_url,
|
avatar_url,
|
||||||
nickname,
|
nickname,
|
||||||
level,
|
level,
|
||||||
|
ntrp_level,
|
||||||
id: participant_user_id,
|
id: participant_user_id,
|
||||||
},
|
},
|
||||||
} = participant;
|
} = participant;
|
||||||
const role = is_organizer ? "组织者" : "参与者";
|
const role = is_organizer ? "组织者" : "参与者";
|
||||||
|
// 优先使用 ntrp_level,如果没有则使用 level
|
||||||
|
const ntrpValue = ntrp_level || level;
|
||||||
|
// 格式化显示 NTRP,如果没有值则显示"初学者"
|
||||||
|
const displayNtrp = ntrpValue ? formatNtrpDisplay(ntrpValue) : "初学者";
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
key={participant.id}
|
key={participant.id}
|
||||||
@@ -87,7 +93,7 @@ export default function Participants(props) {
|
|||||||
{nickname || "未知"}
|
{nickname || "未知"}
|
||||||
</Text>
|
</Text>
|
||||||
<Text className={styles["participants-list-item-level"]}>
|
<Text className={styles["participants-list-item-level"]}>
|
||||||
{level || "未知"}
|
{displayNtrp}
|
||||||
</Text>
|
</Text>
|
||||||
<Text className={styles["participants-list-item-role"]}>
|
<Text className={styles["participants-list-item-role"]}>
|
||||||
{role}
|
{role}
|
||||||
|
|||||||
Reference in New Issue
Block a user