RepayListContainer.js 1.55 KB
'use strict'

import React, {Component} from 'react';
import {
    StyleSheet,
    Dimensions,
    Platform,
    View,
    NativeModules,
    InteractionManager,
    NativeAppEventEmitter,
    Text,
} from 'react-native'

import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as newRegisterActions from '../reducers/installment/repayList/repayListActions';
import RepayList from '../components/installment/RepayList';
const actions = [
    newRegisterActions,
];
function mapStateToProps(state) {
    return {
        ...state
    };
}
function mapDispatchToProps(dispatch) {

    const creators = Map()
        .merge(...actions)
        .filter(value => typeof value === 'function')
        .toObject();

    return {
        actions: bindActionCreators(creators, dispatch),
        dispatch
    };
}
class RepayListContainer extends Component {
    constructor(props) {
        super(props);
        this._onPressGoNew = this._onPressGoNew.bind(this);
    }
    componentDidMount() {
        this.props.actions.getQueryAmtList("0");
    }

    _onPressGoNew() {
        this.props.actions.getoNewArrival();
    }

    render() {
        let {queryDays,repaymentList} = this.props.repayList;
        return (
            <RepayList
                repaymentList={repaymentList}
                onPressGoNew={this._onPressGoNew}
            />
        );
    }
}
let styles = StyleSheet.create({
    container: {
        flex: 1,
    },

});

export default connect(mapStateToProps, mapDispatchToProps)(RepayListContainer);