提交 01212947 authored 作者: 吴强's avatar 吴强

发布的第一版

上级 e6d8185d
import React, { PureComponent } from 'react';
import { View } from 'react-native';
import { WhiteSpace, List, Picker } from 'antd-mobile';
import { createAction } from '../utils/index';
class PickerComponent extends PureComponent {
onClick = () => {
this.props.dispatch(createAction('domain/fetch')());
};
onPickerChange = (val) => {
let colNum = 1;
const d = [...this.props.data];
const asyncValue = [...val];
if (val[0] !== undefined) {
d.forEach((i) => {
if (i.value === 'zj') {
colNum = 2;
if (!i.children) {
i.children = [{
value: 'zj-nb',
label: '宁波',
}, {
value: 'zj-hz',
label: '杭州',
}];
asyncValue.push('zj-nb');
} else if (val[1] === 'zj-hz') {
i.children.forEach((j) => {
if (j.value === 'zj-hz') {
j.children = [{
value: 'zj-hz-xh',
label: '西湖区',
}];
asyncValue.push('zj-hz-xh');
}
});
colNum = 3;
}
}
});
} else {
colNum = 1;
}
};
render() {
return (
<View>
<WhiteSpace size="lg" />
<List style={{ backgroundColor: 'white' }} className="picker-list">
<Picker
data={this.props.data}
cols={this.props.cols}
value={this.props.asyncValue}
onPickerChange={this.onPickerChange}
>
<List.Item arrow="horizontal" onClick={this.onClick}>当前基地</List.Item>
</Picker>
</List>
</View>
);
}
}
export default PickerComponent;
......@@ -21,6 +21,13 @@ export default {
if (singularData.dangShiRenXingMing !== undefined) {
singularData.dangShiRenXingMing = payload.peopleName;
}
if (singularData.dangShiRenIdentityCard !== undefined) {
singularData.dangShiRenIdentityCard = payload.idcard;
}
if (singularData.dangShiRenXingBie !== undefined) {
singularData.dangShiRenXingBie = payload.sex;
}
return { ...state, singularData };
},
setEnable(state, { payload: enableEdit }) {
......@@ -66,14 +73,13 @@ export default {
},
*DuKa(ignored, { call, put }) {
try {
Toast.loading('读卡中...', 0);
const result = yield call(scan);
if (result) {
yield put({ type: 'setSingularData', payload: result });
}
Toast.loading('读卡完成', 5);
} finally {
Toast.loading('读卡失败', 10);
} catch (e) {
console.log(e);
throw e;
}
//
},
......
......@@ -23,6 +23,14 @@ export default {
yield put({ type: 'queryInit', payload: init });
yield put({ type: 'queryList', payload: list });
},
*fetchParam(dmpath, { put, call }) {
const domain = yield call(getDomain);
const init = domain ? domain.path : undefined;
const list = yield call(fetchDomains, dmpath);
yield put({ type: 'queryInit', payload: init });
yield put({ type: 'queryList', payload: list });
},
*switch({ payload: domainPath }, { put, call }) {
yield call(switchDomain, domainPath);
const { path, name } = yield call(currentDomain);
......
......@@ -6,9 +6,11 @@ import obligeeInfo from './houseinfo/ObligeeInfo';
import DSRInfo from './dangshireninfo/dsrinfo';
import DSRInfoDetail from './dangshireninfo/dsrinfodetail';
import peopleInfo from './peopleInfo/peopleInfo';
import domain from './domain';
export default [
welcome,
domain,
login,
listHouse,
HouseDetail,
......
......@@ -5,6 +5,7 @@ import { Toast } from 'antd-mobile';
import { NavigationActions } from 'react-navigation';
import { getData, getMeta } from '../../utils/DataTemplate';
import { datasourceApi } from '../../services/datasource';
import { scan } from '../../services/idcard';
export default {
namespace: 'peopleInfo',
......@@ -129,6 +130,20 @@ export default {
yield put({ type: 'setDisabled', payload: false });
yield put({ type: 'setEdit', payload });
},
*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('读卡完成', 5);
} finally {
Toast.loading('读卡失败', 10);
}
//
},
},
reducers: {
setPeopPleID(state, { payload }) {
......@@ -147,6 +162,15 @@ export default {
detailData: payload,
};
},
setdetailData(state, { payload: { peopleName, idcard, birthDay, people } }) {
const detailData = {
xingMing: peopleName,
identityCard: idcard,
birthday: birthDay,
minZu: people,
};
return { ...state, detailData };
},
setPeopleList(state, { payload: { arrayData } }) {
return { ...state, sourceData: [...state.sourceData, ...arrayData] };
},
......
......@@ -6,19 +6,12 @@ export default {
userName: undefined,
currentJiDiName: undefined,
jidiList: [],
language: '',
},
subscriptions: {
setup({ dispatch }) { // eslint-disable-line
},
},
reducers: {
setlanguage(state, { payload: language }) {
return {
...state,
language,
};
},
setUserName(state, { payload: userName }) {
return {
...state,
......
......@@ -4,7 +4,8 @@
import React from 'react';
import { createForm } from 'rc-form';
import { View, ScrollView } from 'react-native';
import { List, InputItem, Button, Toast } from 'antd-mobile';
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';
......@@ -36,63 +37,113 @@ class DSRInfoDetailScreen extends React.Component {
render() {
const { singularData, metas, enableEdit } = this.props.DSRInfoDetail;
const { getFieldProps } = this.props.form;
return (
<ScrollView>
<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' }}>
<Button onClick={() => {
this.props.dispatch({ type: 'DSRInfoDetail/DuKa' });
}}></Button>
<Button style={{ marginRight: 8 }} type="primary" onClick={this.onEdit}>编辑</Button>
<Button style={{ marginRight: 8 }} onClick={this.onSubmit}>保存</Button>
</View>
</List.Item>
);
})
}
</List>
</ScrollView>
);
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 />
<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={singularData[m.key]}
>
{m.label}
</List.Item>
);
})
}
</List>
</ScrollView>
);
}
}
}
......
......@@ -39,7 +39,7 @@ class HouseDetail extends Component {
render() {
const { getFieldProps } = this.props.form;
const { fwLouCeng } = this.props.HouseDetail.singularData;
if (this.props.HouseDetail.enableEdit === false) {
if (this.props.HouseDetail.enableEdit === true) {
return (
<View>
<List>
......
import React, { Component } from 'react';
import { View, Text, Image, StyleSheet } from 'react-native';
import { TabNavigator } from 'react-navigation';
import Icon from 'react-native-vector-icons/MaterialIcons';
import userInfoPageScreen from './userinfo/index';
import fwInfo from './fwInfo';
import peopleInfoErJiScreen from './peopleInfo/index';
......@@ -17,10 +18,7 @@ const Content = TabNavigator({
tabBarLabel: '房屋信息',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: () => (
<Image
source={chatsIcon}
style={[styles.icon]}
/>
<Icon name="home" size={28} color="#3b5998" />
),
},
},
......@@ -31,10 +29,7 @@ const Content = TabNavigator({
tabBarLabel: '权利人信息',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: () => (
<Image
source={chatsIcon}
style={[styles.icon]}
/>
<Icon name="person" size={28} />
),
},
},
......@@ -66,20 +61,20 @@ const Content = TabNavigator({
),
},
},
UserInfoPageScreen: {
screen: userInfoPageScreen,
navigationOptions: {
lazy: true,
tabBarLabel: '个人中心',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: () => (
<Image
source={chatsIcon}
style={[styles.icon]}
/>
),
},
},
// UserInfoPageScreen: {
// screen: userInfoPageScreen,
// navigationOptions: {
// lazy: true,
// tabBarLabel: '个人中心',
// // Note: By default the icon is only shown on iOS. Search the showIcon option below.
// tabBarIcon: () => (
// <Image
// source={chatsIcon}
// style={[styles.icon]}
// />
// ),
// },
// },
}, {
lazy: true,
tabBarPosition: 'bottom',
......
......@@ -4,8 +4,9 @@
import React from 'react';
import { createForm } from 'rc-form';
import { View, ScrollView } from 'react-native';
import { Button, List, InputItem } from 'antd-mobile';
import { Button, List, InputItem, WhiteSpace } from 'antd-mobile';
import { connect } from 'react-redux';
import Icon from 'react-native-vector-icons/FontAwesome';
import { createAction } from '../../../utils';
@connect(({ peopleInfo }) => ({ peopleInfo }))
......@@ -23,114 +24,92 @@ class AddPeopleInfo extends React.Component {
}
});
};
validateNoNull = (rule, value, callback) => {
if (value) {
callback();
} else {
callback(new Error('At least four charactors for account'));
}
};
onEditBack = () => {
this.props.dispatch(createAction('peopleInfo/onEBack')('clear'));
};
render() {
console.log(this.props.peopleInfo);
const { getFieldProps } = this.props.form;
const { detailData, metas } = this.props.peopleInfo;
console.info(metas);
return (
<ScrollView>
<List>
<InputItem
{...getFieldProps('xingMing', {
rules: [
{ required: true, message: '不允许为空' },
],
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
姓名
</InputItem>
<InputItem
{...getFieldProps('identityCard', {
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
证件号码
</InputItem>
<InputItem
{...getFieldProps('birthday', {
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
出生日期
</InputItem>
<InputItem
{...getFieldProps('guoJi', {
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
国籍
</InputItem>
<InputItem
{...getFieldProps('minZu', {
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
<WhiteSpace />
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Icon.Button
name="id-card"
backgroundColor="#08BBF9"
onPress={() => {
this.props.dispatch({ type: 'peopleInfo/DuKa' });
}}
>
民族
</InputItem>
<InputItem
{...getFieldProps('lianXiDianHua', {
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
联系电话
</InputItem>
<InputItem
{...getFieldProps('lianXiDiZhi', {
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
联系地址
</InputItem>
<InputItem
{...getFieldProps('yuHuZhuGuanXi', {
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
与户主关系
</InputItem>
<InputItem
{...getFieldProps('zhengZhiMianMao', {
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
政治面貌
</InputItem>
<InputItem
{...getFieldProps('hunYinZhuangKuang', {
读卡
</Icon.Button>
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
if (m.required === true) {
return (
<InputItem
{...getFieldProps(m.key, {
initialValue: detailData[m.key],
rules: [
{ required: true, message: '不允许为空' },
{ validator: this.validateNoNull },
],
})}
clear
placeholder="请输入"
editable="true"
ref={(el) => {
this.customFocusInst = el;
}}
>
姓名
</InputItem>
);
} else {
return (
<InputItem
{...getFieldProps(m.key, {
initialValue: detailData[m.key],
})}
clear
placeholder="请输入"
editable="true"
ref={(el) => {
this.customFocusInst = el;
}}
>
{m.label}
</InputItem>
);
}
})}
clear
placeholder=""
ref={(el) => { this.customFocusInst = el; }}
>
婚姻状况
</InputItem>
<List.Item>
<View style={{ flexDirection: 'row' }}>
<Button style={{ marginRight: 8 }} type="primary" onClick={this.onSubmit}>保存</Button>
<Button onClick={this.onEditBack}>返回</Button>
</View>
</List.Item>
{[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>
);
......
import React, { PureComponent } from 'react';
import { View, StyleSheet, Dimensions, ScrollView, Text, Picker } from 'react-native';
import { View, StyleSheet, Dimensions, ScrollView, Text } from 'react-native';
import { connect } from 'react-redux';
import { List, InputItem } from 'antd-mobile';
import PickerComponent from '../../../components/pickerComponent';
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
......@@ -24,20 +25,7 @@ class UserInfoHomeScreen extends PureComponent {
<Text style={{ color: 'white', marginTop: 4 }}>个人信息</Text>
</View>
</View>
<List style={{ backgroundColor: 'white' }} className="picker-list">
<Picker
extra="请选择(可选)"
data={district}
title="Areas"
{...getFieldProps('district', {
initialValue: ['340000', '341500', '341502'],
})}
onOk={e => console.log('ok', e)}
onDismiss={e => console.log('dismiss', e)}
>
<List.Item arrow="horizontal">Multiple & cascader</List.Item>
</Picker>
</List>
<PickerComponent />
</View>
</ScrollView>
</View>
......
......@@ -39,7 +39,7 @@ const config = {
productId: 'manager-app-sz',
footerText: '上海铂蓝信息科技有限公司',
contextPath: '',
apiContextPath: 'http://192.168.1.22:8080/bm',
apiContextPath: 'http://14.21.68.149:9089/test',
defaultDateFormat,
defaultTimeFormat,
defaultDateTimeFormat,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论