userLogoutReasonReducer.js 1.24 KB
/**
 * sub app userLogout
 * @author: lixia.zhang
 * @date: 2018/04/13
 */

'use strict';

import InitialState from './userLogoutReasonInitialState';
import Immutable, {Map} from 'immutable';

const {
    ENABLE_SUBMIT_BTN,
    SHOW_LOGOUT_REASON_MODAL,
    SET_IMAGE_CHECK_SWITCH_STATE,
    IMAGE_CHECK_CODE_URL,
    UPDATE_TIP_MESSAGE,
    SUCCEED_SEND_CODE_STATUE
} = require('../../constants/actionTypes').default;

const initialState = new InitialState;

export default function userLogoutReasonReducer(state = initialState, action) {
    switch(action.type) {
        case ENABLE_SUBMIT_BTN:{
            return state.set('submitBtnEnable',action.payload);
        }
        case SHOW_LOGOUT_REASON_MODAL: {
            return state.set('showModalFlag',action.payload);
        }
        case SET_IMAGE_CHECK_SWITCH_STATE: {
            return state.set('imageCheckSwitchState',action.payload);
        }
        case IMAGE_CHECK_CODE_URL: {
            return state.set('imageCheckCodeUrl',action.payload);
        }
        case UPDATE_TIP_MESSAGE: {
            return state.set('tipMeaasge', action.payload);
        }
        case SUCCEED_SEND_CODE_STATUE: {
            return state.set('succeedSendCode', action.payload);
        }

    }
    return state;
}