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