register2.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View } from "react-native"
  3. import AntDesign from "react-native-vector-icons/AntDesign"
  4. import RNPickerSelect from 'react-native-picker-select';
  5. import { unitWidth, unitHeight, getStatusBarHeight } from "../utils/AdapterUtil";
  6. import MyButtom from '../component/MyButton'
  7. export default class Register2 extends Component {
  8. state = {
  9. placeholderText: {
  10. label: '10w-20w',
  11. value: null,
  12. color: '#333333',
  13. }
  14. };
  15. register3 = () => {
  16. const { navigation } = this.props;
  17. navigation.navigate("Register3")
  18. }
  19. render() {
  20. return (
  21. <View style={styles.container}>
  22. <View style={styles.itemArea}>
  23. <Text style={styles.itemTitle}>请选择您的月收入</Text>
  24. <View style={styles.selectItem}>
  25. <RNPickerSelect
  26. placeholder={this.state.placeholderText}
  27. placeholderTextColor={"#333333"}
  28. onValueChange={(value) => console.log(value)}
  29. items={[
  30. { label: 'Football', value: 'football' },
  31. { label: 'Baseball', value: 'baseball' },
  32. { label: 'Hockey', value: 'hockey' },
  33. ]}
  34. />
  35. </View>
  36. </View>
  37. <View style={styles.itemArea}>
  38. <Text style={styles.itemTitle}>请选择您的学历</Text>
  39. <View style={styles.item}>
  40. <View style={styles.itemOnceColor}>
  41. <Text style={styles.itemOnceTextColor}>
  42. 高中及以下
  43. </Text>
  44. </View>
  45. <View style={styles.itemOnce}>
  46. <Text style={styles.itemOnceText}>
  47. 大专
  48. </Text>
  49. </View>
  50. <View style={styles.itemOnce}>
  51. <Text style={styles.itemOnceText}>
  52. 本科
  53. </Text>
  54. </View>
  55. <View style={styles.itemOnce}>
  56. <Text style={styles.itemOnceText}>
  57. 硕士
  58. </Text>
  59. </View>
  60. <View style={styles.itemOnce}>
  61. <Text style={styles.itemOnceText}>
  62. 博士
  63. </Text>
  64. </View>
  65. </View>
  66. </View>
  67. <View style={styles.itemArea}>
  68. <Text style={styles.itemTitle}>请选择您的兴趣标签</Text>
  69. <View style={styles.itemList}>
  70. <AntDesign
  71. name={"message1"}
  72. size={24}
  73. style={{ color: "#FA7B8D", marginRight: unitWidth * 20 }}
  74. />
  75. <View style={styles.itemListCenter}>
  76. <View style={styles.itemListCOnce}>
  77. <Text style={styles.itemListOnceText}>
  78. 薯条
  79. </Text>
  80. </View>
  81. <View style={styles.itemListCOnce}>
  82. <Text style={styles.itemListOnceText}>
  83. 素食
  84. </Text>
  85. </View>
  86. <View style={styles.itemListCOnce}>
  87. <Text style={styles.itemListOnceText}>
  88. 甜品
  89. </Text>
  90. </View>
  91. </View>
  92. <Text style={{ fontSize: unitWidth * 28, color: "#333333", marginLeft: unitWidth * 20 }}>自定义</Text>
  93. </View>
  94. <View style={styles.itemList}>
  95. <AntDesign
  96. name={"message1"}
  97. size={24}
  98. style={{ color: "#FA7B8D", marginRight: unitWidth * 20 }}
  99. />
  100. <View style={styles.itemListCenter}>
  101. <View style={styles.itemListCOnce}>
  102. <Text style={styles.itemListOnceText}>
  103. 薯条
  104. </Text>
  105. </View>
  106. <View style={styles.itemListCOnce}>
  107. <Text style={styles.itemListOnceText}>
  108. 素食
  109. </Text>
  110. </View>
  111. <View style={styles.itemListCOnce}>
  112. <Text style={styles.itemListOnceText}>
  113. 甜品
  114. </Text>
  115. </View>
  116. </View>
  117. <Text style={{ fontSize: unitWidth * 28, color: "#333333", marginLeft: unitWidth * 20 }}>自定义</Text>
  118. </View>
  119. <View style={styles.itemList}>
  120. <AntDesign
  121. name={"message1"}
  122. size={24}
  123. style={{ color: "#FA7B8D", marginRight: unitWidth * 20 }}
  124. />
  125. <View style={styles.itemListCenter}>
  126. <View style={styles.itemListCOnce}>
  127. <Text style={styles.itemListOnceText}>
  128. 薯条
  129. </Text>
  130. </View>
  131. <View style={styles.itemListCOnce}>
  132. <Text style={styles.itemListOnceText}>
  133. 素食
  134. </Text>
  135. </View>
  136. <View style={styles.itemListCOnce}>
  137. <Text style={styles.itemListOnceText}>
  138. 甜品
  139. </Text>
  140. </View>
  141. </View>
  142. <Text style={{ fontSize: unitWidth * 28, color: "#333333", marginLeft: unitWidth * 20 }}>自定义</Text>
  143. </View>
  144. <View style={styles.itemList}>
  145. <AntDesign
  146. name={"message1"}
  147. size={24}
  148. style={{ color: "#FA7B8D", marginRight: unitWidth * 20 }}
  149. />
  150. <View style={styles.itemListCenter}>
  151. <View style={styles.itemListCOnce}>
  152. <Text style={styles.itemListOnceText}>
  153. 薯条
  154. </Text>
  155. </View>
  156. <View style={styles.itemListCOnce}>
  157. <Text style={styles.itemListOnceText}>
  158. 素食
  159. </Text>
  160. </View>
  161. <View style={styles.itemListCOnce}>
  162. <Text style={styles.itemListOnceText}>
  163. 甜品
  164. </Text>
  165. </View>
  166. </View>
  167. <Text style={{ fontSize: unitWidth * 28, color: "#333333", marginLeft: unitWidth * 20 }}>自定义</Text>
  168. </View>
  169. </View>
  170. <View style={styles.bottomBtn}>
  171. <MyButtom
  172. onPress={this.register3}
  173. text={"下一步"}
  174. width={unitWidth * 502}
  175. height={unitHeight * 84}
  176. borderRadius={unitHeight * 84}
  177. bgColor="#FA788A"
  178. shadowBgc="rgba(250,120,138,1)"
  179. style={{ fontSize: unitWidth * 32 }}
  180. />
  181. </View>
  182. </View>
  183. )
  184. }
  185. }
  186. const styles = StyleSheet.create({
  187. container: {
  188. flex: 1,
  189. paddingTop: getStatusBarHeight() + unitHeight * 30,
  190. paddingLeft: unitWidth * 60,
  191. paddingRight: unitWidth * 60,
  192. },
  193. itemArea: {
  194. width: "100%"
  195. },
  196. itemTitle: {
  197. fontSize: unitWidth * 28,
  198. color: "#333333"
  199. },
  200. item: {
  201. flexDirection: "row",
  202. marginTop: unitHeight * 35,
  203. marginBottom: unitHeight * 46
  204. },
  205. itemList: {
  206. flexDirection: "row",
  207. marginTop: unitHeight * 20,
  208. alignItems: "center",
  209. justifyContent: "flex-start"
  210. },
  211. itemListCenter: {
  212. width: unitWidth * 370,
  213. flexDirection: "row",
  214. justifyContent: "flex-start"
  215. },
  216. selectItem: {
  217. width: "100%",
  218. height: unitHeight * 68,
  219. marginTop: unitHeight * 35,
  220. borderRadius: unitHeight * 68,
  221. justifyContent: "center",
  222. paddingLeft: unitWidth * 50,
  223. borderWidth: unitWidth * 1,
  224. borderColor: "#ccc",
  225. marginBottom: unitHeight * 46
  226. },
  227. itemOnce: {
  228. height: unitHeight * 48,
  229. borderRadius: unitHeight * 28,
  230. justifyContent: "center",
  231. alignItems: "center",
  232. backgroundColor: "#fff",
  233. borderWidth: unitWidth * 1,
  234. borderColor: "#ccc",
  235. paddingLeft: unitWidth * 20,
  236. paddingRight: unitWidth * 20,
  237. marginRight: unitWidth * 20
  238. },
  239. itemListCOnce: {
  240. height: unitHeight * 42,
  241. borderRadius: unitHeight * 28,
  242. justifyContent: "center",
  243. alignItems: "center",
  244. borderWidth: unitWidth * 1,
  245. borderColor: "#FA7B8D",
  246. width: unitWidth * 108,
  247. marginRight: unitWidth * 20
  248. },
  249. itemOnceColor: {
  250. borderRadius: unitHeight * 28,
  251. backgroundColor: "#FA788A",
  252. height: unitHeight * 48,
  253. justifyContent: "center",
  254. alignItems: "center",
  255. paddingLeft: unitWidth * 20,
  256. paddingRight: unitWidth * 20,
  257. marginRight: unitWidth * 20
  258. },
  259. itemOnceTextColor: {
  260. fontSize: unitWidth * 28,
  261. color: "#fff"
  262. },
  263. itemOnceText: {
  264. fontSize: unitWidth * 28,
  265. color: "#333333"
  266. },
  267. itemListOnceText: {
  268. fontSize: unitWidth * 24,
  269. color: "#FA7B8D"
  270. },
  271. TextInput: {
  272. width: "100%",
  273. height: unitHeight * 78,
  274. borderRadius: unitHeight * 78,
  275. fontSize: unitWidth * 28,
  276. paddingLeft: unitWidth * 50,
  277. borderWidth: unitWidth * 1,
  278. borderColor: "#ccc"
  279. },
  280. seletItem: {
  281. width: "100%",
  282. height: unitHeight * 78,
  283. backgroundColor: "#f00"
  284. },
  285. bottomBtn: {
  286. width: "100%",
  287. marginTop: unitHeight * 343,
  288. height: unitHeight * 84,
  289. justifyContent: 'center',
  290. alignItems: 'center'
  291. }
  292. })