register.js 5.6 KB

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