提交 b55438df authored 作者: zhouhuan's avatar zhouhuan

权利人信息详情

上级 8aa630e1
...@@ -8,4 +8,5 @@ ...@@ -8,4 +8,5 @@
# For customization when using a Version Control System, please read the # For customization when using a Version Control System, please read the
# header note. # header note.
#Fri Oct 27 18:29:04 CST 2017 #Fri Oct 27 18:29:04 CST 2017
sdk.dir=D\:\\Android\\sdk sdk.dir=D\:\\AppData\\Local\\Android\\sdk1
# sdk.dir=D\:\\Android\\sdk
...@@ -6,36 +6,56 @@ import { getData } from '../../utils/DataTemplate'; ...@@ -6,36 +6,56 @@ import { getData } from '../../utils/DataTemplate';
export default { export default {
namespace: 'obligeeInfo', namespace: 'obligeeInfo',
state: { state: {
sourceData: [], sourceData: {},
detailData: {},
isDetail: false,
}, },
effects: { effects: {
*getObligeeInfo({ payload }, { take, put, call, select }) { *getObligeeInfo({ payload }, { put, call, select }) {
console.log('come on ~~');
if (payload === 'clear') { if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} }); yield put({ type: 'clearList', payload: {} });
} }
const { sourceData } = yield select(state => state.obligeeInfo); const { sourceData } = yield select(state => state.obligeeInfo);
console.log(sourceData);
const size = sourceData.length; const size = sourceData.length;
const coordinate = { const coordinate = {
containerType: 'module', containerType: 'module',
containerName: 'query-DSRInfo', containerName: 'query-DSRInfo',
datasourceName: 'QueryDSRInfoTable', datasourceName: 'QueryDSRInfoTable',
}; };
const result = yield call(getData, coordinate, { pst: size, psz: 10 }); const result = yield call(getData, coordinate, { pst: size, psz: 10, params: { pID: payload } });
console.log(result); const singularData = result[0];
for (const row of result) { yield put({ type: 'setDSRList', payload: { ...singularData } });
yield put({ type: 'addDSR', payload: row });
yield take('addDSR/@@end');
}
}, },
*addDSR({ payload }, { put }) { *getObligeeDetail({ payload }, { put, call, select }) {
yield put({ type: 'setDSRList', payload: { arrayData: [payload] } }); const coordinate = {
containerType: 'module',
containerName: 'query-DSRInfo',
datasourceName: 'QueryDSRInfoDetails',
};
const result = yield call(getData, coordinate, { params: { pID: payload } });
console.log(result);
yield put({ type: 'getDSRDetail', payload: { ...result[0] } });
yield put({ type: 'setDetail', payload: true });
}, },
}, },
reducers: { reducers: {
setDSRList(state, { payload: { arrayData } }) { getDSRDetail(state, { payload }) {
return { ...state, sourceData: [...state.sourceData, ...arrayData] }; return {
...state,
detailData: payload,
};
},
setDSRList(state, { payload }) {
return {
...state,
sourceData: payload,
};
},
setDetail(state, { payload }) {
return {
...state,
isDetail: payload,
};
}, },
}, },
}; };
......
import { NavigationActions } from 'react-navigation';
import { getData } from '../../utils/DataTemplate'; import { getData } from '../../utils/DataTemplate';
export default { export default {
namespace: 'ListHouse', namespace: 'ListHouse',
state: { state: {
sourceData: [], sourceData: [],
houseID: '',
}, },
reducers: { reducers: {
setHouseID(state, { payload }) {
return {
...state,
houseID: payload,
};
},
setList(state, { payload: { arrayData } }) { setList(state, { payload: { arrayData } }) {
return { ...state, sourceData: [...state.sourceData, ...arrayData] }; return { ...state, sourceData: [...state.sourceData, ...arrayData] };
}, },
...@@ -15,12 +23,17 @@ export default { ...@@ -15,12 +23,17 @@ export default {
}, },
}, },
effects: { effects: {
*jumpPage({ payload: id }, { put }) {
yield put({ type: 'setHouseID', payload: id });
yield put(NavigationActions.navigate({
routeName: 'HouseDetail',
}));
},
*getHouseList({ payload }, { take, put, call, select }) { *getHouseList({ payload }, { take, put, call, select }) {
if (payload === 'clear') { if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} }); yield put({ type: 'clearList', payload: {} });
} }
const { sourceData } = yield select(state => state.ListHouse); const { sourceData } = yield select(state => state.ListHouse);
console.info(sourceData);
const size = sourceData.length; const size = sourceData.length;
const coordinate = { const coordinate = {
containerType: 'module', containerType: 'module',
......
...@@ -5,18 +5,18 @@ import { createForm } from 'rc-form'; ...@@ -5,18 +5,18 @@ import { createForm } from 'rc-form';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { createAction } from '../../../utils/index'; import { createAction } from '../../../utils/index';
@connect(({ HouseDetail }) => ({ HouseDetail })) @connect(({ HouseDetail, ListHouse }) => ({ HouseDetail, ListHouse }))
class HouseDetail extends Component { class HouseDetail extends Component {
componentDidMount() { componentDidMount() {
const { dispatch, navigation } = this.props; const { dispatch, ListHouse } = this.props;
dispatch(createAction('HouseDetail/getHouseDetail')(navigation.state.params.id)); dispatch(createAction('HouseDetail/getHouseDetail')(ListHouse.houseID));
} }
onSubmit = () => { onSubmit = () => {
this.props.form.validateFields({ force: true }, (error, value) => { this.props.form.validateFields({ force: true }, (error, value) => {
if (!error) { if (!error) {
// 校验成功执行这里的代码 // 校验成功执行这里的代码
console.info({ id: this.props.navigation.state.params.id, singularData: value }); console.info({ id: this.props.navigation.state.params.id, singularData: value });
this.props.dispatch(createAction('HouseDetail/updateHouseDetail')({ id: this.props.navigation.state.params.id, singularData: value })); this.props.dispatch(createAction('HouseDetail/updateHouseDetail')({ id: this.props.ListHouse.houseID, singularData: value }));
console.log(this.props.form.getFieldsValue()); console.log(this.props.form.getFieldsValue());
} else { } else {
// 执行出现错误,弹出错处理 // 执行出现错误,弹出错处理
......
...@@ -2,98 +2,143 @@ ...@@ -2,98 +2,143 @@
* Created by zhouhuan on 2017/10/30. * Created by zhouhuan on 2017/10/30.
*/ */
import React from 'react'; import React from 'react';
import { createForm } from 'rc-form';
import { View, StyleSheet, FlatList, Text, ScrollView } from 'react-native'; import { View, StyleSheet, FlatList, Text, ScrollView } from 'react-native';
import { Card, WingBlank, WhiteSpace } from 'antd-mobile'; import { Card, WingBlank, WhiteSpace, Button, List, InputItem } from 'antd-mobile';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { createAction } from '../../../utils'; import { createAction } from '../../../utils';
@connect(({ obligeeInfo }) => ({ obligeeInfo })) @connect(({ obligeeInfo, ListHouse }) => ({ obligeeInfo, ListHouse }))
class ObligeeInfo extends React.Component { class ObligeeInfo extends React.Component {
componentDidMount() { componentDidMount() {
this.props.dispatch(createAction('obligeeInfo/getObligeeInfo')()); const { houseID } = this.props.ListHouse;
this.props.dispatch(createAction('obligeeInfo/getObligeeInfo')(houseID));
} }
onPress = () => {
const ID = this.props.obligeeInfo.sourceData.id;
this.props.dispatch(createAction('obligeeInfo/getObligeeDetail')(ID));
};
render() { render() {
const { sourceData } = this.props.obligeeInfo; const { sourceData, isDetail, detailData } = this.props.obligeeInfo;
console.log(sourceData); console.log(detailData);
return ( const { getFieldProps } = this.props.form;
<ScrollView > if (isDetail === false) {
<WingBlank size="lg"> return (
<WhiteSpace size="lg" /> <ScrollView >
<Card> <WingBlank size="lg">
<Card.Header <WhiteSpace size="lg" />
title="张三" <Card>
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>} <Card.Header
/> title={sourceData.dangShiRenXingMing}
<Card.Body> extra={<Text style={Styles.cardText} onPress={this.onPress}>&gt;&gt;详情</Text>}
<Text style={Styles.cardBodyText}>性别:<Text style={Styles.cardBodyText2}></Text></Text> />
<Text style={Styles.cardBodyText}>证件号码:<Text style={Styles.cardBodyText2}>350502199210236034</Text></Text> <Card.Body>
<Text style={Styles.cardBodyText}>与户主关系:<Text style={Styles.cardBodyText2}>户主</Text></Text> <Text style={Styles.cardBodyText}>当事人编号:<Text style={Styles.cardBodyText2}>{sourceData.dangShiRenBianHao}</Text></Text>
</Card.Body> <Text style={Styles.cardBodyText}>证件号码:<Text style={Styles.cardBodyText2}>{sourceData.dangShiRenIdentityCard}</Text></Text>
</Card> </Card.Body>
<WhiteSpace size="lg" /> </Card>
</WingBlank> <WhiteSpace size="lg" />
<WingBlank size="lg"> </WingBlank>
<WhiteSpace size="lg" /> </ScrollView >
<Card> );
<Card.Header } else {
title="张三" return (
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>} <ScrollView>
/> <List>
<Card.Body> <InputItem
<Text style={Styles.cardBodyText}>性别:</Text> {...getFieldProps('dangShiRenXingMing', {
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text> initialValue: detailData.dangShiRenXingMing,
<Text style={Styles.cardBodyText}>与户主关系:户主</Text> rules: [
</Card.Body> { required: true, message: '不允许为空' },
</Card> { validator: this.validateFWBianMa },
<WhiteSpace size="lg" /> ],
</WingBlank> })}
<WingBlank size="lg"> clear
<WhiteSpace size="lg" /> placeholder="请输入"
<Card> ref={(el) => { this.customFocusInst = el; }}
<Card.Header >
title="张三" 姓名
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>} </InputItem>
/> <InputItem
<Card.Body> {...getFieldProps('dangShiRenXingBie', {
<Text style={Styles.cardBodyText}>性别:</Text> initialValue: detailData.dangShiRenXingBie,
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text> })}
<Text style={Styles.cardBodyText}>与户主关系:户主</Text> clear
</Card.Body> placeholder="请输入"
</Card> ref={(el) => { this.customFocusInst = el; }}
<WhiteSpace size="lg" /> >
</WingBlank> 性别
<WingBlank size="lg"> </InputItem>
<WhiteSpace size="lg" /> <InputItem
<Card> {...getFieldProps('dangShiRenTelephone', {
<Card.Header initialValue: detailData.dangShiRenTelephone,
title="张三" })}
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>} clear
/> placeholder="请输入"
<Card.Body> ref={(el) => { this.customFocusInst = el; }}
<Text style={Styles.cardBodyText}>性别:</Text> >
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text> 电话号码
<Text style={Styles.cardBodyText}>与户主关系:户主</Text> </InputItem>
</Card.Body> <InputItem
</Card> {...getFieldProps('dangShiRenIdentityCard', {
<WhiteSpace size="lg" /> initialValue: detailData.dangShiRenIdentityCard,
</WingBlank> })}
<WingBlank size="lg"> clear
<WhiteSpace size="lg" /> placeholder="请输入"
<Card> ref={(el) => { this.customFocusInst = el; }}
<Card.Header >
title="张三" 身份证号码
extra={<Text style={Styles.cardText}>&gt;&gt;详情</Text>} </InputItem>
/> <InputItem
<Card.Body> {...getFieldProps('dangShiRenIdentityCardbak', {
<Text style={Styles.cardBodyText}>性别:</Text> initialValue: detailData.dangShiRenIdentityCardbak,
<Text style={Styles.cardBodyText}>证件号码:350502199210236034</Text> })}
<Text style={Styles.cardBodyText}>与户主关系:户主</Text> clear
</Card.Body> placeholder="请输入"
</Card> ref={(el) => { this.customFocusInst = el; }}
<WhiteSpace size="lg" /> >
</WingBlank> 身份证类型
</ScrollView > </InputItem>
); <InputItem
{...getFieldProps('dangShiRenAddress', {
initialValue: detailData.dangShiRenAddress,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
地址
</InputItem>
<InputItem
{...getFieldProps('DSRMaritalStatus', {
initialValue: detailData.DSRMaritalStatus,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
婚姻状态
</InputItem>
<InputItem
{...getFieldProps('DSRCensusType', {
initialValue: detailData.DSRCensusType,
})}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
是否原村民
</InputItem>
<List.Item>
<View style={{ flexDirection: 'row' }}>
<Button type="primary" onClick={this.onEdit}>编辑</Button>
<Button onClick={this.onReset}>返回</Button>
</View>
</List.Item>
</List>
</ScrollView>
);
}
} }
} }
const Styles = StyleSheet.create({ const Styles = StyleSheet.create({
...@@ -106,4 +151,4 @@ const Styles = StyleSheet.create({ ...@@ -106,4 +151,4 @@ const Styles = StyleSheet.create({
marginLeft: 13, marginLeft: 13,
}, },
}); });
export default ObligeeInfo; export default createForm()(ObligeeInfo);
...@@ -20,7 +20,8 @@ class ListHouContent extends Component { ...@@ -20,7 +20,8 @@ class ListHouContent extends Component {
} }
}; };
onPressItem = (id) => { onPressItem = (id) => {
this.props.navigation.navigate('HouseDetail', { id }); // this.props.navigation.navigate('HouseDetail', { id });
this.props.dispatch(createAction('ListHouse/jumpPage')(id));
}; };
getItemLayout = (data, index) => ( getItemLayout = (data, index) => (
{ length: 120, offset: (120 + 1) * index, index } { length: 120, offset: (120 + 1) * index, index }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论