提交 018d456c authored 作者: 吴强's avatar 吴强

fix bug

上级 6932cc9c
......@@ -9,8 +9,11 @@ class PickerComponent extends PureComponent {
onPickerChange = (val) => {
this.props.onPickerChange(val);
};
onOkButton = () => {
this.props.onOkButton();
};
render() {
const { data, pathVal, cols } = this.props;
const { data, pathVal } = this.props;
return (
<View>
<WhiteSpace size="lg" />
......@@ -20,7 +23,7 @@ class PickerComponent extends PureComponent {
cols={3}
value={pathVal}
onPickerChange={this.onPickerChange}
onOk={v => console.log(v)}
onOk={this.onOkButton}
>
<List.Item arrow="horizontal" onClick={this.onClick}>当前基地</List.Item>
</Picker>
......
/**
* Created by zhouhuan on 2017/10/30.
*/
import { getData, getMeta } from '../../utils/DataTemplate';
export default {
namespace: 'FWQuanShu',
state: {
detailData: {},
metas: [],
},
effects: {
*getFWQuanShuDetail({ payload }, { put, call }) {
const coordinate = {
containerType: 'module',
containerName: 'query-DSRFWQuanShu',
datasourceName: 'QueryfwqsDetailByID',
};
const result = yield call(getData, coordinate, { params: { pID: payload } });
yield put({ type: 'setFWQuanShuDetail', payload: { ...result[0] } });
const metas = yield call(getMeta, coordinate);
yield put({ type: 'setMetas', payload: metas });
},
},
reducers: {
setFWQuanShuDetail(state, { payload }) {
return {
...state,
detailData: payload,
};
},
setMetas(state, { payload }) {
return { ...state, metas: payload };
},
},
};
......@@ -10,6 +10,7 @@ import domain from './domain';
import userInfo from './userinfo/userinfo';
import QSInfo from './quanshuInfo/qsinfo';
import QSInfoDetail from './quanshuInfo/qsinfodetail';
import FWQuanShu from './houseinfo/fwquanshuDetail';
export default [
welcome,
......@@ -24,4 +25,5 @@ export default [
userInfo,
QSInfo,
QSInfoDetail,
FWQuanShu,
];
......@@ -158,14 +158,12 @@ export default {
detailData: payload,
};
},
setdetailData(state, { payload: { peopleName, idcard, birthDay, people, sex, addr } }) {
setdetailData(state, { payload: { peopleName, idcard, birthDay, people } }) {
const detailData = {
xingMing: peopleName,
identityCard: idcard,
birthday: birthDay,
minZu: people,
sex,
huJiDiZhi: addr,
};
return { ...state, detailData };
},
......
import { TabNavigator } from 'react-navigation';
import Empty from '../../empty';
import HouseScreen from './HouseScreen';
import ObligeeInfo from './ObligeeInfo';
import FWQuanShuScreen from './fwquanshuScreen';
const ErJiScreen = TabNavigator(
{
......@@ -20,19 +20,12 @@ const ErJiScreen = TabNavigator(
},
},
QuanShuInfo: {
screen: Empty('fangwuDetail', 'QuanLiRenScreen'),
screen: FWQuanShuScreen,
navigationOptions: {
lazy: true,
tabBarLabel: '权属信息',
},
},
ChuZuInfo: {
screen: Empty('fangwuDetaildfvdfsdfasfdef', 'SanJiInfo'),
navigationOptions: {
lazy: true,
tabBarLabel: '出租信息',
},
},
},
{
......
/**
* Created by zhouhuan on 2017/10/30.
*/
import React from 'react';
import { ScrollView } from 'react-native';
import { List } from 'antd-mobile';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
@connect(({ FWQuanShu, ListHouse, loading }) => ({ FWQuanShu, ListHouse, loading: !!loading.effects['FWQuanShu/getFWQuanShuDetail'] }))
class FWQuanShuScreen extends React.Component {
componentDidMount() {
const { houseID } = this.props.ListHouse;
this.props.dispatch(createAction('FWQuanShu/getFWQuanShuDetail')(houseID));
}
// onPress = () => {
// const ID = this.props.obligeeInfo.sourceData.id;
// this.props.dispatch(createAction('obligeeInfo/getObligeeDetail')(ID));
// };
// onEdit =() => {
// this.props.dispatch(createAction('obligeeInfo/setStatus')(true));
// };
// onSubmit = () => {
// this.props.form.validateFields({ force: true }, (error, value) => {
// if (!error) {
// this.props.dispatch(createAction('obligeeInfo/updateDSRDetail')({ id: this.props.obligeeInfo.sourceData.id, singularData: value }));
// } else {
// console.log('Validation failed');
// }
// });
// };
// onEditBack = () => {
// const { houseID } = this.props.ListHouse;
// this.props.dispatch(createAction('obligeeInfo/onEBack')(houseID));
// };
// onEndReached = () => {
// // 以下是制造新数据
// if (!this.props.loading) {
// const { houseID } = this.props.ListHouse;
// this.props.dispatch(createAction('obligeeInfo/getObligeeInfo')({ id: houseID }));
// }
// };
// keyExtractor = item => `${item.id}`;
// // 下拉刷新
// renderRefresh = () => {
// if (!this.props.loading) {
// const { houseID } = this.props.ListHouse;
// this.props.dispatch(createAction('obligeeInfo/getObligeeInfo')({ id: houseID, type: 'clear' }));
// }
// };
// renderItem =({ item }) => {
// // console.log(item);
// return (
// <WingBlank size="lg">
// <WhiteSpace size="lg" />
// <Card>
// <Card.Header
// title={item.dangShiRenXingMing}
// extra={<Text style={Styles.cardText} onPress={this.onPress}>&gt;&gt;详情</Text>}
// />
// <Card.Body>
// <Text style={Styles.cardBodyText}>当事人编号:<Text style={Styles.cardBodyText2}>{item.dangShiRenBianHao}</Text></Text>
// <Text style={Styles.cardBodyText}>证件号码:<Text style={Styles.cardBodyText2}>{item.dangShiRenIdentityCard}</Text></Text>
// </Card.Body>
// </Card>
// <WhiteSpace size="lg" />
// </WingBlank>
// );
// };
render() {
const { detailData, metas } = this.props.FWQuanShu;
return (
<ScrollView>
<List>
{
metas.map((m) => {
return (
<List.Item
key={m.key}
extra={detailData[m.key]}
>
{m.label}
</List.Item>
);
})
}
</List>
</ScrollView>
);
}
}
export default FWQuanShuScreen;
......@@ -3,7 +3,7 @@
*/
import React from 'react';
import Icon from 'react-native-vector-icons/FontAwesome';
import { View, FlatList } from 'react-native';
import { View, FlatList, Text } from 'react-native';
import { WingBlank, WhiteSpace } from 'antd-mobile';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
......@@ -40,6 +40,22 @@ class PeopleInfo extends React.Component {
this.props.dispatch(createAction('peopleInfo/getPeopleInfo')({ clear: 'clear', pxingMing: this.props.peopleInfo.searchValue }));
}
};
// Footer布局
renderFooter = () => (
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Text style={{ textAlign: 'center', justifyContent: 'center' }}>到底了!!!</Text>
<WhiteSpace size="lg" />
</WingBlank>
);
// 空布局
renderEmptyView = () => (
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Text style={{ textAlign: 'center', justifyContent: 'center' }}>当前无内容</Text>
<WhiteSpace size="lg" />
</WingBlank>
);
renderItem =({ item }) => {
return (
<FlatListItem
......@@ -67,9 +83,11 @@ class PeopleInfo extends React.Component {
onEndReached={this.onEndReached}
refreshing={this.props.loading}
onRefresh={this.renderRefresh}
ListFooterComponent={this.renderFooter}
ListEmptyComponent={this.renderEmptyView}
/>);
return (
<View>
<View style={{ marginBottom: 100 }}>
<SearchComponent onSearchSubmit={this.onSearchSubmit} onSearchChange={this.onSearchChange} />
<WingBlank size="lg">
<WhiteSpace size="lg" />
......
......@@ -55,6 +55,7 @@ class PeopleDetailEditScreen extends React.Component {
{ validator: this.validateNoNull },
],
})}
editable={false}
clear
placeholder="请输入"
ref={(el) => {
......@@ -73,6 +74,7 @@ class PeopleDetailEditScreen extends React.Component {
})}
clear
placeholder="请输入"
editable={false}
ref={(el) => {
this.customFocusInst = el;
}}
......
/* eslint-disable prefer-destructuring */
import React, { PureComponent } from 'react';
import { View, StyleSheet, Dimensions, ScrollView, Image, Text } from 'react-native';
import { View, StyleSheet, Image } from 'react-native';
import { WingBlank, Card, WhiteSpace, List, Button, Toast } from 'antd-mobile';
import { last } from 'lodash';
import { connect } from 'react-redux';
import PickerComponent from '../../../components/pickerComponent';
import { createAction } from '../../../utils/index';
const width = Dimensions.get('window').width;
const height = Dimensions.get('window').height;
// create a component
@connect(({ userInfo, domain }) => ({ userInfo, domain }))
class UserInfoHomeScreen extends PureComponent {
......@@ -21,6 +20,12 @@ class UserInfoHomeScreen extends PureComponent {
// console.log(path);
this.props.dispatch(createAction('domain/fetchParam')(path));
};
onOkButton =() => {
console.info(this.props.domain);
const domainPath = last(this.props.domain.arrayPath);
console.info(domainPath);
this.props.dispatch(createAction('domain/switch')(domainPath));
};
onLogout = () => {
console.log('注销');
this.props.dispatch(createAction('domain/logout')());
......@@ -70,7 +75,7 @@ class UserInfoHomeScreen extends PureComponent {
</View>
<WingBlank>
<View style={styles.pickerCom}>
<PickerComponent onClick={this.onClick} onPickerChange={this.onPickerChange} data={datas} pathVal={arrayPath} cols={cols} />
<PickerComponent onClick={this.onClick} onPickerChange={this.onPickerChange} onOkButton={this.onOkButton} data={datas} pathVal={arrayPath} cols={cols} />
</View>
</WingBlank>
</View>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论