LoginPage.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View, TextInput, Button } from "react-native"
  3. import NavigationUtil from "../navigator/NavigationUtil"
  4. import EvilIcons from "react-native-vector-icons/EvilIcons"
  5. import { unitWidth, unitHeight, getStatusBarHeight } from "../utils/AdapterUtil";
  6. import MyButtom from '../component/MyButton'
  7. export default class Loginpage extends Component {
  8. componentDidMount() {
  9. this.timer = setTimeout(() => {
  10. // NavigationUtil.resetToHomePage(this.props)
  11. }, 5000)
  12. }
  13. componentWillMount() {
  14. this.timer && clearTimeout(this.timer)
  15. }
  16. render() {
  17. return (
  18. <View style={styles.container}>
  19. <Text style={styles.loginTitle}>账号密码登录</Text>
  20. <View style={styles.inputArea}>
  21. <View style={styles.inputPhone}>
  22. <View style={styles.inputLeft}>
  23. <Text style={styles.inputLeftText}>+86</Text>
  24. </View>
  25. <View style={styles.inputRight}>
  26. <TextInput
  27. placeholder="请输入手机号"
  28. placeholderTextColor={{ color: "#999999" }}
  29. style={styles.TextInput}
  30. />
  31. </View>
  32. </View>
  33. <View style={styles.inputPass}>
  34. <View style={styles.inputLeft}>
  35. <EvilIcons
  36. name={"unlock"}
  37. size={38}
  38. style={{ color: "#333333" }}
  39. />
  40. </View>
  41. <View>
  42. <TextInput
  43. placeholder="请输入密码"
  44. placeholderTextColor={{ color: "#999999" }}
  45. style={styles.TextInput}
  46. />
  47. </View>
  48. </View>
  49. </View>
  50. <View style={styles.forgetPassArea}>
  51. <Text>手机号注册登录</Text>
  52. <Text>忘记密码</Text>
  53. </View>
  54. <View style={styles.loginBtnArea}>
  55. <MyButtom
  56. text={'登录'}
  57. width={unitWidth * 502}
  58. height={unitHeight * 84}
  59. borderRadius={unitHeight * 84}
  60. bgColor="#FA788A"
  61. shadowBgc="rgba(250,120,138,1)"
  62. style={{ fontSize: unitWidth * 32 }}
  63. />
  64. </View>
  65. </View>
  66. )
  67. }
  68. }
  69. const styles = StyleSheet.create({
  70. container: {
  71. flex: 1,
  72. paddingTop: getStatusBarHeight() + unitWidth * 138,
  73. paddingLeft: unitWidth * 60,
  74. paddingRight: unitWidth * 60,
  75. },
  76. loginTitle: {
  77. fontSize: unitWidth * 38,
  78. fontWeight: "bold",
  79. color: "rgba(250,120,138,1)",
  80. marginBottom: unitWidth * 70
  81. },
  82. inputArea: {
  83. width: unitWidth * 628,
  84. height: unitHeight * 236,
  85. justifyContent: "space-between"
  86. },
  87. inputPhone: {
  88. width: "100%",
  89. height: unitHeight * 98,
  90. borderRadius: unitWidth * 98,
  91. borderWidth: unitWidth * 1,
  92. borderColor: "#ccc",
  93. flexDirection: "row"
  94. },
  95. inputLeft: {
  96. marginTop: unitHeight * 9,
  97. width: unitWidth * 147,
  98. height: unitHeight * 80,
  99. borderRightWidth: unitWidth * 1,
  100. borderRightColor: "#ccc",
  101. justifyContent: "center",
  102. alignItems: "center"
  103. },
  104. inputRight: {
  105. width: unitWidth * 480,
  106. height: "100%",
  107. },
  108. TextInput: {
  109. width: "100%",
  110. height: "100%",
  111. paddingLeft: unitWidth * 26,
  112. fontSize: unitWidth * 28
  113. },
  114. inputPass: {
  115. width: "100%",
  116. height: unitHeight * 98,
  117. borderRadius: unitWidth * 98,
  118. borderWidth: unitWidth * 1,
  119. borderColor: "#ccc",
  120. flexDirection: "row"
  121. },
  122. forgetPassArea: {
  123. flexDirection: "row",
  124. justifyContent: "space-between",
  125. width: "100%",
  126. fontSize: unitWidth * 28,
  127. color: "#333333",
  128. marginTop: unitHeight * 28
  129. },
  130. loginBtnArea: {
  131. width:"100%",
  132. marginTop:unitHeight * 98,
  133. height:unitHeight * 84,
  134. justifyContent:'center',
  135. alignItems:'center'
  136. }
  137. })