...
|
...
|
@@ -7,10 +7,10 @@ import Immutable, {List, Record} from 'immutable'; |
|
|
import AccountSettlement from '../components/AccountSettlement'
|
|
|
|
|
|
import {
|
|
|
StyleSheet,
|
|
|
View,
|
|
|
Text,
|
|
|
ListView,
|
|
|
StyleSheet,
|
|
|
Dimensions,
|
|
|
Platform
|
|
|
}
|
|
|
from 'react-native';
|
|
|
|
...
|
...
|
@@ -48,41 +48,45 @@ export default class AccountSettlementContainer extends Component { |
|
|
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.fetchNextPage = this.fetchNextPage.bind(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
this.fetchNextPage();
|
|
|
this.props.actions.nextPageOfDataRequest();
|
|
|
}
|
|
|
|
|
|
fetchNextPage() {
|
|
|
let params = {
|
|
|
page: this.props.actStmt.currentPage+1,
|
|
|
size: 20,
|
|
|
shopId: this.props.home.get('shopId'),
|
|
|
}
|
|
|
this.props.actions.nextPageOfDataRequest(params);
|
|
|
}
|
|
|
render() {
|
|
|
let {actStmt} = this.props;
|
|
|
|
|
|
let dataBlob = {
|
|
|
'SECTION_HEADER':[{title:'累计结算金额(元)',content:`${this.props.actStmt.sum}`}],
|
|
|
'SECTION_SEPORATOR':[{}],
|
|
|
'SECTION_TITLE':[{}],
|
|
|
'SECTION_CONTENT':this.props.actStmt.jsonData,
|
|
|
'SECTION_HEADER': [{title:'累计结算金额(元)',content:`${actStmt.sum}`}],
|
|
|
'SECTION_SEPORATOR': [{}],
|
|
|
'SECTION_TITLE': [{}],
|
|
|
'SECTION_CONTENT': actStmt.list,
|
|
|
};
|
|
|
|
|
|
let mapBlob = Immutable.fromJS(dataBlob);
|
|
|
let end = this.props.actStmt.currentPage>=this.props.actStmt.pageCount;
|
|
|
|
|
|
return (
|
|
|
<AccountSettlement
|
|
|
dataBlob={mapBlob}
|
|
|
fetchNextPage={this.fetchNextPage}
|
|
|
isFetching={this.props.actStmt.isFetching}
|
|
|
hideLoadingFooter={this.props.actStmt.currentPage<1}
|
|
|
reachEnd={end}
|
|
|
/>
|
|
|
|
|
|
<View style={styles.container}>
|
|
|
<AccountSettlement
|
|
|
dataBlob={mapBlob}
|
|
|
isFetching={actStmt.isFetching}
|
|
|
/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
|
|
let navbarHeight = (Platform.OS === 'android') ? 50 : 64;
|
|
|
|
|
|
let styles = StyleSheet.create({
|
|
|
container: {
|
|
|
top: navbarHeight,
|
|
|
height: height - navbarHeight,
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(AccountSettlementContainer); |
...
|
...
|
|