LoginPage.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View, TextInput } from "react-native"
  3. import EvilIcons from "react-native-vector-icons/EvilIcons"
  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. pageStatus: 0,
  10. btnText: "登录"
  11. };
  12. componentDidMount() {
  13. this.timer = setTimeout(() => {
  14. // NavigationUtil.resetToHomePage(this.props)
  15. }, 5000)
  16. }
  17. componentWillMount() {
  18. this.timer && clearTimeout(this.timer)
  19. }
  20. render() {
  21. return (
  22. <View style={styles.container}>
  23. <Text style={styles.loginTitle}>{this.state.pageTitle}</Text>
  24. <View style={styles.inputArea}>
  25. <View style={styles.inputPhone}>
  26. <View style={styles.inputLeft}>
  27. <Text style={styles.inputLeftText}>+86</Text>
  28. </View>
  29. <View style={styles.inputRight}>
  30. <TextInput
  31. placeholder="请输入手机号"
  32. placeholderTextColor={"#999999"}
  33. style={styles.TextInput}
  34. />
  35. </View>
  36. </View>
  37. <View style={styles.inputPass}>
  38. <View style={styles.inputLeft}>
  39. <EvilIcons
  40. name={"unlock"}
  41. size={38}
  42. style={{ color: "#333333" }}
  43. />
  44. </View>
  45. <View>
  46. <TextInput
  47. placeholder="请输入密码"
  48. placeholderTextColor={"#999999"}
  49. style={styles.TextInput}
  50. />
  51. </View>
  52. </View>
  53. </View>
  54. <View style={styles.forgetPassArea}>
  55. <Text>手机号注册登录</Text>
  56. <Text>忘记密码</Text>
  57. </View>
  58. <View style={styles.bottomBtn}>
  59. <MyButtom
  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. })