提交 0d9e986a authored 作者: 吴强's avatar 吴强

人口上传头像,有点问题,就是无法改名字

上级 3b113569
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
project.ext.vectoricons = [
iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf' ] // Name of the font files you want to copy
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.bolanmanagerapp"
minSdkVersion 16
targetSdkVersion 25
multiDexEnabled true
versionCode 1
versionName "1.0.2"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
dexOptions {
javaMaxHeapSize "2G"
}
signingConfigs {
release {
storeFile file("app.jks")
storePassword "proland305\$"
keyAlias "bolan"
keyPassword "proland305\$"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
debug {
buildConfigField "String", "CODEPUSH_KEY", 'null'
}
releaseStaging {
signingConfig signingConfigs.release
buildConfigField "String", "CODEPUSH_KEY", '"' + properties.getProperty("code_push.key_staging") + '"'
}
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
buildConfigField "String", "CODEPUSH_KEY", '"' + properties.getProperty("code_push.key_production") + '"'
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile project(':react-native-background-upload')
compile project(':react-native-code-push')
compile project(':react-native-device-info')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.4.0"
compile 'com.android.support:multidex:1.0.1'
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
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
project.ext.vectoricons = [
iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf' ] // Name of the font files you want to copy
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.bolanmanagerapp"
minSdkVersion 16
targetSdkVersion 25
multiDexEnabled true
versionCode 1
versionName "1.0.4"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
dexOptions {
javaMaxHeapSize "2G"
}
signingConfigs {
release {
storeFile file("app.jks")
storePassword "proland305\$"
keyAlias "bolan"
keyPassword "proland305\$"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
debug {
buildConfigField "String", "CODEPUSH_KEY", 'null'
}
releaseStaging {
signingConfig signingConfigs.release
buildConfigField "String", "CODEPUSH_KEY", '"' + properties.getProperty("code_push.key_staging") + '"'
}
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
buildConfigField "String", "CODEPUSH_KEY", '"' + properties.getProperty("code_push.key_production") + '"'
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile project(':react-native-background-upload')
compile project(':react-native-code-push')
compile project(':react-native-device-info')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.4.0"
compile 'com.android.support:multidex:1.0.1'
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
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
import React from 'react';
import {
View,
StatusBar,
StyleSheet,
Image,
Dimensions,
} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons';
import Camera from 'react-native-camera';
const styles = StyleSheet.create({
container: {
flex: 1,
},
preview: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center',
},
previewPic: {
flex: 1,
},
overlay: {
position: 'absolute',
padding: 16,
right: 0,
left: 0,
alignItems: 'center',
},
topOverlay: {
top: 0,
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
bottomOverlay: {
bottom: 0,
backgroundColor: 'rgba(0,0,0,0.4)',
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
},
captureButton: {
padding: 15,
backgroundColor: 'white',
borderRadius: 40,
},
typeButton: {
padding: 5,
},
});
class CameraComponent extends React.Component {
constructor(props) {
super(props);
this.camera = null;
this.state = {
camera: {
aspect: Camera.constants.Aspect.fill,
captureTarget: Camera.constants.CaptureTarget.cameraRoll,
type: Camera.constants.Type.back,
orientation: Camera.constants.Orientation.auto,
},
isRecording: false,
imageURI: '',
};
this.switchCam = this.switchCam.bind(this);
this.recording = this.recording.bind(this);
this.takePicture = this.takePicture.bind(this);
this.uploadImage = this.uploadImage.bind(this);
this.clear = this.clear.bind(this);
this.goToUpload = this.goToUpload.bind(this);
}
typeIcon= () => {
const { back, front } = Camera.constants.Type;
if (this.state.camera.type === back) {
return 'camera-front';
// icon = require('./assets/ic_camera_rear_white.png');
} else if (this.state.camera.type === front) {
return 'camera-rear';
}
};
camButton= () => {
if (!this.state.isRecording) {
return 'videocam';
} else {
return 'stop';
}
};
switchCam() {
let newType;
const { back, front } = Camera.constants.Type;
if (this.state.camera.type === back) {
newType = front;
} else if (this.state.camera.type === front) {
newType = back;
}
this.setState({
camera: {
...this.state.camera,
type: newType,
},
});
}
recording() {
console.log(!this.state.isRecording);
if (!this.state.isRecording) {
if (this.camera) {
this.camera.capture({ mode: Camera.constants.CaptureMode.video })
.then(data => console.log(data))
.catch(err => console.error(err));
this.setState({ isRecording: true });
}
console.log('recording');
} else {
if (this.camera) {
this.camera.stopCapture();
this.setState({ isRecording: false });
}
console.log('stopped');
}
}
takePicture() {
const options = { mode: Camera.constants.CaptureMode.still };
this.camera.capture({ metadata: options })
.then((data) => { console.log(data); this.setState({ imageURI: data.path }); })
.catch(err => console.error(err));
}
// uploadImage() {
// let token;
// getToken().then((Apptoken) => {
// if (!Apptoken) {
// return Promise.reject(errors.tokenMissing());
// }
// token = encrypt(Apptoken);
// const uri = `${config.apiContextPath}/resource/${token}`;
// const formData = new global.FormData();
// const file = { uri: this.state.imageURI, type: 'image/jpg', name: 'tupian.jpg' };
//
// formData.append('file', file);
// console.info(formData);
// futch(uri, {
// method: 'POST',
// headers: {
// 'Content-Type': 'multipart/form-data',
// },
// body: formData,
// }, (progressEvent) => {
// const progress = progressEvent.loaded / progressEvent.total;
// })
// .then(request => request.responseText)// response.text())
// .then((responseData) => {
// const response = JSON.parse(responseData);
// if (response.errorCode === 0) {
// const name = 'addTags';// 添加标签
// const PicUri = `${config.apiContextPath}/api/interface/user/${name}/invoke`;
// console.info(PicUri);
// const postjson = { uri: response.data[0], tags: ['当事人信息', '当事人信息'] };
// console.info(JSON.stringify(postjson));
// userApi.invokeInterface(name, postjson)
// // futch(PicUri, {
// // method: 'POST',
// // headers: {
// // 'Content-Type': 'application/json',
// // },
// // body: JSON.stringify(postjson),
// // }, (progressEvent) => {
// // console.info(progressEvent);
// // })
// .then(request => console.info(request));// response.text())
// // 这里需要调用接口,对图片数据进行绑定,等待完善
// // 页面跳转,跳转到前面的详情的页面
// console.info('跳转');
// this.props.navigation.navigate('DSRInfoDetail', this.props.navigation.state.params.pID);
// }
// })
// .catch((error) => {
// console.info(error);
// });
// });
// }
clear() {
this.setState({ imageURI: '' });
}
goToUpload() {
this.props.navigation.navigate('DSRInfoTuPian', { imageURI: this.state.imageURI, pID: this.props.navigation.state.params.pID, TableName: this.props.navigation.state.params.TableName });
}
render() {
if (this.state.imageURI === '') {
return (
<View style={styles.container}>
<StatusBar animated hidden />
<Camera
ref={(cam) => {
this.camera = cam;
}}
style={styles.preview}
aspect={this.state.camera.aspect}
captureTarget={this.state.camera.captureTarget}
type={this.state.camera.type}
defaultTouchToFocus
mirrorImage={false}
/>
<View style={[styles.overlay, styles.topOverlay]}>
<Icon.Button name={this.typeIcon()} size={36} backgroundColor="transparent" onPress={this.switchCam} />
</View>
<View style={[styles.overlay, styles.bottomOverlay]}>
<Icon.Button name="photo-camera" size={48} backgroundColor="transparent" onPress={this.takePicture} />
<Icon.Button name={this.camButton()} size={48} backgroundColor="transparent" onPress={this.recording} />
</View>
</View>
);
} else {
return (
<View style={styles.container}>
<Image
style={{ height: Dimensions.get('window').height, width: Dimensions.get('window').width }}
source={{ uri: this.state.imageURI, isStatic: true }}
/>
<View style={[styles.overlay, styles.bottomOverlay]}>
<Icon.Button name="clear" size={48} backgroundColor="transparent" onPress={this.clear} />
<Icon.Button name="done" size={48} backgroundColor="transparent" onPress={this.goToUpload} />
</View>
</View>
);
}
}
}
export default CameraComponent;
import React from 'react';
import {
View,
StatusBar,
StyleSheet,
Image,
Dimensions,
} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons';
import Camera from 'react-native-camera';
const styles = StyleSheet.create({
container: {
flex: 1,
},
preview: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center',
},
previewPic: {
flex: 1,
},
overlay: {
position: 'absolute',
padding: 16,
right: 0,
left: 0,
alignItems: 'center',
},
topOverlay: {
top: 0,
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
bottomOverlay: {
bottom: 0,
backgroundColor: 'rgba(0,0,0,0.4)',
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
},
captureButton: {
padding: 15,
backgroundColor: 'white',
borderRadius: 40,
},
typeButton: {
padding: 5,
},
});
class CameraComponent extends React.Component {
constructor(props) {
super(props);
this.camera = null;
this.state = {
camera: {
aspect: Camera.constants.Aspect.fill,
captureTarget: Camera.constants.CaptureTarget.cameraRoll,
type: Camera.constants.Type.back,
orientation: Camera.constants.Orientation.auto,
},
isRecording: false,
imageURI: '',
};
this.switchCam = this.switchCam.bind(this);
this.recording = this.recording.bind(this);
this.takePicture = this.takePicture.bind(this);
// this.uploadImage = this.uploadImage.bind(this);
this.clear = this.clear.bind(this);
this.goToUpload = this.goToUpload.bind(this);
}
typeIcon= () => {
const { back, front } = Camera.constants.Type;
if (this.state.camera.type === back) {
return 'camera-front';
// icon = require('./assets/ic_camera_rear_white.png');
} else if (this.state.camera.type === front) {
return 'camera-rear';
}
};
camButton= () => {
if (!this.state.isRecording) {
return 'videocam';
} else {
return 'stop';
}
};
switchCam() {
let newType;
const { back, front } = Camera.constants.Type;
if (this.state.camera.type === back) {
newType = front;
} else if (this.state.camera.type === front) {
newType = back;
}
this.setState({
camera: {
...this.state.camera,
type: newType,
},
});
}
recording() {
console.log(!this.state.isRecording);
if (!this.state.isRecording) {
if (this.camera) {
this.camera.capture({ mode: Camera.constants.CaptureMode.video })
.then(data => console.log(data))
.catch(err => console.error(err));
this.setState({ isRecording: true });
}
console.log('recording');
} else {
if (this.camera) {
this.camera.stopCapture();
this.setState({ isRecording: false });
}
console.log('stopped');
}
}
takePicture() {
const options = { mode: Camera.constants.CaptureMode.still };
this.camera.capture({ metadata: options })
.then((data) => { console.log(data); this.setState({ imageURI: data.path }); })
.catch(err => console.error(err));
}
// uploadImage() {
// let token;
// getToken().then((Apptoken) => {
// if (!Apptoken) {
// return Promise.reject(errors.tokenMissing());
// }
// token = encrypt(Apptoken);
// const uri = `${config.apiContextPath}/resource/${token}`;
// const formData = new global.FormData();
// const file = { uri: this.state.imageURI, type: 'image/jpg', name: 'tupian.jpg' };
//
// formData.append('file', file);
// console.info(formData);
// futch(uri, {
// method: 'POST',
// headers: {
// 'Content-Type': 'multipart/form-data',
// },
// body: formData,
// }, (progressEvent) => {
// const progress = progressEvent.loaded / progressEvent.total;
// })
// .then(request => request.responseText)// response.text())
// .then((responseData) => {
// const response = JSON.parse(responseData);
// if (response.errorCode === 0) {
// const name = 'addTags';// 添加标签
// const PicUri = `${config.apiContextPath}/api/interface/user/${name}/invoke`;
// console.info(PicUri);
// const postjson = { uri: response.data[0], tags: ['当事人信息', '当事人信息'] };
// console.info(JSON.stringify(postjson));
// userApi.invokeInterface(name, postjson)
// // futch(PicUri, {
// // method: 'POST',
// // headers: {
// // 'Content-Type': 'application/json',
// // },
// // body: JSON.stringify(postjson),
// // }, (progressEvent) => {
// // console.info(progressEvent);
// // })
// .then(request => console.info(request));// response.text())
// // 这里需要调用接口,对图片数据进行绑定,等待完善
// // 页面跳转,跳转到前面的详情的页面
// console.info('跳转');
// this.props.navigation.navigate('DSRInfoDetail', this.props.navigation.state.params.pID);
// }
// })
// .catch((error) => {
// console.info(error);
// });
// });
// }
clear() {
this.setState({ imageURI: '' });
}
goToUpload() {
this.props.navigation.navigate('DSRInfoTuPian', { imageURI: this.state.imageURI, pID: this.props.navigation.state.params.pID, tableName: this.props.navigation.state.params.tableName });
}
render() {
if (this.state.imageURI === '') {
return (
<View style={styles.container}>
<StatusBar animated hidden />
<Camera
ref={(cam) => {
this.camera = cam;
}}
style={styles.preview}
aspect={this.state.camera.aspect}
captureTarget={this.state.camera.captureTarget}
type={this.state.camera.type}
defaultTouchToFocus
mirrorImage={false}
/>
<View style={[styles.overlay, styles.topOverlay]}>
<Icon.Button name={this.typeIcon()} size={36} backgroundColor="transparent" onPress={this.switchCam} />
</View>
<View style={[styles.overlay, styles.bottomOverlay]}>
<Icon.Button name="photo-camera" size={48} backgroundColor="transparent" onPress={this.takePicture} />
<Icon.Button name={this.camButton()} size={48} backgroundColor="transparent" onPress={this.recording} />
</View>
</View>
);
} else {
return (
<View style={styles.container}>
<Image
style={{ height: Dimensions.get('window').height, width: Dimensions.get('window').width }}
source={{ uri: this.state.imageURI, isStatic: true }}
/>
<View style={[styles.overlay, styles.bottomOverlay]}>
<Icon.Button name="clear" size={48} backgroundColor="transparent" onPress={this.clear} />
<Icon.Button name="done" size={48} backgroundColor="transparent" onPress={this.goToUpload} />
</View>
</View>
);
}
}
}
export default CameraComponent;
import React, { Component } from 'react';
import PhotoBrowser from 'react-native-photo-browser';
export default class HomeScreen extends Component {
static navigationOptions = {
header: null,
};
// onSelectionChanged = (media, index, selected) => {
// console.info(`${media.photo} selection status: ${selected}`);
// };
// onActionButton = (media, index) => {
// if (Platform.OS === 'ios') {
// ActionSheetIOS.showShareActionSheetWithOptions(
// {
// url: media.photo,
// message: media.caption,
// },
// () => {},
// () => {},
// );
// } else {
// console.info(`handle sharing on android for ${media.photo}, index: ${index}`);
// }
// };
render() {
const {
media,
initialIndex,
displayNavArrows,
displayActionButton,
displaySelectionButtons,
startOnGrid,
enableGrid,
alwaysDisplayStatusBar,
} = this.props.navigation.state.params.example;
return (
<PhotoBrowser
onBack={this.props.navigation.pop}
mediaList={media}
initialIndex={initialIndex}
displayNavArrows={displayNavArrows}
displaySelectionButtons={displaySelectionButtons}
displayActionButton={displayActionButton}
startOnGrid={startOnGrid}
enableGrid={enableGrid}
useCircleProgress
onSelectionChanged={this.onSelectionChanged}
onActionButton={this.onActionButton}
alwaysDisplayStatusBar={alwaysDisplayStatusBar}
customTitle={(index, rowCount) => `${index} sur ${rowCount}`}
/>
);
}
}
import React, { Component } from 'react';
import {
Platform,
ActionSheetIOS,
} from 'react-native';
import PhotoBrowser from 'react-native-photo-browser';
export default class HomeScreen extends Component {
static navigationOptions = {
header: null,
};
onSelectionChanged = (media, index, selected) => {
console.info(`${media.photo} selection status: ${selected}`);
};
onActionButton = (media, index) => {
if (Platform.OS === 'ios') {
ActionSheetIOS.showShareActionSheetWithOptions(
{
url: media.photo,
message: media.caption,
},
() => {},
() => {},
);
} else {
console.info(`handle sharing on android for ${media.photo}, index: ${index}`);
}
};
render() {
const {
media,
initialIndex,
displayNavArrows,
displayActionButton,
displaySelectionButtons,
startOnGrid,
enableGrid,
alwaysDisplayStatusBar,
} = this.props.navigation.state.params.example;
return (
<PhotoBrowser
onBack={this.props.navigation.pop}
mediaList={media}
initialIndex={initialIndex}
displayNavArrows={displayNavArrows}
displaySelectionButtons={displaySelectionButtons}
displayActionButton={displayActionButton}
startOnGrid={startOnGrid}
enableGrid={enableGrid}
useCircleProgress
onSelectionChanged={this.onSelectionChanged}
onActionButton={this.onActionButton}
alwaysDisplayStatusBar={alwaysDisplayStatusBar}
customTitle={(index, rowCount) => `${index} sur ${rowCount}`}
/>
);
}
}
import React, { PureComponent } from 'react';
import {
View,
StyleSheet,
Text,
TouchableOpacity,
Image,
Platform,
ScrollView,
} from 'react-native';
import TagInput from 'react-native-tag-input';
import { InputItem } from 'antd-mobile';
import { createOperations, editResource, uploadResource } from '../services/resource';
const styles = StyleSheet.create({
container: {
flex: 1,
},
view_header_container: {
height: 56,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-around',
},
text_right_title: {
color: '#000',
},
text_left_title: {
color: '#000',
},
text_title: {
color: '#000',
fontSize: 18,
},
// uploadImage: {
// height: Dimensions.get('window').height,
// width: Dimensions.get('window').width,
// },
});
const inputProps = {
keyboardType: 'default',
placeholder: '如:身份证',
autoFocus: true,
style: {
fontSize: 14,
marginVertical: Platform.OS === 'ios' ? 10 : -2,
},
};
class UploadPageComponent extends PureComponent {
constructor(props) {
super(props);
const { imageURI, tableName, pID } = this.props.navigation.state.params;
this.state = {
imageURI,
tableName,
pID,
tags: ['身份证', '红本', '绿本'],
text: '',
imageName: '',
};
}
onChangeTags = (tags) => {
this.setState({ tags });
};
onChangeText = (text) => {
this.setState({ text });
const lastTyped = text.charAt(text.length - 1);
const parseWhen = [',', ' ', ';', '\n'];
if (parseWhen.indexOf(lastTyped) > -1) {
this.setState({
tags: [...this.state.tags, this.state.text],
text: '',
});
}
};
onCancel = () => {
this.props.onCancel();
};
onUploadPhoto = () => {
uploadResource(
this.state.imageURI,
(uploadId, arg) => {
editResource(arg, createOperations().setName(this.state.imageName).setTags(this.state.tags).use(`rel://path/${this.state.tableName}/${this.state.pID}`)).then().catch(err => console.info(`上传后改名字改tag:${err}`));
console.info('跳转');
this.props.navigation.navigate('DSRInfoDetail', this.props.navigation.state.params.pID);
},
(uploadId, arg) => console.info(arg),
)
.then(uploadId => console.log(`start task ${uploadId}`))
.catch(err => console.log(`上传失败:${err}`));
};
setImageName = (val) => {
console.info(`val:${val}`);
this.setState({ imageName: val });
}
labelExtractor = tag => tag;
renderHeaderMenu = () => {
return (
<View style={[styles.view_header_container, { backgroundColor: 'lightgray' }]}>
<TouchableOpacity
onPress={this.onCancel}
>
<Text style={[styles.text_left_title, { color: '#2196F3' }]}>取消</Text>
</TouchableOpacity>
<Text style={styles.text_title}>传照片</Text>
<TouchableOpacity
onPress={this.onUploadPhoto}
>
<Text style={[styles.text_right_title, { color: '#2196F3' }]}>
上传
</Text>
</TouchableOpacity>
</View>
);
}
render() {
return (
<View style={styles.container}>
{this.renderHeaderMenu()}
<ScrollView>
<Image
style={{ height: 80, width: 80 }}
source={{ uri: this.state.imageURI, isStatic: true }}
/>
<InputItem
placeholder="如:张三"
data-seed="logId"
onChange={this.setImageName}
>照片名称
</InputItem>
<View style={{ flexDirection: 'row', alignItems: 'center', backgroundColor: 'lightgray' }}>
<Text>类型</Text>
<TagInput
value={this.state.tags}
onChange={this.onChangeTags}
labelExtractor={this.labelExtractor}
text={this.state.text}
onChangeText={this.onChangeText}
tagColor="blue"
tagTextColor="white"
inputProps={inputProps}
maxHeight={75}
/>
</View>
</ScrollView>
</View>
);
}
}
export default UploadPageComponent;
import React, { PureComponent } from 'react';
import {
View,
StyleSheet,
Text,
TouchableOpacity,
Image,
Platform,
ScrollView,
} from 'react-native';
import TagInput from 'react-native-tag-input';
import { InputItem } from 'antd-mobile';
import { createOperations, editResource, uploadResource } from '../services/resource';
import { currentDomain } from '../services/domain';
const styles = StyleSheet.create({
container: {
flex: 1,
},
view_header_container: {
height: 56,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-around',
},
text_right_title: {
color: '#000',
},
text_left_title: {
color: '#000',
},
text_title: {
color: '#000',
fontSize: 18,
},
// uploadImage: {
// height: Dimensions.get('window').height,
// width: Dimensions.get('window').width,
// },
});
const inputProps = {
keyboardType: 'default',
placeholder: '如:身份证',
autoFocus: true,
style: {
fontSize: 14,
marginVertical: Platform.OS === 'ios' ? 10 : -2,
},
};
class UploadPageComponent extends PureComponent {
constructor(props) {
super(props);
const { imageURI, tableName, pID } = this.props.navigation.state.params;
this.state = {
imageURI,
tableName,
pID,
tags: ['身份证', '红本', '绿本'],
text: '',
imageName: '',
};
}
onChangeTags = (tags) => {
this.setState({ tags });
};
onChangeText = (text) => {
this.setState({ text });
const lastTyped = text.charAt(text.length - 1);
const parseWhen = [',', ' ', ';', '\n'];
if (parseWhen.indexOf(lastTyped) > -1) {
this.setState({
tags: [...this.state.tags, this.state.text],
text: '',
});
}
};
onCancel = () => {
this.props.onCancel();
};
onUploadPhoto = () => {
uploadResource(
this.state.imageURI,
(uploadId, arg) => console.info(arg),
(uploadId, arg) => {
currentDomain()
.then((result) => {
editResource(arg, createOperations().setName(this.state.imageName).setTags(this.state.tags).use(`rel://${result.path}/${this.state.tableName}/${this.state.pID}`)).then(cc => console.info(cc)).catch(err => console.info(`上传后改名字改tag:${err}`));
console.info('跳转');
this.props.navigation.navigate('DSRInfoDetail', { id: this.props.navigation.state.params.pID });
})
.catch(err => console.info(err));
},
)
.then(uploadId => console.log(`start task ${uploadId}`))
.catch(err => console.log(`上传失败:${err}`));
};
setImageName = (val) => {
console.info(`val:${val}`);
this.setState({ imageName: val });
}
labelExtractor = tag => tag;
renderHeaderMenu = () => {
return (
<View style={[styles.view_header_container, { backgroundColor: 'lightgray' }]}>
<TouchableOpacity
onPress={this.onCancel}
>
<Text style={[styles.text_left_title, { color: '#2196F3' }]}>取消</Text>
</TouchableOpacity>
<Text style={styles.text_title}>传照片</Text>
<TouchableOpacity
onPress={this.onUploadPhoto}
>
<Text style={[styles.text_right_title, { color: '#2196F3' }]}>
上传
</Text>
</TouchableOpacity>
</View>
);
}
render() {
return (
<View style={styles.container}>
{this.renderHeaderMenu()}
<ScrollView>
<Image
style={{ height: 80, width: 80 }}
source={{ uri: this.state.imageURI, isStatic: true }}
/>
<InputItem
placeholder="如:张三"
data-seed="logId"
onChange={this.setImageName}
>照片名称
</InputItem>
<View style={{ flexDirection: 'row', alignItems: 'center', backgroundColor: 'lightgray' }}>
<Text>类型</Text>
<TagInput
value={this.state.tags}
onChange={this.onChangeTags}
labelExtractor={this.labelExtractor}
text={this.state.text}
onChangeText={this.onChangeText}
tagColor="blue"
tagTextColor="white"
inputProps={inputProps}
maxHeight={75}
/>
</View>
</ScrollView>
</View>
);
}
}
export default UploadPageComponent;
import { NavigationActions } from 'react-navigation';
import { login, userInfo } from '../services/login';
import { errors } from '../utils/error';
import { setToken, setUser } from '../utils/auth';
export default {
namespace: 'login',
state: {},
reducers: {
},
effects: {
*login({ payload }, { call, put }) { // 这里的put 代表 跟dispatch一样的功能,只是在effects中叫做put
const payloads = { ...payload, type: 'userName', authType: 'password' };
console.info(payloads);
const result = yield call(login, payloads);
const { tokenId, authResponse, remainedAuthRequirements } = result;
if (authResponse.status !== 'authed' && authResponse.status !== 'skipped') {
throw errors.wrongPassword();
}
console.log(authResponse);
const { requirements } = remainedAuthRequirements;
if (requirements.length > 0) {
throw errors.unsupportedAuthType(requirements);
}
console.log(requirements);
yield call(setToken, tokenId);// 这里的yield ,跟C#中的await一样
const uInfo = yield call(userInfo);
console.log(uInfo);
yield call(setUser, uInfo.id, uInfo.name); // 保存用户名密码
yield put(NavigationActions.navigate({
routeName: 'Main',
}));
},
},
subscriptions: {},
};
import { NavigationActions } from 'react-navigation';
import { login, userInfo } from '../services/login';
import { errors } from '../utils/error';
import { setToken, setUser } from '../utils/auth';
export default {
namespace: 'login',
state: {},
reducers: {
},
effects: {
*login({ payload }, { call, put }) { // 这里的put 代表 跟dispatch一样的功能,只是在effects中叫做put
const payloads = { ...payload, type: 'userName', authType: 'password' };
const result = yield call(login, payloads);
const { tokenId, authResponse, remainedAuthRequirements } = result;
if (authResponse.status !== 'authed' && authResponse.status !== 'skipped') {
throw errors.wrongPassword();
}
const { requirements } = remainedAuthRequirements;
if (requirements.length > 0) {
throw errors.unsupportedAuthType(requirements);
}
yield call(setToken, tokenId);// 这里的yield ,跟C#中的await一样
const uInfo = yield call(userInfo);
yield call(setUser, uInfo.id, uInfo.name); // 保存用户名密码
yield put(NavigationActions.navigate({
routeName: 'Main',
}));
},
},
subscriptions: {},
};
/**
* Created by zhouhuan on 2017/10/30.
*/
import { Toast } from 'antd-mobile';
import { unionBy } from 'lodash';
import { NavigationActions } from 'react-navigation';
import { getData, getMeta } from '../../utils/DataTemplate';
import { datasourceApi } from '../../services/datasource';
import { scan } from '../../services/idcard';
import {createOperations, editResource, uploadResource} from "../../services/resource";
export default {
namespace: 'peopleInfo',
state: {
sourceData: [],
metas: [],
detailData: {},
editable: false,
disabled: true,
types: '',
peopleID: '',
searchValue: '',
},
effects: {
*jumpPage({ payload: id }, { put }) {
yield put({ type: 'setPeopPleID', payload: id });
yield put(NavigationActions.navigate({
routeName: 'peopleInfoDetail',
params: { id },
}));
},
*getPeopleInfo({ payload }, { put, call, select, take }) {
const { clear, pxingMing } = payload;
if (clear === 'clear') {
yield put({ type: 'clearList', payload: {} });
}
const { sourceData } = yield select(state => state.peopleInfo);
const size = sourceData.length;
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKTable',
};
try {
const result = yield call(getData, coordinate, { pst: size, psz: 10, params: { pxingMing } });
const meta = yield call(getMeta, coordinate);
yield put({ type: 'setMetas', payload: meta });
for (const row of result) {
yield put({ type: 'addPeople', payload: row });
yield take('addPeople/@@end');
}
} catch (err) {
}
},
*addPeople({ payload }, { put }) {
yield put({ type: 'setPeopleList', payload: { arrayData: [payload] } });
},
*getPeopleDetail({ payload }, { put, call }) {
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKDetails',
};
const result = yield call(getData, coordinate, { params: { pID: payload } });
yield put({ type: 'getPeopleDetailInfo', payload: { ...result[0] } });
yield put({ type: 'setEdit', payload: false });
},
*savePeopleInfo({ payload }, { put, select, call }) {
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKDetails',
};
const api = datasourceApi(coordinate);
const result = yield call(api.create, payload);
console.info(result);
const { detailData } = yield select(state => state.peopleInfo);
console.info(detailData);
try {
const { arg } = yield call(uploadResource, detailData.photoUri);
yield call(editResource, arg, createOperations().setName(detailData.identityCard).setTags('身份证头像').use(`rel://DangShiRenRenKouXinXi/${result}`));
} catch (e) {
console.info(e);
}
if (result === null) {
Toast.fail('信息重复!', 2);
} else {
Toast.success('录入成功!', 1);
}
yield put(NavigationActions.navigate({
routeName: 'peopleInfoList',
}));
},
*addPeopleInfo(ignore, { put }) {
yield put({ type: 'getPeopleDetailInfo', payload: {} });
yield put(NavigationActions.navigate({
routeName: 'addPeoppleInfo',
}));
},
*GoToPeopleDetailEditScreen({ payload: id }, { put }) {
yield put({ type: 'setPeopPleID', payload: id });
yield put(NavigationActions.navigate({
routeName: 'peopleInfoDetailEdit',
}));
},
*updateDSRDetail({ payload }, { call, put }) {
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKDetails',
};
const api = datasourceApi(coordinate);
yield call(api.update, payload.id, payload.singularData);
Toast.success('修改成功!', 0.5);
yield put(NavigationActions.navigate({
routeName: 'peopleInfoList',
}));
yield put({ type: 'getPeopleInfo', payload: 'clear' });
yield put({ type: 'setDisabled', payload: true });
},
*onEBack({ payload }, { put, call, select, take }) {
if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} });
}
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKTable',
};
const { sourceData } = yield select(state => state.peopleInfo);
const size = sourceData.length;
const result = yield call(getData, coordinate, { pst: size, psz: 10 });
const meta = yield call(getMeta, coordinate);
yield put({ type: 'setMetas', payload: meta });
for (const row of result) {
yield put({ type: 'addPeople', payload: row });
yield take('addPeople/@@end');
}
yield put(NavigationActions.navigate({
routeName: 'peopleInfoList',
}));
yield put({ type: 'setDisabled', payload: true });
},
*DuKa(ignored, { call, put }) {
try {
Toast.loading('读卡中...', 0);
const result = yield call(scan);
console.info(result);
if (result) {
yield put({ type: 'setdetailData', payload: result });
}
Toast.loading('读卡完成...', 2);
} catch (e) {
Toast.loading('读卡失败', 10);
}
//
},
},
reducers: {
setPeopPleID(state, { payload }) {
return {
...state,
peopleID: payload,
};
},
// 下拉刷新用到的,清空列表的数据
clearList(state) {
return { ...state, sourceData: [] };
},
getPeopleDetailInfo(state, { payload }) {
return {
...state,
detailData: payload,
};
},
setdetailData(state, { payload: { peopleName, idcard, birthDay, people, sex, addr, photoUri } }) {
const detailData = {
xingMing: peopleName,
identityCard: idcard,
birthday: birthDay,
minZu: people,
xingBie: sex,
huJiDiZhi: addr,
photoUri,
};
return { ...state, detailData };
},
setPeopleList(state, { payload: { arrayData } }) {
const newSourceData = unionBy(state.sourceData, arrayData, 'id');
return { ...state, sourceData: newSourceData };
},
setMetas(state, { payload }) {
return { ...state, metas: payload };
},
setDSRList(state, { payload }) {
return {
...state,
sourceData: payload,
};
},
setEdit(state, { payload }) {
return {
...state,
editable: payload,
};
},
setDisabled(state, { payload }) {
return {
...state,
disabled: payload,
};
},
setTypes(state, { payload }) {
return {
...state,
types: payload,
};
},
setSearchValue(state, { payload }) {
return {
...state,
searchValue: payload,
};
},
},
};
/**
* Created by zhouhuan on 2017/10/30.
*/
import { Toast } from 'antd-mobile';
import { unionBy } from 'lodash';
import { NavigationActions } from 'react-navigation';
import { getData, getMeta } from '../../utils/DataTemplate';
import { datasourceApi } from '../../services/datasource';
import { scan } from '../../services/idcard';
import { createOperations, editResource, uploadResource } from '../../services/resource';
import { currentDomain } from '../../services/domain';
import { processError } from '../../utils/error';
export default {
namespace: 'peopleInfo',
state: {
sourceData: [],
metas: [],
detailData: {},
editable: false,
disabled: true,
types: '',
peopleID: '',
searchValue: '',
},
effects: {
*jumpPage({ payload: id }, { put }) {
yield put({ type: 'setPeopPleID', payload: id });
yield put(NavigationActions.navigate({
routeName: 'peopleInfoDetail',
params: { id },
}));
},
*getPeopleInfo({ payload }, { put, call, select, take }) {
const { clear, pxingMing } = payload;
if (clear === 'clear') {
yield put({ type: 'clearList', payload: {} });
}
const { sourceData } = yield select(state => state.peopleInfo);
const size = sourceData.length;
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKTable',
};
try {
const result = yield call(getData, coordinate, { pst: size, psz: 10, params: { pxingMing } });
const meta = yield call(getMeta, coordinate);
yield put({ type: 'setMetas', payload: meta });
for (const row of result) {
yield put({ type: 'addPeople', payload: row });
yield take('addPeople/@@end');
}
} catch (err) {
}
},
*addPeople({ payload }, { put }) {
yield put({ type: 'setPeopleList', payload: { arrayData: [payload] } });
},
*getPeopleDetail({ payload }, { put, call }) {
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKDetails',
};
const result = yield call(getData, coordinate, { params: { pID: payload } });
yield put({ type: 'getPeopleDetailInfo', payload: { ...result[0] } });
yield put({ type: 'setEdit', payload: false });
},
*savePeopleInfo({ payload }, { put, select, call }) {
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKDetails',
};
const api = datasourceApi(coordinate);
const result = yield call(api.create, payload);
const { detailData } = yield select(state => state.peopleInfo);
if (result === null) {
Toast.fail('信息重复!', 2);
} else {
try {
yield call(uploadResource, detailData.photoUri, () => {}, (uploadId, uri) => {
currentDomain().then(({ path }) => {
const operations = createOperations()
.setName(detailData.identityCard)
.setTags('身份证头像')
.use(`rel://${path}/DangShiRenRenKouXinXi/${result}`);
return editResource(uri, operations);
}).catch(err => console.info(err));
});
} catch (e) {
processError(e);
}
Toast.success('录入成功!', 1);
}
yield put(NavigationActions.navigate({
routeName: 'peopleInfoList',
}));
},
*addPeopleInfo(ignore, { put }) {
yield put({ type: 'getPeopleDetailInfo', payload: {} });
yield put(NavigationActions.navigate({
routeName: 'addPeoppleInfo',
}));
},
*GoToPeopleDetailEditScreen({ payload: id }, { put }) {
yield put({ type: 'setPeopPleID', payload: id });
yield put(NavigationActions.navigate({
routeName: 'peopleInfoDetailEdit',
}));
},
*updateDSRDetail({ payload }, { call, put }) {
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKDetails',
};
const api = datasourceApi(coordinate);
yield call(api.update, payload.id, payload.singularData);
Toast.success('修改成功!', 0.5);
yield put(NavigationActions.navigate({
routeName: 'peopleInfoList',
}));
yield put({ type: 'getPeopleInfo', payload: 'clear' });
yield put({ type: 'setDisabled', payload: true });
},
*onEBack({ payload }, { put, call, select, take }) {
if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} });
}
const coordinate = {
containerType: 'module',
containerName: 'query-RKInfo',
datasourceName: 'QueryRKTable',
};
const { sourceData } = yield select(state => state.peopleInfo);
const size = sourceData.length;
const result = yield call(getData, coordinate, { pst: size, psz: 10 });
const meta = yield call(getMeta, coordinate);
yield put({ type: 'setMetas', payload: meta });
for (const row of result) {
yield put({ type: 'addPeople', payload: row });
yield take('addPeople/@@end');
}
yield put(NavigationActions.navigate({
routeName: 'peopleInfoList',
}));
yield put({ type: 'setDisabled', payload: true });
},
*DuKa(ignored, { call, put }) {
try {
Toast.loading('读卡中...', 0);
const result = yield call(scan);
console.info(result);
if (result) {
yield put({ type: 'setdetailData', payload: result });
}
Toast.loading('读卡完成...', 2);
} catch (e) {
Toast.loading('读卡失败', 10);
}
//
},
},
reducers: {
setPeopPleID(state, { payload }) {
return {
...state,
peopleID: payload,
};
},
// 下拉刷新用到的,清空列表的数据
clearList(state) {
return { ...state, sourceData: [] };
},
getPeopleDetailInfo(state, { payload }) {
return {
...state,
detailData: payload,
};
},
setdetailData(state, { payload: { peopleName, idcard, birthDay, people, sex, addr, photoUri } }) {
const detailData = {
xingMing: peopleName,
identityCard: idcard,
birthday: birthDay,
minZu: people,
xingBie: sex,
huJiDiZhi: addr,
photoUri,
};
return { ...state, detailData };
},
setPeopleList(state, { payload: { arrayData } }) {
const newSourceData = unionBy(state.sourceData, arrayData, 'id');
return { ...state, sourceData: newSourceData };
},
setMetas(state, { payload }) {
return { ...state, metas: payload };
},
setDSRList(state, { payload }) {
return {
...state,
sourceData: payload,
};
},
setEdit(state, { payload }) {
return {
...state,
editable: payload,
};
},
setDisabled(state, { payload }) {
return {
...state,
disabled: payload,
};
},
setTypes(state, { payload }) {
return {
...state,
types: payload,
};
},
setSearchValue(state, { payload }) {
return {
...state,
searchValue: payload,
};
},
},
};
import { AsyncStorage } from 'react-native';
import { NavigationActions } from 'react-navigation';
// import codePush from 'react-native-code-push';
import { checkUpdate } from '../services/update';
import { update } from '../native/Updater';
import config from '../utils/config';
import { encrypt } from '../utils/helper';
import app from '../index';
export default {
namespace: 'welcome',
state: {
percent: 0,
},
reducers: {
setPercent(state, { payload }) {
return {
...state,
percent: payload.progress,
};
},
},
effects: {
*init(ignored, { put, call }) {
try {
// yield call(codePush.sync);
// const result = yield call(checkUpdate);
// const { action, deploymentInfo, tokenId } = result;
// if (action === 'update') {
// const token = encrypt(tokenId);
// // console.info(`${config.updateContextPath}/resource/${token}/${encodeURIComponent(deploymentInfo.uri)}`);
// console.log('开始');
// yield call(
// update, `${config.updateContextPath}/resource/${token}/${encodeURIComponent(deploymentInfo.uri)}`,
// (event) => {
// app.getStore().dispatch({ type: 'welcome/setPercent', payload: { progress: event.progress } });
// },
// );
// console.log('结束结束结束结束结束结束结束结束结束结束');
// }
} catch (e) {
console.log(e); // eslint-disable-line no-console
}
const token = yield call(AsyncStorage.getItem, 'token');
if (!token) {
yield put(NavigationActions.navigate({
routeName: 'Login',
}));
} else {
yield put(NavigationActions.navigate({
routeName: 'Main',
}));
}
},
},
};
import { AsyncStorage } from 'react-native';
import { NavigationActions } from 'react-navigation';
// import codePush from 'react-native-code-push';
import { checkUpdate } from '../services/update';
import { update } from '../native/Updater';
import config from '../utils/config';
import { encrypt } from '../utils/helper';
import app from '../index';
export default {
namespace: 'welcome',
state: {
percent: 0,
promptText: '',
},
reducers: {
setPercent(state, { payload }) {
return {
...state,
percent: payload.progress,
};
},
setPromptText(state, { payload }) {
return {
...state,
promptText: payload.promptText,
};
},
},
effects: {
*init(ignored, { put, call }) {
try {
// yield call(codePush.sync);
const result = yield call(checkUpdate);
console.info(result);
const { action, deploymentInfo, tokenId } = result;
if (action === 'update' || action === 'rollback') {
yield put({ type: 'setPromptText', payload: { promptText: `${action === 'update' ? '更新中...' : '回滚中'}` } });
const token = encrypt(tokenId);
yield call(
update, `${config.updateContextPath}/resource/${token}/${encodeURIComponent(deploymentInfo.uri)}`,
(event) => {
app.getStore().dispatch({ type: 'welcome/setPercent', payload: { progress: event.progress } });
},
);
}
} catch (e) {
console.log(e); // eslint-disable-line no-console
}
const token = yield call(AsyncStorage.getItem, 'token');
if (!token) {
yield put(NavigationActions.navigate({
routeName: 'Login',
}));
} else {
yield put(NavigationActions.navigate({
routeName: 'Main',
}));
}
},
},
};
/** @module native/Updater */
import { NativeModules, DeviceEventEmitter } from 'react-native';
const { Updater } = NativeModules;
/**
* @typedef {Object} UpdateEvent 下载事件
* @property {string} status 事件类型,downloading或downloaded
* @property {number} progress 下载进度,0到100的整数
* @property {number} current 已下载字节数
* @property {number} all 总字节数
*/
/**
* @callback UpdateCallback 下载回调
* @param {UpdateEvent} event 下载事件
*/
/**
* 下载更新包并自动安装, 下载过程中会发送Updater/downloading事件,下载完成时会发送Updater/downloaded事件
* @param {string} url 更新地址
* @param {UpdateCallback} cb 下载回调
* @returns {Promise.<void>}
*/
export const update = async (url, cb) => {
let handle1;
let handle2;
if (cb) {
handle1 = DeviceEventEmitter.addListener('Updater/downloading', (event) => {
cb({
...event,
status: 'downloading',
});
});
handle2 = DeviceEventEmitter.addListener('Updater/downloaded', (event) => {
cb({
...event,
status: 'downloaded',
});
});
}
await Updater.update(url);
if (handle1) {
handle1.remove();
}
if (handle2) {
handle2.remove();
}
};
/**
* 取消当前更新进程
* @returns {Promise.<void>}
*/
export const cancel = async () => {
return Updater.cancel();
};
/** @module native/Updater */
import { NativeModules, DeviceEventEmitter } from 'react-native';
const { Updater } = NativeModules;
/**
* @typedef {Object} UpdateEvent 下载事件
* @property {string} status 事件类型,downloading或downloaded
* @property {number} progress 下载进度,0到100的整数
* @property {number} current 已下载字节数
* @property {number} all 总字节数
*/
/**
* @callback UpdateCallback 下载回调
* @param {UpdateEvent} event 下载事件
*/
/**
* 下载更新包并自动安装, 下载过程中会发送Updater/downloading事件,下载完成时会发送Updater/downloaded事件
* @param {string} url 更新地址
* @param {UpdateCallback} cb 下载回调
* @returns {Promise.<void>}
*/
export const update = async (url, cb) => {
let handle1;
let handle2;
if (cb) {
handle1 = DeviceEventEmitter.addListener('Updater/downloading', (event) => {
cb({
...event,
status: 'downloading',
});
});
handle2 = DeviceEventEmitter.addListener('Updater/downloaded', (event) => {
cb({
...event,
status: 'downloaded',
});
});
}
console.info(Updater);
await Updater.update(url);
if (handle1) {
handle1.remove();
}
if (handle2) {
handle2.remove();
}
};
/**
* 取消当前更新进程
* @returns {Promise.<void>}
*/
export const cancel = async () => {
return Updater.cancel();
};
/**
* Created by zhouhuan on 2017/10/30.
*/
import React from 'react';
import { createForm } from 'rc-form';
import { View, ScrollView } from 'react-native';
import { List, InputItem, Toast, WhiteSpace, WingBlank } from 'antd-mobile';
import Icon from 'react-native-vector-icons/FontAwesome';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
@connect(({ DSRInfoDetail }) => ({ DSRInfoDetail }))
class DSRInfoDetailScreen extends React.Component {
componentDidMount() {
const { id } = this.props.navigation.state.params;
this.props.dispatch(createAction('DSRInfoDetail/getDSRInfoDetail')(id));
}
onEdit =() => {
// this.props.dispatch(createAction('DSRInfoDetail/setEnable')(true));
this.props.navigation.navigate('CameraPhoto', { pID: this.props.navigation.state.params, TableName: 'DangShiRenInfo' });
};
onSubmit = () => {
this.props.form.validateFields({ force: true }, (error, value) => {
if (!error) {
this.props.dispatch(createAction('DSRInfoDetail/updateDSRInfoDetail')({ id: this.props.DSRInfoDetail.DSRID, singularData: value }));
} else {
Toast.show('Validation failed');
}
});
};
goToViewPage =() => {
// this.props.dispatch(createAction('DSRInfoDetail/setEnable')(true));
this.props.navigation.navigate('DSRInfoFileView', { usage: `rel://DangShiRenInfo/${this.props.navigation.state.params.id}` });
};
validateNoNull = (rule, value, callback) => {
if (value) {
callback();
} else {
callback(new Error('At least four charactors for account'));
}
};
render() {
const { singularData, metas, enableEdit } = this.props.DSRInfoDetail;
const { getFieldProps } = this.props.form;
if (this.props.DSRInfoDetail.enableEdit === true) {
return (
<ScrollView>
<WhiteSpace />
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Icon.Button
name="id-card"
backgroundColor="#08BBF9"
onPress={() => {
this.props.dispatch({ type: 'DSRInfoDetail/DuKa' });
}}
>
读卡
</Icon.Button>
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
if (m.required === true) {
return (
<InputItem
{...getFieldProps(m.key, {
initialValue: singularData[m.key],
rules: [
{ required: true, message: '不允许为空' },
{ validator: this.validateNoNull },
],
})}
clear
placeholder="请输入"
editable={enableEdit}
ref={(el) => {
this.customFocusInst = el;
}}
>
姓名
</InputItem>
);
} else {
return (
<InputItem
{...getFieldProps(m.key, {
initialValue: singularData[m.key],
})}
clear
placeholder="请输入"
editable={enableEdit}
ref={(el) => {
this.customFocusInst = el;
}}
>
{m.label}
</InputItem>
);
}
})}
{[1].map(() => {
return (
<List.Item>
<View style={{ flexDirection: 'row', justifyContent: 'center' }}>
<Icon.Button
name="save"
backgroundColor="#08BBF9"
onPress={this.onSubmit}
>
保存
</Icon.Button>
</View>
</List.Item>
);
})
}
</List>
</ScrollView>
);
} else {
return (
<ScrollView>
<WhiteSpace />
<WhiteSpace />
<WingBlank>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Icon.Button
name="edit"
backgroundColor="#08BBF9"
onPress={this.onEdit}
>
资料上传
</Icon.Button>
<Icon.Button
name="eye"
backgroundColor="#08BBF9"
onPress={this.goToViewPage}
>
资料查看
</Icon.Button>
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
return (
<List.Item
key={m.key}
extra={singularData[m.key]}
wrap
>
{m.label}
</List.Item>
);
})
}
</List>
</WingBlank>
</ScrollView>
);
}
}
}
export default createForm()(DSRInfoDetailScreen);
/**
* Created by zhouhuan on 2017/10/30.
*/
import React from 'react';
import { createForm } from 'rc-form';
import { View, ScrollView } from 'react-native';
import { List, InputItem, Toast, WhiteSpace, WingBlank } from 'antd-mobile';
import Icon from 'react-native-vector-icons/FontAwesome';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
import { currentDomain } from '../../../services/domain';
@connect(({ DSRInfoDetail }) => ({ DSRInfoDetail }))
class DSRInfoDetailScreen extends React.Component {
componentDidMount() {
const { id } = this.props.navigation.state.params;
this.props.dispatch(createAction('DSRInfoDetail/getDSRInfoDetail')(id));
}
onEdit =() => {
// this.props.dispatch(createAction('DSRInfoDetail/setEnable')(true));
this.props.navigation.navigate('CameraPhoto', { pID: this.props.navigation.state.params.id, tableName: 'DangShiRenInfo' });
};
onSubmit = () => {
this.props.form.validateFields({ force: true }, (error, value) => {
if (!error) {
this.props.dispatch(createAction('DSRInfoDetail/updateDSRInfoDetail')({ id: this.props.DSRInfoDetail.DSRID, singularData: value }));
} else {
Toast.show('Validation failed');
}
});
};
goToViewPage =() => {
currentDomain()
.then((result) => {
console.info(result);
console.info(`rel://${result.path}/DangShiRenInfo/${this.props.navigation.state.params.id}`);
this.props.navigation.navigate('DSRInfoFileView', { usage: `rel://${result.path}/DangShiRenInfo/${this.props.navigation.state.params.id}` });
})
.catch(err => console.info(err));
// this.props.dispatch(createAction('DSRInfoDetail/setEnable')(true));
};
validateNoNull = (rule, value, callback) => {
if (value) {
callback();
} else {
callback(new Error('At least four charactors for account'));
}
};
render() {
const { singularData, metas, enableEdit } = this.props.DSRInfoDetail;
const { getFieldProps } = this.props.form;
if (this.props.DSRInfoDetail.enableEdit === true) {
return (
<ScrollView>
<WhiteSpace />
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Icon.Button
name="id-card"
backgroundColor="#08BBF9"
onPress={() => {
this.props.dispatch({ type: 'DSRInfoDetail/DuKa' });
}}
>
读卡
</Icon.Button>
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
if (m.required === true) {
return (
<InputItem
{...getFieldProps(m.key, {
initialValue: singularData[m.key],
rules: [
{ required: true, message: '不允许为空' },
{ validator: this.validateNoNull },
],
})}
clear
placeholder="请输入"
editable={enableEdit}
ref={(el) => {
this.customFocusInst = el;
}}
>
姓名
</InputItem>
);
} else {
return (
<InputItem
{...getFieldProps(m.key, {
initialValue: singularData[m.key],
})}
clear
placeholder="请输入"
editable={enableEdit}
ref={(el) => {
this.customFocusInst = el;
}}
>
{m.label}
</InputItem>
);
}
})}
{[1].map(() => {
return (
<List.Item>
<View style={{ flexDirection: 'row', justifyContent: 'center' }}>
<Icon.Button
name="save"
backgroundColor="#08BBF9"
onPress={this.onSubmit}
>
保存
</Icon.Button>
</View>
</List.Item>
);
})
}
</List>
</ScrollView>
);
} else {
return (
<ScrollView>
<WhiteSpace />
<WhiteSpace />
<WingBlank>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Icon.Button
name="edit"
backgroundColor="#08BBF9"
onPress={this.onEdit}
>
资料上传
</Icon.Button>
<Icon.Button
name="eye"
backgroundColor="#08BBF9"
onPress={this.goToViewPage}
>
资料查看
</Icon.Button>
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
return (
<List.Item
key={m.key}
extra={singularData[m.key]}
wrap
>
{m.label}
</List.Item>
);
})
}
</List>
</WingBlank>
</ScrollView>
);
}
}
}
export default createForm()(DSRInfoDetailScreen);
/**
* Created by zhouhuan on 2017/11/3.
*/
import { StackNavigator } from 'react-navigation';
import PeopleInfo from './peopelInfo';
import PeopleDetailInfo from './peopleDetailInfo';
import AddPeopleInfo from './addPeopleInfo';
import peopleDetailEditScreen from "./peopleDetailEditScreen";
const peopleInfoErJiScreen = StackNavigator(
{
peopleInfoList: {
screen: PeopleInfo,
},
peopleInfoDetail: {
screen: PeopleDetailInfo,
},
addPeoppleInfo: {
screen: AddPeopleInfo,
},
peopleInfoDetailEdit: {
screen: peopleDetailEditScreen,
},
},
{
headerMode: 'none',
navigationOptions: {
gesturesEnabled: false,
},
},
);
export default peopleInfoErJiScreen;
/**
* Created by zhouhuan on 2017/11/3.
*/
import { StackNavigator } from 'react-navigation';
import PeopleInfo from './peopelInfo';
import PeopleDetailInfo from './peopleDetailInfo';
import AddPeopleInfo from './addPeopleInfo';
import peopleDetailEditScreen from './peopleDetailEditScreen';
import FileViewList from '../dangshireninfo/fileViewList';
const peopleInfoErJiScreen = StackNavigator(
{
peopleInfoList: {
screen: PeopleInfo,
},
peopleInfoDetail: {
screen: PeopleDetailInfo,
},
addPeoppleInfo: {
screen: AddPeopleInfo,
},
peopleInfoDetailEdit: {
screen: peopleDetailEditScreen,
},
peopleInfoFileView: {
screen: FileViewList,
},
},
{
headerMode: 'none',
navigationOptions: {
gesturesEnabled: false,
},
},
);
export default peopleInfoErJiScreen;
/**
* Created by zhouhuan on 2017/11/2.
*/
import React from 'react';
import { View, ScrollView } from 'react-native';
import { List, InputItem, WhiteSpace, WingBlank } from 'antd-mobile';
import { connect } from 'react-redux';
import Icon from 'react-native-vector-icons/FontAwesome';
import { createAction } from '../../../utils';
@connect(({ peopleInfo }) => ({ peopleInfo }))
class PeopleDetailInfo extends React.Component {
componentDidMount() {
const { id } = this.props.navigation.state.params;
this.props.dispatch(createAction('peopleInfo/getPeopleDetail')(id));
}
onEdit =() => {
const { id } = this.props.navigation.state.params;
this.props.dispatch(createAction('peopleInfo/GoToPeopleDetailEditScreen')(id));
};
render() {
const { detailData, metas } = this.props.peopleInfo;
return (
<ScrollView>
<WhiteSpace />
<WhiteSpace />
<WingBlank>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
{/* <Icon.Button
name="edit"
backgroundColor="#08BBF9"
onPress={this.onEdit}
>
编辑
</Icon.Button> */}
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
return (
<List.Item
key={m.key}
extra={detailData[m.key]}
wrap
>
{m.label}
</List.Item>
);
})
}
</List>
</WingBlank>
</ScrollView>
);
}
}
export default PeopleDetailInfo;
/**
* Created by zhouhuan on 2017/11/2.
*/
import React from 'react';
import { View, ScrollView } from 'react-native';
import { List, WhiteSpace, WingBlank } from 'antd-mobile';
import { connect } from 'react-redux';
import Icon from 'react-native-vector-icons/FontAwesome';
import { createAction } from '../../../utils';
import { currentDomain } from '../../../services/domain';
@connect(({ peopleInfo }) => ({ peopleInfo }))
class PeopleDetailInfo extends React.Component {
componentDidMount() {
const { id } = this.props.navigation.state.params;
this.props.dispatch(createAction('peopleInfo/getPeopleDetail')(id));
}
onEdit =() => {
const { id } = this.props.navigation.state.params;
this.props.dispatch(createAction('peopleInfo/GoToPeopleDetailEditScreen')(id));
};
goToViewPage =() => {
currentDomain()
.then((result) => {
this.props.navigation.navigate('peopleInfoFileView', { usage: `rel://${result.path}/DangShiRenRenKouXinXi/${this.props.navigation.state.params.id}` });
})
.catch(err => console.info(err));
// this.props.dispatch(createAction('DSRInfoDetail/setEnable')(true));
};
render() {
const { detailData, metas } = this.props.peopleInfo;
return (
<ScrollView>
<WhiteSpace />
<WhiteSpace />
<WingBlank>
<View style={{ flexDirection: 'row', justifyContent: 'flex-end' }}>
<Icon.Button
name="eye"
backgroundColor="#08BBF9"
onPress={this.goToViewPage}
>
资料查看
</Icon.Button>
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
return (
<List.Item
key={m.key}
extra={detailData[m.key]}
wrap
>
{m.label}
</List.Item>
);
})
}
</List>
</WingBlank>
</ScrollView>
);
}
}
export default PeopleDetailInfo;
import React, { Component } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import { connect } from 'react-redux';
import SplashScreen from 'react-native-splash-screen';
import { createAction } from '../utils/index';
import PercentageCircle from '../components/roundProgressBarComponent';
@connect(({ welcome }) => ({ welcome }))
class WelcomeScreen extends Component {
componentDidMount() {
const { dispatch } = this.props;
dispatch(createAction('welcome/init')());
SplashScreen.hide();// 隐藏启动平
}
// 待改进,改成启动页,目前因为时间和技术的问题,搁置。wq write
render() {
return (
<View style={styles.container}>
<Text>wlecome</Text>
<View>
<PercentageCircle radius={60} percent={this.props.welcome.percent} color="#3498db" />
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#ffffff',
},
img: {
flex: 1,
width: 400,
height: 200,
resizeMode: 'contain',
},
});
export default WelcomeScreen;
import React, { Component } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import { connect } from 'react-redux';
import SplashScreen from 'react-native-splash-screen';
import { createAction } from '../utils/index';
import PercentageCircle from '../components/roundProgressBarComponent';
@connect(({ welcome }) => ({ welcome }))
class WelcomeScreen extends Component {
componentDidMount() {
const { dispatch } = this.props;
dispatch(createAction('welcome/init')());
SplashScreen.hide();// 隐藏启动平
}
IsUpdate = () => {
if (this.props.welcome.promptText !== '') {
return <PercentageCircle radius={60} percent={this.props.welcome.percent} color="#3498db" />;
}
};
// 待改进,改成启动页,目前因为时间和技术的问题,搁置。wq write
render() {
return (
<View style={styles.container}>
<Text>{this.props.welcome.promptText === '' ? 'welcome' : this.props.welcome.promptText}</Text>
<View>
{
this.IsUpdate()
}
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#ffffff',
},
img: {
flex: 1,
width: 400,
height: 200,
resizeMode: 'contain',
},
});
export default WelcomeScreen;
/* eslint-disable no-undef */
/**
* Created by yaohx_169 on 2017/6/6.
*/
export const cookie = {
token: 'token',
userId: 'userId',
userName: 'userName',
domainPath: 'domainPath',
domainName: 'domainName',
};
export const errors = {
exception: 0x00010000,
no_such_user: 0x00010001,
invalid_token: 0x00010003,
// client error:
token_missing: 0x00000001,
wrong_password: 0x00000002,
unsupported_auth_type: 0x00000003,
};
const defaultDateFormat = 'YYYY-MM-DD';
const defaultTimeFormat = 'HH:mm:ss';
const defaultDateTimeFormat = `${defaultDateFormat} ${defaultTimeFormat}`;
const config = {
name: 'Jbpm Demo',
productId: 'manager-app-sz',
footerText: '上海铂蓝信息科技有限公司',
contextPath: '',
updateContextPath: 'http://192.168.1.22:8080/app',
// apiContextPath: 'http://14.21.68.149:9089/test',
apiContextPath: 'http://192.168.1.22:8080/sz',
defaultDateFormat,
defaultTimeFormat,
defaultDateTimeFormat,
pubKey: '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+/Rs6dYmdtETjHCZq4LF3QjLM/DocRAXrqtMULZf+579dAn+CiM8noLplZT/DRwvfK822eq8sypH+a4NqP7942pPVjOudVvKfiJvmm2TOQHvQ7vi3iyZVdlsxX72JNFo1Ocqwj48aIC/OJ4bMf/VyCKrmKrU2iXND+I4BN8cfhwIDAQAB-----END PUBLIC KEY-----',
};
export default config;
/* eslint-disable no-undef */
/**
* Created by yaohx_169 on 2017/6/6.
*/
export const cookie = {
token: 'token',
userId: 'userId',
userName: 'userName',
domainPath: 'domainPath',
domainName: 'domainName',
};
export const errors = {
exception: 0x00010000,
no_such_user: 0x00010001,
invalid_token: 0x00010003,
// client error:
token_missing: 0x00000001,
wrong_password: 0x00000002,
unsupported_auth_type: 0x00000003,
};
const defaultDateFormat = 'YYYY-MM-DD';
const defaultTimeFormat = 'HH:mm:ss';
const defaultDateTimeFormat = `${defaultDateFormat} ${defaultTimeFormat}`;
const config = {
name: 'Jbpm Demo',
productId: 'manager-app-sz',
footerText: '上海铂蓝信息科技有限公司',
contextPath: '',
updateContextPath: 'http://14.21.68.149:9088/app',
apiContextPath: 'http://14.21.68.149:9087/sz01',
// updateContextPath: 'http://192.168.1.22:8080/app',
// apiContextPath: 'http://192.168.1.22:8080/sz',
defaultDateFormat,
defaultTimeFormat,
defaultDateTimeFormat,
pubKey: '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+/Rs6dYmdtETjHCZq4LF3QjLM/DocRAXrqtMULZf+579dAn+CiM8noLplZT/DRwvfK822eq8sypH+a4NqP7942pPVjOudVvKfiJvmm2TOQHvQ7vi3iyZVdlsxX72JNFo1Ocqwj48aIC/OJ4bMf/VyCKrmKrU2iXND+I4BN8cfhwIDAQAB-----END PUBLIC KEY-----',
};
export default config;
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论