register1.js 6.9 KB

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