distribute.js 2.0 KB
import * as types from '../constants/ActionTypes';

const initialState = {
    issue_batch_list:[],
    issue_batch_detail:{},
    settlementplace_list:[],
    settlementplace_detail:{},
    notice_mobile_setting:{},
    wait_issue_batch_list:[],
    pay_money_record:[],
    branch_bank_list:[],
    legal_entity_lists:[]
};

export default function environment(state = initialState, action) {
    switch (action.type) {
        case types.ISSUE_BATCH_LIST:
            return Object.assign({}, state, {issue_batch_list: action.issue_batch_list});
            break;
        case types.ISSUE_BATCH_DETAIL:
            return Object.assign({}, state, {issue_batch_detail: action.issue_batch_detail});
            break;
        case types.SETTLEMENTPLACE_LIST:
            return Object.assign({}, state, {settlementplace_list: action.settlementplace_list});
            break;
        case types.SETTLEMENTPLACE_DETAIL:
            return Object.assign({}, state, {settlementplace_detail: action.settlementplace_detail});
            break;
        case types.GET_NOTICE_MOBILE_SETTING:
            return Object.assign({}, state, {notice_mobile_setting: action.notice_mobile_setting}); 
            break;
        case types.WAIT_ISSUE_BATCH_LIST:
            return Object.assign({}, state, {wait_issue_batch_list: action.wait_issue_batch_list}); 
            break;
        case types.GET_PAY_MONEY_RECORD:
            return Object.assign({}, state, {pay_money_record: action.pay_money_record}); 
            break;
        case types.GET_BANK_LIST:
            return Object.assign({}, state, {bank_list: action.bank_list}); 
            break;
        case types.GET_BRANCH_BANK_LIST:
            return Object.assign({}, state, {branch_bank_list: action.branch_bank_list}); 
            break;
        case types.GET_LEGAL_ENTITY_LIST:
            return Object.assign({}, state, {legal_entity_lists: action.legal_entity_lists}); 
            break;
        default:
            return state;
    }
}