提交 78d6440f authored 作者: 吴强's avatar 吴强

提交登陆界面

上级 79ce5da9
......@@ -174,6 +174,7 @@ dependencies {
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-vector-icons') // 2017-10-31 wq add
compile project(':react-native-splash-screen') //2017-11-7 wq Add for welcome screen
compile project(':react-native-camera')
}
// Run this once to be able to run the application with BUCK
......
......@@ -7,6 +7,9 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-sdk
android:minSdkVersion="16"
......
......@@ -6,6 +6,7 @@ import android.support.multidex.MultiDex;
import com.bolan.android.modules.IDCardReactPackage;
import com.facebook.react.ReactApplication;
import com.lwansbrough.RCTCamera.RCTCameraPackage;
import com.microsoft.codepush.react.CodePush;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import com.facebook.react.ReactNativeHost;
......@@ -37,6 +38,7 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RCTCameraPackage(),
new CodePush(BuildConfig.CODEPUSH_KEY, getApplicationContext(), BuildConfig.DEBUG, "http://192.168.1.2:3000"),
new RNDeviceInfo(),
new IDCardReactPackage(),
......
rootProject.name = 'bolanManagerApp'
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
include ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
include ':react-native-device-info'
......
......@@ -41,6 +41,7 @@
3FB191FD84A84EE59701A8DA /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78557CAE6D494E449ACA2E70 /* libSplashScreen.a */; };
1A1EABAFBB254C51AA95A884 /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5049A267195B4A6D95EE87C7 /* libCodePush.a */; };
BDC17299171149F2874B1AB8 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AC580FC9064DB19C36CE97 /* libz.tbd */; };
373C7FA9E2A645858860CEE6 /* libRCTCamera.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 57D2AA2056CB4B029AC613BB /* libRCTCamera.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -276,6 +277,8 @@
83AC580FC9064DB19C36CE97 /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; };
BE6C1D88183E4F098BBEED33 /* SplashScreen.xcodeproj */ = {isa = PBXFileReference; name = "SplashScreen.xcodeproj"; path = "../node_modules/react-native-splash-screen/ios/SplashScreen.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
78557CAE6D494E449ACA2E70 /* libSplashScreen.a */ = {isa = PBXFileReference; name = "libSplashScreen.a"; path = "libSplashScreen.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
0640C8B84C334158A1518970 /* RCTCamera.xcodeproj */ = {isa = PBXFileReference; name = "RCTCamera.xcodeproj"; path = "../node_modules/react-native-camera/ios/RCTCamera.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
57D2AA2056CB4B029AC613BB /* libRCTCamera.a */ = {isa = PBXFileReference; name = "libRCTCamera.a"; path = "libRCTCamera.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -309,6 +312,7 @@
1A1EABAFBB254C51AA95A884 /* libCodePush.a in Frameworks */,
BDC17299171149F2874B1AB8 /* libz.tbd in Frameworks */,
3FB191FD84A84EE59701A8DA /* libSplashScreen.a in Frameworks */,
373C7FA9E2A645858860CEE6 /* libRCTCamera.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -480,6 +484,7 @@
20C53C1323F44CCBB35F0247 /* RNDeviceInfo.xcodeproj */,
F140EEF54B894D10B664588B /* CodePush.xcodeproj */,
BE6C1D88183E4F098BBEED33 /* SplashScreen.xcodeproj */,
0640C8B84C334158A1518970 /* RCTCamera.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
......@@ -1040,12 +1045,14 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
"$(SRCROOT)\..\node_modules\react-native-splash-screen\ios",
"$(SRCROOT)\..\node_modules\react-native-camera\ios",
);
};
name = Debug;
......@@ -1069,12 +1076,14 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
"$(SRCROOT)\..\node_modules\react-native-splash-screen\ios",
"$(SRCROOT)\..\node_modules\react-native-camera\ios",
);
};
name = Release;
......@@ -1099,6 +1108,7 @@
"$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
"$(SRCROOT)\..\node_modules\react-native-splash-screen\ios",
"$(SRCROOT)\..\node_modules\react-native-camera\ios",
);
};
name = Debug;
......@@ -1122,6 +1132,7 @@
"$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
"$(SRCROOT)\..\node_modules\react-native-splash-screen\ios",
"$(SRCROOT)\..\node_modules\react-native-camera\ios",
);
};
name = Release;
......@@ -1154,12 +1165,14 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
"$(SRCROOT)\..\node_modules\react-native-splash-screen\ios",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
"$(SRCROOT)\..\node_modules\react-native-camera\ios",
);
};
name = Debug;
......@@ -1192,12 +1205,14 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native-device-info/RNDeviceInfo",
"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**",
"$(SRCROOT)\..\node_modules\react-native-splash-screen\ios",
"$(SRCROOT)\..\node_modules\react-native-camera\ios",
);
};
name = Release;
......@@ -1225,6 +1240,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
};
name = Debug;
......@@ -1252,6 +1268,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
};
name = Release;
......
差异被折叠。
......@@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-eslint": "^8.0.1",
"babel-eslint": "^8.0.2",
"babel-plugin-import": "^1.6.2",
"babel-preset-flow": "^6.23.0",
"babel-preset-react-native-stage-0": "^1.0.1",
......@@ -21,10 +21,11 @@
"style-loader": "^0.19.0"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"android-bundle": "react-native bundle --platform android --entry-file index.js --reset-cache --bundle-output android/app/src/main/assets/index.android.bundle --dev false --assets-dest android/app/src/main/res/",
"ios": "react-native run-ios",
"start": "node node_modules/react-native/local-cli/cli.js start",
"android": "node node_modules/react-native/local-cli/cli.js run-android",
"android-bundle": "node node_modules/react-native/local-cli/cli.js bundle --platform android --entry-file index.js --reset-cache --bundle-output android/app/src/main/assets/index.android.bundle --dev false --assets-dest android/app/src/main/res/",
"android-release-run": "node node_modules/react-native/local-cli/cli.js run-android --variant=release",
"ios": "node node_modules/react-native/local-cli/cli.js run-ios",
"test": "node node_modules/jest/bin/jest.js --watch",
"lint": "eslint --ext .js src test",
"flow_init": "flow init"
......@@ -33,7 +34,7 @@
"preset": "jest-expo"
},
"dependencies": {
"antd-mobile": "^2.0.1",
"antd-mobile": "^2.0.2",
"dva-core": "^1.1.0",
"dva-loading": "^1.0.3",
"fastjson_ref_resolver": "0.0.3",
......@@ -42,11 +43,12 @@
"rc-form": "^1.4.8",
"react": "^16.0.0-beta.5",
"react-native": "^0.49.3",
"react-native-camera": "^0.12.0",
"react-native-code-push": "^5.1.3-beta",
"react-native-device-info": "^0.12.1",
"react-native-splash-screen": "^3.0.6",
"react-native-vector-icons": "^4.4.2",
"react-navigation": "^1.0.0-beta.14",
"react-navigation": "^1.0.0-beta.19",
"react-redux": "^5.0.6",
"redux-persist": "^4.10.1"
}
......
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
} from 'react-native';
import Camera from 'react-native-camera';
class CameraComponent extends Component {
takePicture() {
const options = {};
//options.location = ...
this.camera.capture({ metadata: options })
.then((data) => console.log(data))
.catch(err => console.error(err));
}
render() {
return (
<View style={styles.container}>
<Camera
ref={(cam) => {
this.camera = cam;
}}
style={styles.preview}
aspect={Camera.constants.Aspect.fill}
barCodeTypes={['pdf417', 'code128']}
onBarCodeRead={evt => console.log(evt)}
>
<Text style={styles.capture} onPress={this.takePicture.bind(this)}>[CAPTURE]</Text>
</Camera>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
},
preview: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center',
},
capture: {
flex: 0,
backgroundColor: '#fff',
borderRadius: 5,
color: '#000',
padding: 10,
margin: 40,
},
});
export default CameraComponent;
......@@ -6,7 +6,11 @@ import {
StyleSheet,
View,
Text,
Image,
Dimensions,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import LoginBg from '../../image/loginbg.png';
import { createAction } from '../utils/index';
@connect()
......@@ -14,79 +18,84 @@ class Login extends Component {
render() {
const { getFieldProps } = this.props.form;
return (
<View style={LoginStyles.loginView} >
<List renderHeader={() => <View><Text style={LoginStyles.listText}>深圳查房系统</Text></View>}>
<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>
<Image source={LoginBg} style={LoginStyles.loginView} resizeMode="cover">
<View style={LoginStyles.TextInputView}>
<List
renderHeader={() => <View><Text style={LoginStyles.listText}>深圳房屋普查系统</Text></View>}
>
<InputItem
{...getFieldProps('userName')}
clear
placeholder="请输入用户名"
ref={(el) => { this.autoFocusInst = el; }}
><Icon name="user-o" size={16} color="#4F8EF7" />
</InputItem>
<InputItem
{...getFieldProps('password')}
clear
type="password"
placeholder="请输入密码"
ref={(el) => { this.customFocusInst = el; }}
><Icon name="lock" size={16} color="#4F8EF7" />
</InputItem>
<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>
</Image>
);
}
}
const LoginStyles = StyleSheet.create({
listText: {
// fontWeight: '900',
fontSize: 20,
color: '#000000',
fontSize: 25,
color: '#ffffff',
textAlign: 'center',
justifyContent: 'center',
},
loginView: {
flex: 1,
padding: 30,
backgroundColor: '#ffffff',
width: null,
height: null,
},
TextInputView: {
marginTop: 10,
height: 50,
backgroundColor: '#ffffff',
marginTop: Dimensions.get('window').height * 0.2,
backgroundColor: '#365cc1',
borderRadius: 5,
borderWidth: 0.3,
borderColor: '#000000',
borderColor: '#365cc1',
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: {
txtBorder: {
height: 50,
flex: 1,
borderWidth: 1,
borderColor: '#51A7F9',
marginLeft: 50,
marginRight: 50,
borderRadius: 25,
flexDirection: 'row',
},
loginText: {
color: '#ffffff',
fontWeight: 'bold',
width: 30,
......
......@@ -8,6 +8,7 @@ import { List, InputItem, Toast, WhiteSpace } from 'antd-mobile';
import Icon from 'react-native-vector-icons/FontAwesome';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
import CameraComponent from '../../../components/cameraComponent';
@connect(({ DSRInfoDetail }) => ({ DSRInfoDetail }))
class DSRInfoDetailScreen extends React.Component {
......@@ -127,6 +128,18 @@ class DSRInfoDetailScreen extends React.Component {
</Icon.Button>
</View>
<WhiteSpace />
<WhiteSpace />
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Icon.Button
name="edit"
backgroundColor="#08BBF9"
onPress={this.onEdit}
>
拍照
</Icon.Button>
</View>
<WhiteSpace />
<CameraComponent />
<List>
{
metas.map((m) => {
......@@ -141,6 +154,7 @@ class DSRInfoDetailScreen extends React.Component {
})
}
</List>
</ScrollView>
);
}
......
import React, { Component } from 'react';
import { View, Text, Image, StyleSheet } from 'react-native';
import { View, Text, Image, StyleSheet, ToolbarAndroid } from 'react-native';
import { TabNavigator } from 'react-navigation';
import Icon from 'react-native-vector-icons/MaterialIcons';
import userInfoPageScreen from './userinfo/index';
......@@ -111,6 +111,16 @@ const styles = StyleSheet.create({
width: 26,
height: 26,
},
containerToolbar: {
flex: 1,
justifyContent: 'flex-start',
alignItems: 'stretch',
backgroundColor: '#F5FCFF',
},
toolbar: {
backgroundColor: '#e9eaed',
height: 56,
},
});
export default MainPage;
......
......@@ -15,7 +15,7 @@ class WelcomeScreen extends Component {
render() {
return (
<View style={styles.container}>
<Text>wle</Text>
<Text>wlecome</Text>
</View>
);
......
......@@ -30,7 +30,8 @@ const config = {
productId: 'manager-app-sz',
footerText: '上海铂蓝信息科技有限公司',
contextPath: '',
apiContextPath: 'http://14.21.68.149:9089/test',
// apiContextPath: 'http://14.21.68.149:9089/test',
apiContextPath: 'http://192.168.1.22:8080/bm',
defaultDateFormat,
defaultTimeFormat,
defaultDateTimeFormat,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论