index.tsx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { Image, View } from '@tarojs/components'
  2. import TagCertificated from "@/components/tag-certificated";
  3. import IconCertificateColor from "@/components/icon/icon-certificate-color";
  4. import { TAgentDetail } from '@/types/agent';
  5. import { AvatarMedia } from '@/components/AvatarMedia';
  6. interface IProps {
  7. agent: TAgentDetail|null
  8. haveBg: boolean
  9. }
  10. export default ({haveBg, agent}:IProps) => {
  11. const nameStyle = haveBg ? 'text-white' : 'text-black'
  12. const entStyle = haveBg ? 'text-white' : 'text-black-45'
  13. const renderContent = () => {
  14. return <>
  15. <View className="rounded-full overflow-hidden w-28 h-28">
  16. <AvatarMedia source={agent?.avatarLogo || ''} className='w-28 h-28'></AvatarMedia>
  17. </View>
  18. <View className="flex flex-col flex-1 gap-4">
  19. <View className="flex items-center gap-4">
  20. <View className={`text-12 font-medium leading-12 ${nameStyle}`}>{agent?.name}</View>
  21. {agent?.isEnt && <View className="text-12 leading-12"><IconCertificateColor/></View>}
  22. </View>
  23. {agent?.entName && <View className="flex items-center gap-2">
  24. <View className={`text-12 leading-12 truncate max-w-[180px] ${entStyle}`}>
  25. {agent?.entName}
  26. </View>
  27. </View>}
  28. </View>
  29. </>
  30. // return <>
  31. // <View className="rounded-full overflow-hidden w-60 h-60">
  32. // <AvatarMedia source={agent?.avatarLogo || ''} className='w-60 h-60'></AvatarMedia>
  33. // </View>
  34. // <View className="flex flex-col flex-1">
  35. // <View className="flex items-end gap-8">
  36. // <View className="text-24 font-medium leading-32">{agent?.name}</View>
  37. // <View className="text-12 leading-20">{agent?.position}</View>
  38. // </View>
  39. // <View className="flex items-center gap-2">
  40. // <View className="text-12 leading-20 truncate max-w-[188px]">
  41. // {agent?.entName}
  42. // </View>
  43. // {agent?.isEnt && <TagCertificated />}
  44. // </View>
  45. // </View>
  46. // </>
  47. }
  48. return (
  49. <View className="flex items-center gap-8">
  50. {renderContent()}
  51. </View>
  52. )
  53. }