import { View, Text } from "react-native"; import React from "react"; import { useTailwind } from "tailwind-rn"; import { Image } from "expo-image"; import Level from "../Level"; /* comment参数格式: { name: "色批1号", head: "https://s2.loli.net/2023/09/14/7AoD2kQlrnNUPFS.jpg", level: "23", content: ["身材好", "声音好听", "态度好"], type: "good", } */ export default function ServiceComment({ comment }) { const tailwind = useTailwind(); //计算标签颜色 const handleColor = (item) => { switch (item) { case "身材好": return "#ef4444"; case "声音好听": return "#facc15"; case "态度好": return "#e879f9"; case "缘分未到": return "#9ca3af"; default: return "#a3e635"; } }; return ( {comment.name} {comment.content.map((item, index) => ( {item} ))} ); }