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

添加了身份证读卡

上级 372c8572
......@@ -2,6 +2,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: 'DSRInfoDetail',
......@@ -15,6 +16,13 @@ export default {
setList(state, { payload }) {
return { ...state, singularData: payload.singularData };
},
setSingularData(state, { payload }) {
const { singularData } = state;
if (singularData.dangShiRenXingMing !== undefined) {
singularData.dangShiRenXingMing = payload.peopleName;
}
return { ...state, singularData };
},
setEnable(state, { payload: enableEdit }) {
return { ...state, enableEdit };
},
......@@ -56,5 +64,18 @@ export default {
}));
yield put({ type: 'setEnable', payload: false });
},
*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);
}
//
},
},
};
......@@ -47,7 +47,6 @@ export default {
const result = yield call(getData, coordinate, { pst: size, psz: 10 });
const meta = yield call(getMeta, coordinate);
yield put({ type: 'setMetas', payload: meta });
// const result = yield call('', 'query-DSRFWInfo', 'QueryfwTable', { pst: size, psz: 10 });
for (const row of result) {
yield put({ type: 'addHouse', payload: row });
yield take('addHouse/@@end');
......
import { NavigationActions } from 'react-navigation';
import { getData, getMeta } from '../../utils/DataTemplate';
export default {
namespace: 'userInfo',
......@@ -9,12 +6,19 @@ 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,
......
......@@ -7,7 +7,6 @@ import { View, ScrollView } from 'react-native';
import { List, InputItem, Button, Toast } from 'antd-mobile';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
import {scan} from "../../../services/idcard";
@connect(({ DSRInfoDetail }) => ({ DSRInfoDetail }))
class DSRInfoDetailScreen extends React.Component {
......@@ -39,9 +38,6 @@ class DSRInfoDetailScreen extends React.Component {
const { getFieldProps } = this.props.form;
return (
<ScrollView>
<Button onClick={() => {
scan().then(res => console.log(res)).catch(err => console.error(err));
}}></Button>
<List>
{
metas.map((m) => {
......@@ -83,6 +79,9 @@ class DSRInfoDetailScreen extends React.Component {
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>
......
import React, { Component } from 'react';
import { Text, FlatList } from 'react-native';
import { Card, WingBlank, WhiteSpace } from 'antd-mobile';
import { WingBlank, WhiteSpace } from 'antd-mobile';
import { connect } from 'react-redux';
import { createAction } from '../../../utils/index';
import FlatListItem from '../houseinfo/FlatListItem';
......@@ -16,7 +16,6 @@ class DSRInfoScreeen extends Component {
onEndReached = () => {
// 以下是制造新数据
if (!this.props.loading) {
console.log('上啦加载')
this.props.dispatch(createAction('DSRInfo/getDSRList')());
}
};
......@@ -41,11 +40,7 @@ class DSRInfoScreeen extends Component {
renderFooter = () => (
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Body>
<Text>到底了!!!</Text>
</Card.Body>
</Card>
<Text>到底了!!!</Text>
<WhiteSpace size="lg" />
</WingBlank>
);
......@@ -53,11 +48,7 @@ class DSRInfoScreeen extends Component {
renderEmptyView = () => (
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Card>
<Card.Body>
<Text>当前无内容</Text>
</Card.Body>
</Card>
<Text>当前无内容</Text>
<WhiteSpace size="lg" />
</WingBlank>
);
......
import React, { PureComponent } from 'react';
import { View, StyleSheet, RefreshControl, Dimensions, ScrollView, Text } from 'react-native';
import { View, StyleSheet, Dimensions, ScrollView, Text, Picker } from 'react-native';
import { connect } from 'react-redux';
import { List, InputItem } from 'antd-mobile';
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
// create a component
@connect(({ userInfo }) => ({ userInfo }))
class UserInfoHomeScreen extends PureComponent {
renderHeader=() => {
return (
<View style={styles.header}>
<View style={styles.userContainer}>
<Text style={styles.avatar} />
<View>
<View style={{ flexDirection: 'row' }}>
<Text style={{ color: 'white' }}>素敌</Text>
<Text style={{ marginLeft: 4 }} />
</View>
<Text style={{ color: 'white', marginTop: 4 }}>个人信息</Text>
</View>
</View>
</View>
);
};
render() {
return (
<View style={{ flex: 1, backgroundColor: '#06C1AE'}}>
<View style={{ flex: 1, backgroundColor: '#06C1AE' }}>
<View style={{ position: 'absolute', width, height, backgroundColor: '#06C1AE' }} />
<ScrollView
refreshControl={
<RefreshControl
refreshing={this.state.isRefreshing}
onRefresh={() => this.onHeaderRefresh()}
tintColor="gray"
/>
}
>
{this.renderHeader}
<ScrollView>
<View style={styles.header}>
<View style={styles.userContainer}>
<Text style={styles.avatar} />
<View>
<View style={{ flexDirection: 'row' }}>
<Text style={{ color: 'white' }}>素敌</Text>
<Text style={{ marginLeft: 4 }} />
</View>
<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>
</View>
</ScrollView>
</View>
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论