feat: 生成分享图
This commit is contained in:
46
src/game_pages/detail/components/GamePlayAndReq/index.tsx
Normal file
46
src/game_pages/detail/components/GamePlayAndReq/index.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import { View, Text } from "@tarojs/components";
|
||||
import { genNTRPRequirementText } from "../../utils/helper";
|
||||
import styles from "./index.module.scss";
|
||||
|
||||
// 玩法要求
|
||||
export default function GamePlayAndRequirement(props) {
|
||||
const {
|
||||
detail: { skill_level_min, skill_level_max, play_type, game_type },
|
||||
} = props;
|
||||
|
||||
const requirements = [
|
||||
{
|
||||
title: "NTRP水平要求",
|
||||
desc: genNTRPRequirementText(skill_level_min, skill_level_max),
|
||||
},
|
||||
{
|
||||
title: "活动玩法",
|
||||
desc: play_type || "-",
|
||||
},
|
||||
{
|
||||
title: "人员构成",
|
||||
desc: game_type || "-",
|
||||
},
|
||||
];
|
||||
return (
|
||||
<View className={styles["detail-page-content-gameplay-requirements"]}>
|
||||
{/* title */}
|
||||
<View className={styles["gameplay-requirements-title"]}>
|
||||
<Text>玩法要求</Text>
|
||||
</View>
|
||||
{/* requirements */}
|
||||
<View className={styles["gameplay-requirements"]}>
|
||||
{requirements.map((item, index) => (
|
||||
<View key={index} className={styles["gameplay-requirements-item"]}>
|
||||
<Text className={styles["gameplay-requirements-item-title"]}>
|
||||
{item.title}
|
||||
</Text>
|
||||
<Text className={styles["gameplay-requirements-item-desc"]}>
|
||||
{item.desc}
|
||||
</Text>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user