提交 83d794ba authored 作者: 吴强's avatar 吴强

修改login 界面

上级 1f139e04
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
"require-yield": [1], "require-yield": [1],
"no-plusplus": "off", "no-plusplus": "off",
"no-mixed-operators": "off", "no-mixed-operators": "off",
"max-len": [0, 120] "max-len": [0, 120],
"linebreak-style": 0
}, },
"parserOptions": { "parserOptions": {
"ecmaFeatures": { "ecmaFeatures": {
......
...@@ -7,5 +7,5 @@ ...@@ -7,5 +7,5 @@
# Location of the SDK. This is only used by Gradle. # Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the # For customization when using a Version Control System, please read the
# header note. # header note.
#Wed Sep 27 15:26:11 CST 2017 #Sun Oct 22 17:23:05 CST 2017
sdk.dir=/Users/yaohx_169/Library/Android/sdk sdk.dir=D\:\\Android\\sdk
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
"dependencies": { "dependencies": {
"antd-mobile": "^2.0.0", "antd-mobile": "^2.0.0",
"dva-core": "^1.1.0", "dva-core": "^1.1.0",
"rc-form": "^1.4.8",
"react": "^16.0.0-beta.5", "react": "^16.0.0-beta.5",
"react-native": "^0.49.3", "react-native": "^0.49.3",
"react-navigation": "^1.0.0-beta.14", "react-navigation": "^1.0.0-beta.14",
......
import welcome from './welcome'; import welcome from './welcome';
import login from './login';
export default [ export default [
welcome, welcome,
login,
]; ];
import { AsyncStorage } from 'react-native';
import { NavigationActions } from 'react-navigation'; import { NavigationActions } from 'react-navigation';
export default { export default {
namespace: 'login', namespace: 'login',
state: {},
reducers: {
},
effects: { effects: {
*login(ignored, { put, call }) { *login({ payload }, { put }) {
yield put(NavigationActions.navigate({ console.log(payload);
routeName: 'Main',
}));
}, },
}, },
}; };
import React, { Component } from 'react'; import React, { Component } from 'react';
import { View, Text } from 'react-native'; import { connect } from 'react-redux';
import { InputItem, List, Button, WhiteSpace } from 'antd-mobile';
import { createForm } from 'rc-form';
import {
StyleSheet,
View,
} from 'react-native';
import { createAction } from '../utils/index';
@connect()
class Login extends Component { class Login extends Component {
render() { render() {
const { getFieldProps } = this.props.form;
return ( return (
<View> <View style={LoginStyles.loginView} >
<Text>login</Text> <List renderHeader={() => '深圳查房系统'}>
<InputItem
{...getFieldProps('username')}
clear
placeholder="请输入用户名"
ref={(el) => { this.autoFocusInst = el; }}
>用户名
</InputItem>
<List.Item style={LoginStyles.separator} />
<InputItem
{...getFieldProps('password')}
clear
type="password"
placeholder="请输入密码"
ref={(el) => { this.customFocusInst = el; }}
>密码
</InputItem>
<List.Item style={LoginStyles.separator} />
<WhiteSpace type="lg" />
<List.Item>
<Button
type="primary"
onClick={() => {
this.props.form.validateFields((error, value) => {
this.props.dispatch(createAction('login/login')(value));
});
}}
>登陆
</Button>
</List.Item>
</List>
</View> </View>
); );
// return (
// <View style={LoginStyles.loginview}>
// <View style={{
// flexDirection: 'row',
// height: 100,
// marginTop: 1,
// justifyContent: 'center',
// alignItems: 'flex-start',
// }}
// >
// <Image source={require('../../image/login.png')} />
// </View>
// <View style={{ marginTop: 80 }}>
// <EditView
// name="输入用户名/注册手机号"
// onChangeText={(text) => {
// this.userName = text;
// }}
// />
// <EditView
// name="输入密码"
// onChangeText={(text) => {
// this.password = text;
// }}
// />
// <LoginButton name="登录" onPressCallback={this.onPressCallback} />
// <Text style={{ color: '#4A90E2', textAlign: 'center', marginTop: 10 }} >忘记密码?</Text>
// </View>
// </View>
// );
} }
} }
export default Login;
const LoginStyles = StyleSheet.create({
loginView: {
flex: 1,
padding: 30,
backgroundColor: '#ffffff',
},
TextInputView: {
marginTop: 10,
height: 50,
backgroundColor: '#ffffff',
borderRadius: 5,
borderWidth: 0.3,
borderColor: '#000000',
flexDirection: 'column',
justifyContent: 'center',
},
separator: {
backgroundColor: '#333333',
height: 0.4,
padding: 0,
margin: 3,
marginLeft: 15,
marginRight: 15,
},
TextInput: {
backgroundColor: '#ffffff',
height: 45,
margin: 18,
},
loginText: {
color: '#ffffff',
fontWeight: 'bold',
width: 30,
},
loginTextView: {
marginTop: 10,
height: 50,
backgroundColor: '#3281DD',
borderRadius: 5,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
},
});
export default createForm()(Login);
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论