提交 d3acd936 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 #新做出来的界面,列表。
上级 61bafb0b
import { getData } from '../utils/DataTemplate';
export default {
namespace: 'HouseDetail',
state: {
sourceData: {},
},
reducers: {
setList(state, { payload: { singularData } }) {
return { ...state, singularData };
},
},
effects: {
*getHouseDetail({ payload }, { call }) {
const coordinate = {
containerType: 'module',
containerName: 'query-DSRFWInfo',
datasourceName: 'QueryfwDetails',
};
console.info(payload);
const result = yield call(getData, coordinate, { pst: 0, psz: 10, params: { pID: 14 } });
console.info(result);
},
},
};
import { getData } from '../utils/DataTemplate';
import { getData } from '../../utils/DataTemplate';
export default {
namespace: 'ListHouse',
......
import welcome from './welcome';
import login from './login';
import listHouse from './listhouse';
import listHouse from './houseinfo/listhouse';
export default [
welcome,
......
import { calcModuleDatasource } from '../services/datasource';
import React, { Component } from 'react';
import { View, StyleSheet, Text } from 'react-native';
import { Button } from 'antd-mobile';
import { connect } from 'react-redux';
@connect(({ HouseDetail, loading }) => ({ HouseDetail, loading: !!loading.effects['ListHouse/getHouseDetail'] }))
class HouseDetail extends Component {
render() {
if (this.props.HouseDetail.enableEdit === true) {
return (
<View>
<Text>fff</Text>
</View>
);
} else {
return (
<View>
<Text>ttt</Text>
</View>
);
}
}
}
export default HouseDetail;
export default {
namespace: 'HouseDetail',
state: {
sourceData: [],
},
reducers: {
setList(state, { payload: { arrayData } }) {
return { ...state, sourceData: [...state.sourceData, ...arrayData] };
},
// 下拉刷新用到的,清空列表的数据
clearList(state) {
return { ...state, sourceData: [] };
},
},
effects: {
*getHouseList({ payload }, { take, put, call, select }) {
if (payload === 'clear') {
yield put({ type: 'clearList', payload: {} });
}
const { sourceData } = yield select(state => state.ListHouse);
console.info(sourceData);
const size = sourceData.length;
const result = yield call(calcModuleDatasource, 'query-DSRFWInfo', 'QueryfwTable', { pst: size, psz: 10 });
for (const row of result) {
yield put({ type: 'addHouse', payload: row });
yield take('addHouse/@@end');
}
},
*addHouse({ payload }, { put }) {
yield put({ type: 'setList', payload: { arrayData: [payload] } });
},
},
};
import React, { Component } from 'react';
import { View, StyleSheet, FlatList, Text } from 'react-native';
import { View, 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 {
componentDidMount() {
const { dispatch } = this.props;
dispatch(createAction('ListHouse/getHouseList')({ pst: 1, psz: 10 }));
dispatch(createAction('ListHouse/getHouseList')());
}
// 上拉加载更多
......@@ -73,7 +72,6 @@ class ListHouContent extends Component {
* @private
*/
renderItem = ({ item }) => {
console.info(item);
return (
<FlatListItem
item={item}
......@@ -82,9 +80,7 @@ class ListHouContent extends Component {
);
};
onPressItem = (id) => {
getData().then((r) => {
console.log(r);
});
this.props.dispatch(createAction('ListHouse/getHouseDetail')(id));
};
render() {
return (
......
import React from 'react';
import { View, Text } from 'react-native';
import { Toast } from 'antd-mobile';
import { errors as errorCodes } from './config';
import navigator from '../services/navigator';
const { navigate } = navigator;
const errStyle = {
......@@ -49,7 +51,7 @@ function showError(err) {
} else {
navigate('Error', {
title: '服务器内部错误',
content: <div style={errStyle}>{msg}</div>,
content: <Text>{ msg }</Text>,
});
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论