register.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View, TextInput } from "react-native"
  3. import Ionicons from "react-native-vector-icons/Ionicons"
  4. import { unitWidth, unitHeight, getStatusBarHeight } from "../utils/AdapterUtil";
  5. import MyButtom from '../component/MyButton'
  6. export default class Register extends Component {
  7. state = {
  8. pageTitle: "手机号登录注册",
  9. btnText: "下一步"
  10. };
  11. register1=()=>{
  12. const { navigation } = this.props;
  13. navigation.navigate("Register1")
  14. }
  15. render() {
  16. return (
  17. <View style={styles.container}>
  18. <Text style={styles.loginTitle}>{this.state.pageTitle}</Text>
  19. <View style={styles.inputArea}>
  20. <View style={styles.inputPhone}>
  21. <View style={styles.inputLeft}>
  22. <Text style={styles.inputLeftText}>+86</Text>
  23. </View>
  24. <View style={styles.inputRight}>
  25. <TextInput
  26. placeholder="请输入手机号"
  27. placeholderTextColor={"#999999"}
  28. style={styles.TextInput}
  29. />
  30. </View>
  31. </View>
  32. <View style={styles.inputPass}>
  33. <View style={styles.inputLeft}>
  34. <Text style={styles.inputLeftText}>验证码</Text>
  35. </View>
  36. <View style={styles.TextInputRightArea2}>
  37. <TextInput
  38. placeholder="请输入验证码"
  39. placeholderTextColor={"#999999"}
  40. style={styles.TextInput2}
  41. />
  42. </View>
  43. <View style={styles.verifyCodeArea}>
  44. <Text>获取验证码</Text>
  45. </View>
  46. </View>
  47. </View>
  48. <View style={styles.agree}>
  49. <Ionicons
  50. name={"md-radio-button-on"}
  51. size={20}
  52. style={{ color: "#FA788A", marginRight: unitWidth * 20 }}
  53. />
  54. <Text style={{ fontSize: unitWidth * 24, color: "#999999", marginRight: unitWidth * 2 }}>下一步即同意</Text>
  55. <Text style={{ fontSize: unitWidth * 24, color: "#FA788A" }}>用户协议</Text>
  56. </View>
  57. <View style={styles.bottomBtn}>
  58. <MyButtom
  59. onPress={this.register1}
  60. text={this.state.btnText}
  61. width={unitWidth * 502}
  62. height={unitHeight * 84}
  63. borderRadius={unitHeight * 84}
  64. bgColor="#FA788A"
  65. shadowBgc="rgba(250,120,138,1)"
  66. style={{ fontSize: unitWidth * 32 }}
  67. />
  68. </View>
  69. </View>
  70. )
  71. }
  72. }
  73. const styles = StyleSheet.create({
  74. container: {
  75. flex: 1,
  76. paddingTop: getStatusBarHeight() + unitHeight * 138,
  77. paddingLeft: unitWidth * 60,
  78. paddingRight: unitWidth * 60,
  79. },
  80. loginTitle: {
  81. fontSize: unitWidth * 38,
  82. fontWeight: "bold",
  83. color: "rgba(250,120,138,1)",
  84. marginBottom: unitWidth * 70
  85. },
  86. inputArea: {
  87. width: unitWidth * 628,
  88. justifyContent: "space-between"
  89. },
  90. inputPhone: {
  91. width: "100%",
  92. height: unitHeight * 98,
  93. borderRadius: unitWidth * 98,
  94. borderWidth: unitWidth * 1,
  95. borderColor: "#ccc",
  96. flexDirection: "row"
  97. },
  98. inputLeft: {
  99. marginTop: unitHeight * 9,
  100. width: unitWidth * 147,
  101. height: unitHeight * 80,
  102. borderRightWidth: unitWidth * 1,
  103. borderRightColor: "#ccc",
  104. justifyContent: "center",
  105. alignItems: "center"
  106. },
  107. inputRight: {
  108. width: unitWidth * 480,
  109. height: "100%"
  110. },
  111. TextInput: {
  112. width: "100%",
  113. height: "100%",
  114. paddingLeft: unitWidth * 26,
  115. fontSize: unitWidth * 28
  116. },
  117. TextInput2: {
  118. fontSize: unitWidth * 28
  119. },
  120. TextInputRightArea2: {
  121. flex: 3,
  122. height: "100%",
  123. paddingLeft: unitWidth * 26,
  124. fontSize: unitWidth * 28,
  125. justifyContent: "center"
  126. },
  127. verifyCodeArea: {
  128. flex: 2,
  129. height: "100%",
  130. justifyContent: "center",
  131. alignItems: "center"
  132. },
  133. verifyCode: {
  134. fontSize: unitWidth * 28,
  135. color: "#333333"
  136. },
  137. inputPass: {
  138. width: "100%",
  139. marginTop: unitHeight * 40,
  140. height: unitHeight * 98,
  141. borderRadius: unitWidth * 98,
  142. borderWidth: unitWidth * 1,
  143. borderColor: "#ccc",
  144. flexDirection: "row"
  145. },
  146. forgetPassArea: {
  147. flexDirection: "row",
  148. justifyContent: "space-between",
  149. width: "100%",
  150. fontSize: unitWidth * 28,
  151. color: "#333333",
  152. marginTop: unitHeight * 28
  153. },
  154. bottomBtn: {
  155. width: "100%",
  156. marginTop: unitHeight * 98,
  157. height: unitHeight * 84,
  158. justifyContent: 'center',
  159. alignItems: 'center'
  160. },
  161. agree: {
  162. width: "100%",
  163. height: unitHeight * 26,
  164. flexDirection: "row",
  165. justifyContent: "center",
  166. alignItems: "center",
  167. marginTop: unitHeight * 30
  168. }
  169. })