LoginPage.js 4.1 KB

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