Select.js 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import React, { Component } from "react"
  2. import { StyleSheet, View, Text, TextInput } from "react-native"
  3. import { unitWidth, unitHeight } from "../../utils/AdapterUtil";
  4. import AntDesign from "react-native-vector-icons/AntDesign"
  5. import RNPickerSelect from 'react-native-picker-select';
  6. export default class Select extends Component {
  7. render() {
  8. // let { text } = this.props
  9. return (
  10. <View style={styles.formArea}>
  11. <View style={styles.formItem}>
  12. <View style={styles.itemArea}>
  13. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>真实姓名:</Text>
  14. <View style={styles.inputRight}>
  15. <TextInput
  16. placeholder="请输入手机号"
  17. placeholderTextColor={"#999999"}
  18. style={styles.TextInput}
  19. />
  20. </View>
  21. </View>
  22. </View>
  23. <View style={styles.formItem}>
  24. <RNPickerSelect
  25. placeholder={""}
  26. onValueChange={(value) => console.log(value)}
  27. items={[
  28. { label: 'Football', value: 'football' },
  29. { label: 'Baseball', value: 'baseball' },
  30. { label: 'Hockey', value: 'hockey' },
  31. ]}
  32. >
  33. <View style={styles.itemArea}>
  34. <Text style={{ fontSize: unitWidth * 28, color: "#333333" }}>学 历:</Text>
  35. <View style={styles.selectRight}>
  36. <Text style={{ fontSize: unitWidth * 28, color: "#666666" }}>小学</Text>
  37. <AntDesign
  38. name={"caretdown"}
  39. size={15}
  40. style={{ color: "#999999" }}
  41. />
  42. </View>
  43. </View>
  44. </RNPickerSelect>
  45. </View>
  46. </View>
  47. )
  48. }
  49. }
  50. const styles = StyleSheet.create({
  51. formArea: {
  52. width: "100%",
  53. paddingTop: unitHeight * 30
  54. },
  55. formItem: {
  56. width: "100%",
  57. height: unitHeight * 72,
  58. backgroundColor: "#fff",
  59. marginBottom: unitHeight * 6,
  60. },
  61. itemArea: {
  62. width: "100%",
  63. height: "100%",
  64. flexDirection: "row",
  65. alignItems: "center",
  66. paddingLeft: unitWidth * 23,
  67. paddingRight: unitWidth * 24,
  68. borderBottomColor: "#F9F9F9",
  69. borderBottomWidth: 1
  70. },
  71. inputRight: {
  72. width: unitWidth * 566,
  73. height: "100%"
  74. },
  75. TextInput: {
  76. width: "100%",
  77. height: "100%",
  78. backgroundColor: "#F9F9F9",
  79. paddingLeft: unitWidth * 18
  80. },
  81. selectRight: {
  82. flexDirection: "row",
  83. justifyContent: "space-between",
  84. alignItems: "center",
  85. width: unitWidth * 566,
  86. height: unitHeight * 72,
  87. backgroundColor: "#F9F9F9",
  88. paddingRight: unitWidth * 18,
  89. paddingLeft: unitWidth * 18
  90. },
  91. })