recharge.js 2.6 KB
import * as types from '../constants/ActionTypes';

const initialState = {
    orderList: {},
    accountBalance: {},
    yesterdayPay: {},
    monthBillList: {},
    monthAccountTotal: {},
    consumeRecordList: {},
    invoicesList: {},
    invoicesInfos: {},
    invoiceTem: {},
    invoiceTemDetail: {},
    invoiceMoney: {},
    //企业充值后台
    accountManageList: {},
    invoiceRecordList:{}
};

export default function environment(state = initialState, action) {
    switch (action.type) {
        case types.LOAD_ORDER_LIST:
            return Object.assign({}, state, {
                orderList: action.orderList
            });
        case types.LOAD_ACCOUNT_BALANCE:
            return Object.assign({}, state, {
                accountBalance: action.accountBalance
            });
        case types.LOAD_YESTERDAY_PAY:
            return Object.assign({}, state, {
                yesterdayPay: action.yesterdayPay
            });
        case types.LOAD_MONRH_BILL_list:
            return Object.assign({}, state, {
                monthBillList: action.monthBillList
            });
        case types.LOAD_MONRH_ACCOUNT_TOTAL:
            return Object.assign({}, state, {
                monthAccountTotal: action.monthAccountTotal
            });
        case types.LOAD_CONSUME_RECORD_LIST:
            return Object.assign({}, state, {
                consumeRecordList: action.consumeRecordList
            });
        case types.LOAD_INVOICES_LIST:
            return Object.assign({}, state, {
                invoicesList: action.invoicesList
            });
        case types.ASK_FOR_INVOICES:
            return Object.assign({}, state, {
                invoicesInfos: action.invoicesInfos
            });
        case types.LOAD_INVOICE_TEM:
            return Object.assign({}, state, {
                invoiceTem: action.invoiceTem
            });
        case types.LOAD_INVOICE_TEM_DETAIL:
            return Object.assign({}, state, {
                invoiceTemDetail: action.invoiceTemDetail
            });
        case types.LOAD_INCOICE_MONEY:
            return Object.assign({}, state, {
                invoiceMoney: action.invoiceMoney
            });


        //企业充值后台
        case types.LOAD_ACCOUNT_MANAGE:
            return Object.assign({}, state, {
                accountManageList: action.accountManageList
            });
        case types.LOAD_INVOICE_RECORD:
            return Object.assign({}, state, {
                invoiceRecordList: action.invoiceRecordList
            });

        default:
            return state;
    }
}