提交 2b48c022 authored 作者: 吴强's avatar 吴强

Merge branch 'master' of git://192.168.1.116/bolan-root/frontend/manager-app-sz into wq

# Conflicts: # src/models/login.js # src/routes/login.js #新做出来的界面,列表。
上级 5f021804
import welcome from './welcome';
import login from './login';
import listHouse from './listhouse';
import houseDetail from './houseDetail';
export default [
welcome,
login,
listHouse,
houseDetail,
];
import { connect } from 'react-redux';
import { getData } from '../utils/DataTemplate';
export default {
namespace: 'ListHouse',
......@@ -22,9 +22,14 @@ export default {
const { sourceData } = yield select(state => state.ListHouse);
console.info(sourceData);
const size = sourceData.length;
const result = yield call('', 'query-DSRFWInfo', 'QueryfwTable', { pst: size, psz: 10 });
const { arrayData } = result;
for (const row of arrayData) {
const coordinate = {
containerType: 'module',
containerName: 'query-DSRFWInfo',
datasourceName: 'QueryfwTable',
};
const result = yield call(getData, coordinate, { pst: size, psz: 10 });
// 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');
}
......
......@@ -4,7 +4,7 @@ import { TouchableOpacity, Text, View, StyleSheet, Dimensions, Image } from 'rea
const totalWidth = Dimensions.get('window').width;
class FlatListItem extends PureComponent {
onPress = () => {
this.props.onPressItem(this.props.item[1]);
this.props.onPressItem(this.props.item.id);
};
render() {
......@@ -16,7 +16,7 @@ class FlatListItem extends PureComponent {
>
<View style={styles.item}>
<View style={styles.width50}>
<Text style={{ color: '#1BB7FF', fontSize: 16 }}>{this.props.item[3]}</Text>
<Text style={{ color: '#1BB7FF', fontSize: 16 }}>{this.props.item.fangWuZuoLuo}</Text>
</View>
<View style={styles.nameView}>
<Text style={styles.nm}>发布时间:2017/10/27</Text>
......
......@@ -23,8 +23,7 @@ export default {
console.info(sourceData);
const size = sourceData.length;
const result = yield call(calcModuleDatasource, 'query-DSRFWInfo', 'QueryfwTable', { pst: size, psz: 10 });
const { arrayData } = result;
for (const row of arrayData) {
for (const row of result) {
yield put({ type: 'addHouse', payload: row });
yield take('addHouse/@@end');
}
......
......@@ -3,6 +3,7 @@ import { View, StyleSheet, FlatList, Text } from 'react-native';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
import FlatListItem from './FlatListItem';
import { getData } from "../../../utils/DataTemplate";
@connect(({ ListHouse, loading }) => ({ ListHouse, loading: !!loading.effects['ListHouse/getHouseList'] }))
class ListHouContent extends Component {
......@@ -15,7 +16,7 @@ class ListHouContent extends Component {
onEndReached = () => {
// 以下是制造新数据
if (!this.props.loading) {
this.props.dispatch(createAction('ListHouse/getHouseList')({pst: 11, psz: 10}));
this.props.dispatch(createAction('ListHouse/getHouseList')());
}
};
getItemLayout = (data, index) => (
......@@ -43,7 +44,7 @@ class ListHouContent extends Component {
* @private
*/
// 这里指定使用数组下标作为唯一索引
keyExtractor = (item, index) => `${item[0]}`;
keyExtractor = item => `${item.id}`;
// 自定义分割线
renderItemSeparatorComponent = ({ highlighted }) => (
......@@ -72,6 +73,7 @@ class ListHouContent extends Component {
* @private
*/
renderItem = ({ item }) => {
console.info(item);
return (
<FlatListItem
item={item}
......@@ -79,7 +81,11 @@ class ListHouContent extends Component {
/>
);
};
onPressItem = (id) => {
getData().then((r) => {
console.log(r);
});
};
render() {
return (
<FlatList
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论