register1.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View, TextInput } from "react-native"
  3. import RNPickerSelect from 'react-native-picker-select';
  4. import { unitWidth, unitHeight, getStatusBarHeight } from "../utils/AdapterUtil";
  5. import MyButtom from '../component/MyButton'
  6. export default class Register1 extends Component {
  7. state = {
  8. placeholderText: {
  9. label: '1990-01-01',
  10. value: null,
  11. color: '#333333',
  12. },
  13. placeholderText2: {
  14. label: '山东-烟台-莱山区',
  15. value: null,
  16. color: '#333333',
  17. },
  18. placeholderText3: {
  19. label: '165',
  20. value: null,
  21. color: '#333333',
  22. },
  23. };
  24. render() {
  25. return (
  26. <View style={styles.container}>
  27. <View style={styles.itemArea}>
  28. <Text style={styles.itemTitle}>请选择您的性别</Text>
  29. <View style={styles.item}>
  30. <View style={styles.itemOnceColor}>
  31. <Text style={styles.itemOnceTextColor}>
  32. </Text>
  33. </View>
  34. <View style={styles.itemOnce}>
  35. <Text style={styles.itemOnceText}>
  36. </Text>
  37. </View>
  38. </View>
  39. </View>
  40. <View style={styles.itemArea}>
  41. <Text style={styles.itemTitle}>请输入您的昵称</Text>
  42. <View style={styles.item}>
  43. <TextInput
  44. placeholder="请输入手机号"
  45. placeholderTextColor={"#999999"}
  46. style={styles.TextInput}
  47. />
  48. </View>
  49. </View>
  50. <View style={styles.itemArea}>
  51. <Text style={styles.itemTitle}>请选择您的生日</Text>
  52. <View style={styles.selectItem}>
  53. <RNPickerSelect
  54. placeholder={this.state.placeholderText}
  55. placeholderTextColor={"#333333"}
  56. onValueChange={(value) => console.log(value)}
  57. items={[
  58. { label: 'Football', value: 'football' },
  59. { label: 'Baseball', value: 'baseball' },
  60. { label: 'Hockey', value: 'hockey' },
  61. ]}
  62. />
  63. </View>
  64. </View>
  65. <View style={styles.itemArea}>
  66. <Text style={styles.itemTitle}>请选择您的常居地</Text>
  67. <View style={styles.selectItem}>
  68. <RNPickerSelect
  69. placeholder={this.state.placeholderText2}
  70. placeholderTextColor={"#333333"}
  71. onValueChange={(value) => console.log(value)}
  72. items={[
  73. { label: 'Football', value: 'football' },
  74. { label: 'Baseball', value: 'baseball' },
  75. { label: 'Hockey', value: 'hockey' },
  76. ]}
  77. />
  78. </View>
  79. </View>
  80. <View style={styles.itemArea}>
  81. <Text style={styles.itemTitle}>请选择您的身高</Text>
  82. <View style={styles.selectItem}>
  83. <RNPickerSelect
  84. placeholder={this.state.placeholderText3}
  85. placeholderTextColor={"#333333"}
  86. onValueChange={(value) => console.log(value)}
  87. items={[
  88. { label: 'Football', value: 'football' },
  89. { label: 'Baseball', value: 'baseball' },
  90. { label: 'Hockey', value: 'hockey' },
  91. ]}
  92. />
  93. </View>
  94. </View>
  95. <View style={styles.bottomBtn}>
  96. <MyButtom
  97. text={"下一步"}
  98. width={unitWidth * 502}
  99. height={unitHeight * 84}
  100. borderRadius={unitHeight * 84}
  101. bgColor="#FA788A"
  102. shadowBgc="rgba(250,120,138,1)"
  103. style={{ fontSize: unitWidth * 32 }}
  104. />
  105. </View>
  106. </View>
  107. )
  108. }
  109. }
  110. const styles = StyleSheet.create({
  111. container: {
  112. flex: 1,
  113. paddingTop: getStatusBarHeight() + unitHeight * 30,
  114. paddingLeft: unitWidth * 60,
  115. paddingRight: unitWidth * 60,
  116. },
  117. itemArea: {
  118. width: "100%"
  119. },
  120. itemTitle: {
  121. fontSize: unitWidth * 28,
  122. color: "#333333"
  123. },
  124. item: {
  125. flexDirection: "row",
  126. justifyContent: "space-between",
  127. marginTop: unitHeight * 35,
  128. marginBottom: unitHeight * 46
  129. },
  130. selectItem: {
  131. width: "100%",
  132. height: unitHeight * 68,
  133. marginTop: unitHeight * 35,
  134. borderRadius: unitHeight * 68,
  135. justifyContent: "center",
  136. paddingLeft: unitWidth * 50,
  137. borderWidth: unitWidth * 1,
  138. borderColor: "#ccc",
  139. marginBottom: unitHeight * 46
  140. },
  141. itemOnce: {
  142. width: unitWidth * 252,
  143. height: unitHeight * 68,
  144. borderRadius: unitHeight * 68,
  145. justifyContent: "center",
  146. alignItems: "center",
  147. backgroundColor: "#fff",
  148. borderWidth: unitWidth * 1,
  149. borderColor: "#ccc"
  150. },
  151. itemOnceColor: {
  152. borderRadius: unitHeight * 68,
  153. backgroundColor: "#FA788A",
  154. width: unitWidth * 252,
  155. height: unitHeight * 68,
  156. justifyContent: "center",
  157. alignItems: "center"
  158. },
  159. itemOnceTextColor: {
  160. fontSize: unitWidth * 28,
  161. color: "#fff"
  162. },
  163. itemOnceText: {
  164. fontSize: unitWidth * 28,
  165. color: "#333333"
  166. },
  167. TextInput: {
  168. width: "100%",
  169. height: unitHeight * 78,
  170. borderRadius: unitHeight * 78,
  171. fontSize: unitWidth * 28,
  172. paddingLeft: unitWidth * 50,
  173. borderWidth: unitWidth * 1,
  174. borderColor: "#ccc"
  175. },
  176. seletItem: {
  177. width: "100%",
  178. height: unitHeight * 78,
  179. backgroundColor: "#f00"
  180. },
  181. bottomBtn: {
  182. width: "100%",
  183. marginTop: unitHeight * 80,
  184. height: unitHeight * 84,
  185. justifyContent: 'center',
  186. alignItems: 'center'
  187. }
  188. })