Commit 15e67e1a by wong.peiyi

登录页面增加查看密码功能

parent db3475ca
......@@ -8,7 +8,8 @@ import {
Image,
TextInput,
TouchableOpacity,
NativeModules
NativeModules,
TouchableWithoutFeedback
} from 'react-native';
import {connect} from "react-redux";
import {
......@@ -42,6 +43,8 @@ class LoginPage extends Component{
this.state = {
username: '', // shi.ming gao.xiaoming
password: '', // sfrx2019
showPassword: false,
focuOnPw: false,
subTit: '登录',
subTitList: ['登录', '登录中...'],
isSubLoding: false,
......@@ -244,7 +247,7 @@ class LoginPage extends Component{
}
render() {
let {username, password, isSubLoding, subTit, isShowDomain, version_apk, isEnterHomeFlag} = this.state
let {username, password, isSubLoding, subTit, isShowDomain, version_apk, isEnterHomeFlag, showPassword, focuOnPw} = this.state
let {global_domain_config} = this.props
let tempInd = global_domain_config.indexOf('/') + 2
let tempGlobalDomain = global_domain_config.slice(tempInd)
......@@ -284,13 +287,26 @@ class LoginPage extends Component{
autoCapitalize='none'
placeholder="请输入您的密码"
placeholderTextColor={placehold_text_color}
secureTextEntry={true}
returnKeyType="done"
style={styles.row_input}
defaultValue={password}
secureTextEntry={!showPassword}
clearButtonMode="while-editing"
onChangeText={(text) => this.handlePassword(text)}
onFocus={() => this.setState({focuOnPw: true})}
onBlur={() => this.setState({focuOnPw: false})}
/>
{!!password && focuOnPw &&
<TouchableWithoutFeedback
onPress={() => this.setState({showPassword: !showPassword})}
style={styles.view_password_btn}
>
<Image
source={require('../../images/eye.png')}
style={styles.view_password}
/>
</TouchableWithoutFeedback>
}
</View>
</View>
<View style={styles.cont_footer}>
......@@ -396,7 +412,8 @@ const styles = StyleSheet.create({
backgroundColor: '#EFEFEF',
marginBottom: '8%',
borderRadius: 20,
paddingLeft: 10
paddingLeft: 10,
position: 'relative'
},
input_plholdco: {
color: '#919191'
......@@ -404,7 +421,7 @@ const styles = StyleSheet.create({
row_input: {
fontSize: third_text_size,
height: 38,
fontFamily: font_family_regular
fontFamily: font_family_regular,
},
cont_footer: {
justifyContent: 'flex-end',
......@@ -465,6 +482,13 @@ const styles = StyleSheet.create({
width: '100%',
height: '100%'
},
view_password: {
position: 'absolute',
right: pxSize(25),
top: 10,
width: 18,
height: 18,
}
})
const mapStateToProps = (state) => ({
......
......@@ -78,7 +78,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment