register.js 5.4 KB

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