IdIcon.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View, ImageBackground } from "react-native"
  3. import { unitWidth, unitHeight } from "../../utils/AdapterUtil";
  4. import AntDesign from "react-native-vector-icons/AntDesign"
  5. export default class IdIcon extends Component {
  6. render() {
  7. let { IconList } = this.props
  8. return (
  9. <View style={styles.iconArea}>
  10. {
  11. IconList.map(item => {
  12. return (
  13. <View style={styles.iconItem}>
  14. <ImageBackground source={require('../../../static/idCard.png')}
  15. style={styles.icon}
  16. >
  17. <AntDesign
  18. name={"pluscircleo"}
  19. size={45}
  20. style={{ color: "#fff" }}
  21. />
  22. </ImageBackground>
  23. <Text style={{ color: "#333333", fontSize: unitWidth * 24 }}>{item}</Text>
  24. </View>
  25. )
  26. })
  27. }
  28. </View>
  29. )
  30. }
  31. }
  32. const styles = StyleSheet.create({
  33. iconArea: {
  34. width: "100%",
  35. height: unitHeight * 280,
  36. flexDirection: "row",
  37. justifyContent: "space-around",
  38. paddingLeft: unitWidth * 20,
  39. paddingRight: unitWidth * 20
  40. },
  41. iconItem: {
  42. flex: 1,
  43. height: unitHeight * 280,
  44. borderStyle: "dashed",
  45. borderWidth: 1,
  46. borderColor: "#ccc",
  47. alignItems: "center",
  48. justifyContent: "space-between",
  49. paddingTop: unitHeight * 57,
  50. paddingBottom: unitHeight * 20,
  51. marginLeft: unitWidth * 10,
  52. marginRight: unitWidth * 10
  53. },
  54. icon: {
  55. width: unitWidth * 264,
  56. height: unitWidth * 157,
  57. backgroundColor: "#FB7E90",
  58. justifyContent: "center",
  59. alignItems: "center",
  60. }
  61. })